I wanted an easy way to be able to group all domains/workgroups and group systems under those domains so I added a 'View all Domains/Wrkgrps' to the Queries list.
Code below.
list_viewdef_all_domains.php
[code]<?php
$query_array=array("headline"=>__("List all Domains/Workgroups"), "sql"=>"SELECT count(net_domain) AS domain_count, net_domain FROM system GROUP BY net_domain", "sort"=>"net_domain", "dir"=>"ASC", "get"=>array("file"=>"list.php", "title"=>__("Hosts with this domain"), "var"=>array("view"=>"systems_for_domains", "name"=>"%net_domain", "headline_addition"=>"%net_domain", ), ), "fields"=>array("10"=>array("name"=>"domain_count", "head"=>__("Count"), "show"=>"y", "link"=>"y", ), "20"=>array("name"=>"net_domain", "head"=>__("Domain/Workgroup"), "show"=>"y", "link"=>"y", "sort"=>"y", "search"=>"y", ), ), ); ?> [/code]
list_viewdef_systems_for_domains.php [code]<?php
$query_array=array("headline"=>__("List Systems with Domain/Workgroup"), "sql"=>"SELECT * FROM system WHERE net_domain = '" . $_GET["name"] . "' ", "sort"=>"system_name", "dir"=>"ASC", "get"=>array("file"=>"system.php", "title"=>"Go to System", "var"=>array("pc"=>"%system_uuid", "view"=>"summary", ), ), "fields"=>array("10"=>array("name"=>"system_uuid", "head"=>__("UUID"), "show"=>"n", ), "20"=>array("name"=>"net_ip_address", "head"=>__("IP"), "show"=>"y", "link"=>"y", ), "30"=>array("name"=>"system_name", "head"=>__("Hostname"), "show"=>"y", "link"=>"y", ), ), ); ?> [/code]
Add the following line to the queries array in inc_menu_array.php. It can go wherever you like, just change the array number. In my case it is after 'View all servers'. Watch the line wrap.
[code]"45"=>array("name"=>"All Domains/Wrkgrps", "link"=>"./list.php?view=all_domains", "image"=>"images/computer.png", "title"=>"All Domains/Wrkgrps",), [/code]
_________________ Jon Blakely
Computer Troubleshooters - Howick
Auckland
NZ
http://technologysolved.co.nz
|