diff options
author | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-11-12 10:20:29 +0000 |
---|---|---|
committer | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-11-12 10:20:29 +0000 |
commit | c0c1b50df1ec73e0cd6b72c7cc10197e6cc44a0a (patch) | |
tree | 43b9a3f70cc15cfcc674fafbd0c8a3829417331e /frontends/php/hostprofiles.php | |
parent | d7d135227396a5b3cede974e94c25032a1bc69d2 (diff) | |
download | zabbix-c0c1b50df1ec73e0cd6b72c7cc10197e6cc44a0a.tar.gz zabbix-c0c1b50df1ec73e0cd6b72c7cc10197e6cc44a0a.tar.xz zabbix-c0c1b50df1ec73e0cd6b72c7cc10197e6cc44a0a.zip |
- [DEV-66] added sorting to screens (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@4996 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/hostprofiles.php')
-rw-r--r-- | frontends/php/hostprofiles.php | 39 |
1 files changed, 26 insertions, 13 deletions
diff --git a/frontends/php/hostprofiles.php b/frontends/php/hostprofiles.php index 34e2ffe4..c87d6710 100644 --- a/frontends/php/hostprofiles.php +++ b/frontends/php/hostprofiles.php @@ -38,7 +38,8 @@ include_once "include/page_header.php"; ); check_fields($fields); - + validate_sort_and_sortorder(); + validate_group(PERM_READ_ONLY, array("allow_all_hosts","always_select_first_host","monitored_hosts","with_items")); ?> <?php @@ -77,28 +78,40 @@ include_once "include/page_header.php"; else { $table = new CTableInfo(); - $table->setHeader(array(S_HOST,S_NAME,S_OS,S_SERIALNO,S_TAG,S_MACADDRESS)); + $table->setHeader(array( + is_show_subnodes() ? make_sorting_link(S_NODE,'h.hostid') : null, + make_sorting_link(S_HOST,'h.host'), + make_sorting_link(S_NAME,'p.name'), + make_sorting_link(S_OS,'p.os'), + make_sorting_link(S_SERIALNO,'p.serialno'), + make_sorting_link(S_TAG,'p.tag'), + make_sorting_link(S_MACADDRESS,'p.macaddress')) + ); if($_REQUEST["groupid"] > 0) { - $sql="select h.hostid,h.host,p.name,p.os,p.serialno,p.tag,p.macaddress". - " from hosts h,hosts_profiles p,hosts_groups hg where h.hostid=p.hostid". - " and h.hostid=hg.hostid and hg.groupid=".$_REQUEST["groupid"]. - " and h.hostid in (".$availiable_hosts.") ". - " order by h.host"; + $sql='SELECT h.hostid,h.host,p.name,p.os,p.serialno,p.tag,p.macaddress'. + ' FROM hosts h,hosts_profiles p,hosts_groups hg '. + ' WHERE h.hostid=p.hostid'. + ' and h.hostid=hg.hostid '. + ' and hg.groupid='.$_REQUEST['groupid']. + ' and h.hostid in ('.$availiable_hosts.') '. + order_by('h.host,h.hostid,p.name,p.os,p.serialno,p.tag,p.macaddress'); } - else - { - $sql="select h.hostid,h.host,p.name,p.os,p.serialno,p.tag,p.macaddress". - " from hosts h,hosts_profiles p where h.hostid=p.hostid". - " and h.hostid in (".$availiable_hosts.") ". - " order by h.host"; + else{ + + $sql='SELECT h.hostid,h.host,p.name,p.os,p.serialno,p.tag,p.macaddress'. + ' FROM hosts h,hosts_profiles p '. + ' WHERE h.hostid=p.hostid'. + ' AND h.hostid in ('.$availiable_hosts.') '. + order_by('h.host,h.hostid,p.name,p.os,p.serialno,p.tag,p.macaddress'); } $result=DBselect($sql); while($row=DBfetch($result)) { $table->AddRow(array( + get_node_name_by_elid($row['hostid']), new CLink($row["host"],"?hostid=".$row["hostid"].url_param("groupid"),"action"), $row["name"], $row["os"], |