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/graphs.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/graphs.php')
-rw-r--r-- | frontends/php/graphs.php | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/frontends/php/graphs.php b/frontends/php/graphs.php index f20237e5..4fec67d7 100644 --- a/frontends/php/graphs.php +++ b/frontends/php/graphs.php @@ -84,7 +84,8 @@ include_once "include/page_header.php"; ); check_fields($fields); - + validate_sort_and_sortorder(); + validate_group_with_host(PERM_READ_WRITE,array("allow_all_hosts","always_select_first_host","only_current_node"), 'web.last.conf.groupid', 'web.last.conf.hostid'); ?> @@ -363,28 +364,33 @@ include_once "include/page_header.php"; $table = new CTableInfo(S_NO_GRAPHS_DEFINED); $table->SetHeader(array( $_REQUEST["hostid"] != 0 ? NULL : S_HOSTS, - array( new CCheckBox("all_graphs",NULL, - "CheckAll('".$form->GetName()."','all_graphs');"), - S_NAME), - S_WIDTH,S_HEIGHT,S_GRAPH_TYPE)); + array( new CCheckBox("all_graphs",NULL,"CheckAll('".$form->GetName()."','all_graphs');"), + make_sorting_link(S_NAME,'g.name')), + make_sorting_link(S_WIDTH,'g.width'), + make_sorting_link(S_HEIGHT,'g.height'), + make_sorting_link(S_GRAPH_TYPE,'g.graphtype'))); if($_REQUEST["hostid"] > 0) { - $result = DBselect("SELECT distinct g.* FROM graphs g left join graphs_items gi on g.graphid=gi.graphid ". - " left join items i on gi.itemid=i.itemid ". - " WHERE i.hostid=".$_REQUEST["hostid"]. - " AND i.hostid not in (".$denyed_hosts.") ". - ' and '.DBin_node('g.graphid'). - " AND i.hostid is not NULL ". - " ORDER BY g.name, g.graphid"); + $result = DBselect('SELECT DISTINCT g.* '. + ' FROM graphs g '. + ' LEFT JOIN graphs_items gi ON g.graphid=gi.graphid '. + ' LEFT JOIN items i ON gi.itemid=i.itemid '. + ' WHERE i.hostid='.$_REQUEST['hostid']. + ' AND i.hostid NOT IN ('.$denyed_hosts.') '. + ' AND '.DBin_node('g.graphid'). + ' AND i.hostid is not NULL '. + order_by('g.name,g.width,g.height,g.graphtype','g.graphid')); } else { - $result = DBselect("SELECT distinct g.* FROM graphs g left join graphs_items gi on g.graphid=gi.graphid ". - " left join items i on gi.itemid=i.itemid ". - ' where '.DBin_node('g.graphid'). - " AND ( i.hostid not in (".$denyed_hosts.") OR i.hostid is NULL )". - " ORDER BY g.name, g.graphid"); + $result = DBselect('SELECT DISTINCT g.* '. + ' FROM graphs g '. + ' LEFT JOIN graphs_items gi ON g.graphid=gi.graphid '. + ' LEFT JOIN items i ON gi.itemid=i.itemid '. + ' WHERE '.DBin_node('g.graphid'). + ' AND ( i.hostid not in ('.$denyed_hosts.') OR i.hostid is NULL )'. + order_by('g.name,g.width,g.height,g.graphtype','g.graphid')); } while($row=DBfetch($result)) { |