summaryrefslogtreecommitdiffstats
path: root/frontends/php/triggers.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/triggers.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/triggers.php')
-rw-r--r--frontends/php/triggers.php31
1 files changed, 18 insertions, 13 deletions
diff --git a/frontends/php/triggers.php b/frontends/php/triggers.php
index b8995b19..9ec4defa 100644
--- a/frontends/php/triggers.php
+++ b/frontends/php/triggers.php
@@ -82,7 +82,8 @@ include_once "include/page_header.php";
$_REQUEST["showdisabled"] = get_request("showdisabled", get_profile("web.triggers.showdisabled", 0));
check_fields($fields);
-
+ validate_sort_and_sortorder();
+
if(isset($_REQUEST["triggerid"]))
if(!check_right_on_trigger_by_triggerid(PERM_READ_WRITE, $_REQUEST["triggerid"]))
access_deny();
@@ -376,26 +377,30 @@ include_once "include/page_header.php";
$table = new CTableInfo(S_NO_TRIGGERS_DEFINED);
$table->setHeader(array(
- $_REQUEST["hostid"] > 0 ? NULL : S_HOST,
+ $_REQUEST["hostid"] > 0 ? NULL : make_sorting_link(S_HOST,'h.host'),
array( new CCheckBox("all_triggers",NULL,
"CheckAll('".$form->GetName()."','all_triggers');")
- ,S_NAME
+ ,make_sorting_link(S_NAME,'t.description'),
),
- S_EXPRESSION, S_SEVERITY, S_STATUS, S_ERROR));
-
- $sql = 'select distinct h.hostid,h.host,t.*'.
- ' from triggers t left join functions f on t.triggerid=f.triggerid '.
- ' left join items i on f.itemid=i.itemid '.
- ' left join hosts h on h.hostid=i.hostid '.
- ' where '.DBin_node('t.triggerid');
+ S_EXPRESSION,
+ make_sorting_link(S_SEVERITY,'t.priority'),
+ make_sorting_link(S_STATUS,'t.status'),
+ S_ERROR));
+
+ $sql = 'SELECT DISTINCT h.hostid,h.host,t.*'.
+ ' FROM triggers t '.
+ ' LEFT JOIN functions f ON t.triggerid=f.triggerid '.
+ ' LEFT JOIN items i ON f.itemid=i.itemid '.
+ ' LEFT JOIN hosts h ON h.hostid=i.hostid '.
+ ' WHERE '.DBin_node('t.triggerid');
if($showdisabled == 0)
- $sql .= ' and t.status <> '.TRIGGER_STATUS_DISABLED;
+ $sql .= ' AND t.status <> '.TRIGGER_STATUS_DISABLED;
if($_REQUEST['hostid'] > 0)
- $sql .= ' and h.hostid='.$_REQUEST['hostid'];
+ $sql .= ' AND h.hostid='.$_REQUEST['hostid'];
- $sql .= ' order by h.host,t.description';
+ $sql .= order_by('h.host,t.description,t.priority,t.status');
$result=DBselect($sql);
while($row=DBfetch($result))