diff options
author | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-07-23 09:37:47 +0000 |
---|---|---|
committer | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-07-23 09:37:47 +0000 |
commit | 5c3768ceaa3080321c3bf6481640fcdd380d0025 (patch) | |
tree | 172b94421c008b166a1106c5c42f983c2b8fe5b3 /frontends/php/triggers.php | |
parent | 6db9d7bcf88b79ab279dd2b5dc929fabb1a23f1f (diff) | |
download | zabbix-5c3768ceaa3080321c3bf6481640fcdd380d0025.tar.gz zabbix-5c3768ceaa3080321c3bf6481640fcdd380d0025.tar.xz zabbix-5c3768ceaa3080321c3bf6481640fcdd380d0025.zip |
- [DEV-192] added filter to Status of triggers (Artem)
- [DEV-191] monitoring screens inline update preparation (Artem)
- [DEV-192] added severity filter in status of triggers (Artem)
- [DEV-137] sql fixes for oracle (Artem)
- [ZBX-396] fixed error maps message (Artem)
- [ZBX-394] fixed showing hosts without group in status of triggers (Artem)
- [DEV-137] small fixes (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5841 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/triggers.php')
-rw-r--r-- | frontends/php/triggers.php | 109 |
1 files changed, 53 insertions, 56 deletions
diff --git a/frontends/php/triggers.php b/frontends/php/triggers.php index 96635cb3..885cc3b6 100644 --- a/frontends/php/triggers.php +++ b/frontends/php/triggers.php @@ -365,77 +365,74 @@ include_once "include/page_header.php"; show_table_header(S_CONFIGURATION_OF_TRIGGERS_BIG,$form); echo SBR; - - $r_form = new CForm(); - $r_form->SetMethod('get'); - $r_form->AddItem(array('[', - new CLink($showdisabled ? S_HIDE_DISABLED_TRIGGERS : S_SHOW_DISABLED_TRIGGERS, - 'triggers.php?showdisabled='.($showdisabled ? 0 : 1),NULL), - ']', SPACE)); - - $cmbGroup = new CComboBox("groupid",$_REQUEST["groupid"],"submit()"); - $cmbHosts = new CComboBox("hostid",$_REQUEST["hostid"],"submit()"); - - $cmbGroup->AddItem(0,S_ALL_SMALL); - - $result=DBselect('SELECT DISTINCT g.groupid,g.name '. - ' FROM groups g, hosts_groups hg, hosts h, items i '. - ' WHERE '.DBcondition('h.hostid',$available_hosts). - ' AND hg.groupid=g.groupid '. - ' AND h.hostid=i.hostid '. - ' AND hg.hostid=h.hostid '. - ' ORDER BY g.name'); - while($row=DBfetch($result)){ - $cmbGroup->AddItem($row['groupid'],$row['name']); - } - $r_form->AddItem(array(S_GROUP.SPACE,$cmbGroup)); - - if($_REQUEST['groupid'] > 0){ - $sql='SELECT h.hostid,h.host '. - ' FROM hosts h,items i,hosts_groups hg '. - ' WHERE h.hostid=i.hostid '. - ' AND hg.groupid='.$_REQUEST['groupid']. - ' AND hg.hostid=h.hostid'. - ' AND '.DBcondition('h.hostid',$available_hosts). - ' GROUP BY h.hostid,h.host '. - ' ORDER BY h.host'; - } - else{ - $cmbHosts->AddItem(0,S_ALL_SMALL); - $sql='SELECT h.hostid,h.host '. - ' FROM hosts h,items i '. - ' WHERE h.hostid=i.hostid '. - ' AND '.DBcondition('h.hostid',$available_hosts). - ' GROUP BY h.hostid,h.host '. - ' ORDER BY h.host'; - } - - $result=DBselect($sql); - while($row=DBfetch($result)){ - $cmbHosts->AddItem($row["hostid"],$row["host"]); - } - - $r_form->AddItem(array(SPACE.S_HOST.SPACE,$cmbHosts)); - - show_table_header(S_TRIGGERS_BIG, $r_form); ?> <?php if(isset($_REQUEST['massupdate']) && isset($_REQUEST['g_triggerid'])){ - echo SBR; insert_mass_update_trigger_form(); } else if(isset($_REQUEST["form"])){ /* FORM */ - echo SBR; insert_trigger_form(); } else if(isset($_REQUEST["form_copy_to"]) && isset($_REQUEST["g_triggerid"])){ - echo SBR; insert_copy_elements_to_forms("g_triggerid"); } else{ /* TABLE */ + $r_form = new CForm(); + $r_form->SetMethod('get'); + $r_form->AddItem(array('[', + new CLink($showdisabled ? S_HIDE_DISABLED_TRIGGERS : S_SHOW_DISABLED_TRIGGERS, + 'triggers.php?showdisabled='.($showdisabled ? 0 : 1),NULL), + ']', SPACE)); + + $cmbGroup = new CComboBox("groupid",$_REQUEST["groupid"],"submit()"); + $cmbHosts = new CComboBox("hostid",$_REQUEST["hostid"],"submit()"); + + $cmbGroup->AddItem(0,S_ALL_SMALL); + + $result=DBselect('SELECT DISTINCT g.groupid,g.name '. + ' FROM groups g, hosts_groups hg, hosts h, items i '. + ' WHERE '.DBcondition('h.hostid',$available_hosts). + ' AND hg.groupid=g.groupid '. + ' AND h.hostid=i.hostid '. + ' AND hg.hostid=h.hostid '. + ' ORDER BY g.name'); + while($row=DBfetch($result)){ + $cmbGroup->AddItem($row['groupid'],$row['name']); + } + $r_form->AddItem(array(S_GROUP.SPACE,$cmbGroup)); + + if($_REQUEST['groupid'] > 0){ + $sql='SELECT h.hostid,h.host '. + ' FROM hosts h,items i,hosts_groups hg '. + ' WHERE h.hostid=i.hostid '. + ' AND hg.groupid='.$_REQUEST['groupid']. + ' AND hg.hostid=h.hostid'. + ' AND '.DBcondition('h.hostid',$available_hosts). + ' GROUP BY h.hostid,h.host '. + ' ORDER BY h.host'; + } + else{ + $cmbHosts->AddItem(0,S_ALL_SMALL); + $sql='SELECT h.hostid,h.host '. + ' FROM hosts h,items i '. + ' WHERE h.hostid=i.hostid '. + ' AND '.DBcondition('h.hostid',$available_hosts). + ' GROUP BY h.hostid,h.host '. + ' ORDER BY h.host'; + } + + $result=DBselect($sql); + while($row=DBfetch($result)){ + $cmbHosts->AddItem($row["hostid"],$row["host"]); + } + + $r_form->AddItem(array(SPACE.S_HOST.SPACE,$cmbHosts)); + + show_table_header(S_TRIGGERS_BIG, $r_form); + $form = new CForm('triggers.php'); $form->SetName('triggers'); $form->SetMethod('post'); |