From e6d3bc1a6eae3d6847198856e7e7f57eb8a0c98b Mon Sep 17 00:00:00 2001 From: hugetoad Date: Tue, 27 Dec 2005 10:59:17 +0000 Subject: Minor changes. git-svn-id: svn://svn.zabbix.com/trunk@2430 97f52cf1-0a1b-0410-bd0e-c28be96e8082 --- frontends/php/include/forms.inc.php | 250 +++++++++++++++++++++--------------- 1 file changed, 145 insertions(+), 105 deletions(-) (limited to 'frontends/php/include/forms.inc.php') diff --git a/frontends/php/include/forms.inc.php b/frontends/php/include/forms.inc.php index c63bfd74..bb1e7d38 100644 --- a/frontends/php/include/forms.inc.php +++ b/frontends/php/include/forms.inc.php @@ -1501,7 +1501,9 @@ $actionid=$action["actionid"]; $actiontype=$action["actiontype"]; - $triggerid=$action["triggerid"]; + $filter_triggerid=$action["filter_triggerid"]; + $filter_groupid=$action["filter_groupid"]; + $filter_hostid=$action["filter_hostid"]; $source=$action["source"]; $filter_trigger_name=$action["filter_trigger_name"]; $good=$action["good"]; @@ -1533,6 +1535,9 @@ $source=0; $actiontype=0; $filter_trigger_name=""; + $filter_triggerid=0; + $filter_groupid=0; + $filter_hostid=0; $description=""; // $delay=30; @@ -1554,6 +1559,9 @@ } } + $filtertype=@iif(isset($_REQUEST["filtertype"]),$_REQUEST["filtertype"],0); + + show_form_begin("actions.action"); echo nbsp(S_NEW_ACTION); $col=0; @@ -1571,129 +1579,161 @@ echo ""; show_table2_v_delimiter($col++); - echo nbsp(S_FILTER_HOST_GROUP); - show_table2_h_delimiter(); - $h2=""."Host: zabbix.com"; + echo "
"; + echo ""."Trigger: Processor load is too high on zabbix.com"; + echo "
"; + echo ""."Trigger description like: \"Processor load is too high\""; + +// show_table2_v_delimiter($col); +// echo nbsp(" "."Condition"); +// show_table2_h_delimiter(); + $h2=""; +// echo $h2; + + if($filtertype==0) + { + show_table2_v_delimiter($col); + echo nbsp(" Condition"); + show_table2_h_delimiter(); + $h2=$h2." = ".""; + echo $h2; } - echo $h2; - echo ""; - - show_table2_v_delimiter($col++); - echo nbsp(S_FILTER_HOST); - show_table2_h_delimiter(); - $h2=""; + show_table2_v_delimiter($col++); + echo nbsp(S_FILTER_HOST); + show_table2_h_delimiter(); + $h2=""; - show_table2_v_delimiter($col++); - echo S_FILTER_TRIGGER; - show_table2_h_delimiter(); - $h2=""; + $h2=$h2.form_select("groupid",0,S_ALL_SMALL); + $result=DBselect("select groupid,name from groups order by name"); + while($row=DBfetch($result)) { - if(!check_right("Host","R",$row2["hostid"])) +// Check if at least one host with read permission exists for this group + $result2=DBselect("select h.hostid,h.host from hosts h,items i,hosts_groups hg where h.status=".HOST_STATUS_MONITORED." and h.hostid=i.hostid and hg.groupid=".$row["groupid"]." and hg.hostid=h.hostid group by h.hostid,h.host order by h.host"); + $cnt=0; + while($row2=DBfetch($result2)) { - continue; + if(!check_right("Host","R",$row2["hostid"])) + { + continue; + } + $cnt=1; break; + } + if($cnt!=0) + { + $h2=$h2.form_select("groupid",$row["groupid"],$row["name"]); } - $cnt=1; break; } - if($cnt!=0) + $h2=$h2." "; + + $h2=$h2." "; - - $h2=$h2." "; + echo $h2; - $result=DBselect($sql); - while($row=DBfetch($result)) - { - if(!check_right("Host","R",$row["hostid"])) + if(isset($_REQUEST["hostid"])) { - continue; + show_table2_v_delimiter($col++); + echo " "; + show_table2_h_delimiter(); + $result=DBselect("select t.triggerid,t.description from triggers t,functions f, hosts h, items i where h.hostid=i.hostid and f.itemid=i.itemid and t.triggerid=f.triggerid and h.hostid=".$_REQUEST["hostid"]." order by t.description"); + echo ""; } - $h2=$h2.form_select("hostid",$row["hostid"],$row["host"]); - } - $h2=$h2." "; - echo $h2; - if(isset($_REQUEST["hostid"])) - { show_table2_v_delimiter($col++); - echo " "; + echo S_FILTER_TRIGGER_NAME; show_table2_h_delimiter(); - $result=DBselect("select t.triggerid,t.description from triggers t,functions f, hosts h, items i where h.hostid=i.hostid and f.itemid=i.itemid and t.triggerid=f.triggerid and h.hostid=".$_REQUEST["hostid"]." order by t.description"); - echo ""; - } + echo ""; - show_table2_v_delimiter($col++); - echo S_FILTER_TRIGGER_NAME; - show_table2_h_delimiter(); - echo ""; - - show_table2_v_delimiter($col++); - echo nbsp(S_FILTER_TRIGGER_SEVERITY); - show_table2_h_delimiter(); - echo ""; + show_table2_v_delimiter($col++); + echo nbsp(S_FILTER_TRIGGER_SEVERITY); + show_table2_h_delimiter(); + echo ""; + show_table2_v_delimiter($col++); + echo nbsp(S_FILTER_WHEN_TRIGGER_BECOMES); + show_table2_h_delimiter(); + echo ""; + } show_table2_v_delimiter($col++); - echo nbsp(S_FILTER_WHEN_TRIGGER_BECOMES); + echo nbsp(" "); show_table2_h_delimiter(); - echo ""; + echo ""; show_table2_v_delimiter($col++); echo nbsp(S_ACTION_TYPE); -- cgit