diff options
| author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-12-28 09:31:56 +0000 |
|---|---|---|
| committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-12-28 09:31:56 +0000 |
| commit | df8935233f676390da5d1f4a21a9a00431c0c2d5 (patch) | |
| tree | 35c1447ce5d40fd0953c685f2422f15478e234d8 /frontends/php/include/forms.inc.php | |
| parent | 2578aecfe7a1b514cc7955ba89072169671741af (diff) | |
| download | zabbix-df8935233f676390da5d1f4a21a9a00431c0c2d5.tar.gz zabbix-df8935233f676390da5d1f4a21a9a00431c0c2d5.tar.xz zabbix-df8935233f676390da5d1f4a21a9a00431c0c2d5.zip | |
More changes for new configuration of actions.
git-svn-id: svn://svn.zabbix.com/trunk@2436 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/forms.inc.php')
| -rw-r--r-- | frontends/php/include/forms.inc.php | 140 |
1 files changed, 23 insertions, 117 deletions
diff --git a/frontends/php/include/forms.inc.php b/frontends/php/include/forms.inc.php index 04300378..9ae3a084 100644 --- a/frontends/php/include/forms.inc.php +++ b/frontends/php/include/forms.inc.php @@ -1523,7 +1523,7 @@ { $repeat=1; } - $sql="select conditiontype, operator, value from conditions where actionid=".$_REQUEST["actionid"]; + $sql="select conditiontype, operator, value from conditions where actionid=".$_REQUEST["actionid"]." order by conditiontype"; $result=DBselect($sql); $i=1; while($condition=DBfetch($result)) @@ -1654,6 +1654,26 @@ } $h2=$h2."</SELECT>"; } + else if($conditiontype == CONDITION_TYPE_HOST) + { + $h2=$h2."<select class=\"biginput\" name=\"value\">"; + $result=DBselect("select hostid,host from hosts order by host"); + while($row=DBfetch($result)) + { + $h2=$h2.form_select("value",$row["hostid"],$row["host"]); + } + $h2=$h2."</SELECT>"; + } + else if($conditiontype == CONDITION_TYPE_TRIGGER) + { + $h2=$h2."<select class=\"biginput\" name=\"value\">"; + $result=DBselect("select distinct h.host,t.triggerid,t.description from triggers t, functions f,items i, hosts h where t.triggerid=f.triggerid and f.itemid=i.itemid and h.hostid=i.hostid order by h.host"); + while($row=DBfetch($result)) + { + $h2=$h2.form_select("value",$row["triggerid"],$row["host"].": ".$row["description"]); + } + $h2=$h2."</SELECT>"; + } else if($conditiontype == CONDITION_TYPE_TRIGGER_NAME) { $h2=$h2."<input class=\"biginput\" name=\"value\" value=\"\" size=40>"; @@ -1680,120 +1700,6 @@ $h2=$h2."<OPTION VALUE=\"5\">".S_DISASTER; $h2=$h2."</SELECT>"; } - else - { - show_table2_v_delimiter($col++); - echo nbsp(S_FILTER_HOST); - show_table2_h_delimiter(); - $h2="<select class=\"biginput\" name=\"filter_hostid\">"; - $h2=$h2.form_select("hostid",0,S_ALL_SMALL); - $result=DBselect("select hostid,host from hosts where status<>".HOST_STATUS_DELETED." order by host"); - while($row=DBfetch($result)) - { - $h2=$h2.form_select("filter_hostid",$row["hostid"],$row["host"]); - } - echo $h2; - echo "</SELECT>"; - - show_table2_v_delimiter($col++); - echo S_FILTER_TRIGGER; - show_table2_h_delimiter(); - $h2="<select class=\"biginput\" name=\"groupid\" onChange=\"submit()\">"; - $h2=$h2.form_select("groupid",0,S_ALL_SMALL); - $result=DBselect("select groupid,name from groups order by name"); - while($row=DBfetch($result)) - { -// 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)) - { - if(!check_right("Host","R",$row2["hostid"])) - { - continue; - } - $cnt=1; break; - } - if($cnt!=0) - { - $h2=$h2.form_select("groupid",$row["groupid"],$row["name"]); - } - } - $h2=$h2."</select> "; - - $h2=$h2."<select class=\"biginput\" name=\"hostid\" onChange=\"submit()\">"; - $h2=$h2.form_select("hostid",0,S_SELECT_HOST_DOT_DOT_DOT); - - if(isset($_REQUEST["groupid"])) - { - $sql="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=".$_REQUEST["groupid"]." and hg.hostid=h.hostid group by h.hostid,h.host order by h.host"; - } - else - { - $sql="select h.hostid,h.host from hosts h,items i where h.status=".HOST_STATUS_MONITORED." and h.hostid=i.hostid group by h.hostid,h.host order by h.host"; - } - - $result=DBselect($sql); - while($row=DBfetch($result)) - { - if(!check_right("Host","R",$row["hostid"])) - { - continue; - } - $h2=$h2.form_select("hostid",$row["hostid"],$row["host"]); - } - $h2=$h2."</select> "; - echo $h2; - - if(isset($_REQUEST["hostid"])) - { - 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 "<select class=\"biginput\" name=\"filter_triggerid\" size=1>"; - while($row=DBfetch($result)) - { - $triggerid_=$row["triggerid"]; - $description_=expand_trigger_description($triggerid_); - if(isset($triggerid) && ($triggerid==$triggerid_)) - { - echo "<OPTION VALUE='$triggerid_' SELECTED>$description_"; - } - else - { - echo "<OPTION VALUE='$triggerid_'>$description_"; - } - } - echo "</SELECT>"; - } - - show_table2_v_delimiter($col++); - echo S_FILTER_TRIGGER_NAME; - show_table2_h_delimiter(); - echo "<input class=\"biginput\" name=\"filter_trigger_name\" value=\"$filter_trigger_name\" size=64>"; - - show_table2_v_delimiter($col++); - echo nbsp(S_FILTER_TRIGGER_SEVERITY); - show_table2_h_delimiter(); - echo "<select class=\"biginput\" name=\"filter_trigger_severity\" size=1>"; - echo "<OPTION VALUE=\"0\" "; if($severity==0) echo "SELECTED"; echo ">".S_NOT_CLASSIFIED; - echo "<OPTION VALUE=\"1\" "; if($severity==1) echo "SELECTED"; echo ">".S_INFORMATION; - echo "<OPTION VALUE=\"2\" "; if($severity==2) echo "SELECTED"; echo ">".S_WARNING; - echo "<OPTION VALUE=\"3\" "; if($severity==3) echo "SELECTED"; echo ">".S_AVERAGE; - echo "<OPTION VALUE=\"4\" "; if($severity==4) echo "SELECTED"; echo ">".S_HIGH; - echo "<OPTION VALUE=\"5\" "; if($severity==5) echo "SELECTED"; echo ">".S_DISASTER; - echo "</SELECT>"; - - show_table2_v_delimiter($col++); - echo nbsp(S_FILTER_WHEN_TRIGGER_BECOMES); - show_table2_h_delimiter(); - echo "<select class=\"biginput\" name=\"good\" size=1>"; - echo "<OPTION VALUE=\"1\""; if($good==1) echo "SELECTED"; echo ">".S_ON; - echo "<OPTION VALUE=\"0\""; if($good==0) echo "SELECTED"; echo ">".S_OFF; - echo "<OPTION VALUE=\"2\""; if($good==2) echo "SELECTED"; echo ">".S_ON_OR_OFF; - echo "</SELECT>"; - } echo $h2; show_table2_v_delimiter($col++); @@ -1874,12 +1780,12 @@ show_table2_v_delimiter($col++); echo S_SUBJECT; show_table2_h_delimiter(); - echo "<input class=\"biginput\" name=\"subject\" value=\"$subject\" size=70>"; + echo "<input class=\"biginput\" name=\"subject\" value=\"$subject\" size=80>"; show_table2_v_delimiter($col++); echo S_MESSAGE; show_table2_h_delimiter(); - echo "<textarea class=\"biginput\" name=\"message\" cols=70 ROWS=\"7\" wrap=\"soft\">$message</TEXTAREA>"; + echo "<textarea class=\"biginput\" name=\"message\" cols=77 ROWS=\"7\" wrap=\"soft\">$message</TEXTAREA>"; show_table2_v_delimiter($col++); echo nbsp(S_REPEAT); |
