summaryrefslogtreecommitdiffstats
path: root/frontends/php/items.php
diff options
context:
space:
mode:
authorartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-11-12 10:20:29 +0000
committerartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-11-12 10:20:29 +0000
commitc0c1b50df1ec73e0cd6b72c7cc10197e6cc44a0a (patch)
tree43b9a3f70cc15cfcc674fafbd0c8a3829417331e /frontends/php/items.php
parentd7d135227396a5b3cede974e94c25032a1bc69d2 (diff)
downloadzabbix-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/items.php')
-rw-r--r--frontends/php/items.php30
1 files changed, 19 insertions, 11 deletions
diff --git a/frontends/php/items.php b/frontends/php/items.php
index 88590e1a..f6aecf57 100644
--- a/frontends/php/items.php
+++ b/frontends/php/items.php
@@ -158,7 +158,8 @@ include_once "include/page_header.php";
$_REQUEST["showdisabled"] = get_request("showdisabled", get_profile("web.items.showdisabled", 0));
check_fields($fields);
-
+ validate_sort_and_sortorder();
+
$showdisabled = get_request("showdisabled", 0);
$accessible_hosts = get_accessible_hosts_by_user($USER_DETAILS,PERM_READ_WRITE,null,null,get_current_nodeid());
@@ -739,23 +740,30 @@ include_once "include/page_header.php";
$table = new CTableInfo();
$table->SetHeader(array(
- $show_host ? S_HOST : null,
+ $show_host ? make_sorting_link(S_HOST,'h.host') : null,
array( new CCheckBox("all_items",null,
"CheckAll('".$form->GetName()."','all_items');"),
- S_DESCRIPTION),
- S_KEY,nbsp(S_UPDATE_INTERVAL),
- S_HISTORY,S_TRENDS,S_TYPE,S_STATUS,
+ make_sorting_link(S_DESCRIPTION,'i.description')),
+ make_sorting_link(S_KEY,'i.key_'),
+ make_sorting_link(nbsp(S_UPDATE_INTERVAL),'i.delay'),
+ make_sorting_link(S_HISTORY,'i.history'),
+ make_sorting_link(S_TRENDS,'i.trends'),
+ make_sorting_link(S_TYPE,'i.type'),
+ make_sorting_link(S_STATUS,'i.status'),
$show_applications ? S_APPLICATIONS : null,
S_ERROR));
$from_tables['i'] = 'items i'; /* NOTE: must be added as last element to use left join */
- $db_items = DBselect('select distinct th.host as template_host,th.hostid as template_hostid, h.host, i.* '.
- ' from '.implode(',', $from_tables).
- ' left join items ti on i.templateid=ti.itemid left join hosts th on ti.hostid=th.hostid '.
- ' where '.implode(' and ', $where_case).' order by h.host,i.description,i.key_,i.itemid');
- while($db_item = DBfetch($db_items))
- {
+ $db_items = DBselect('SELECT DISTINCT th.host as template_host,th.hostid as template_hostid, h.host, i.* '.
+ ' FROM '.implode(',', $from_tables).
+ ' LEFT JOIN items ti ON i.templateid=ti.itemid '.
+ ' LEFT JOIN hosts th ON ti.hostid=th.hostid '.
+ ' WHERE '.implode(' and ', $where_case).
+ order_by('h.host,i.description,i.key_,i.delay,i.history,i.trends,i.type,i.status','i.itemid'));
+
+ while($db_item = DBfetch($db_items)){
+
$description = array();
$item_description = item_description($db_item["description"],$db_item["key_"]);