diff options
| author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2002-01-15 09:33:17 +0000 |
|---|---|---|
| committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2002-01-15 09:33:17 +0000 |
| commit | b42e5f2902473217835a9c2cd15ae2bdbf018697 (patch) | |
| tree | bd4f68822cd0515ea93cb4e96ddedd6aba457493 /frontends/php | |
| parent | e02f0a4b8b0e9ca4ad75eafb89f56a1a31b82c6b (diff) | |
| download | zabbix-b42e5f2902473217835a9c2cd15ae2bdbf018697.tar.gz zabbix-b42e5f2902473217835a9c2cd15ae2bdbf018697.tar.xz zabbix-b42e5f2902473217835a9c2cd15ae2bdbf018697.zip | |
- added column URL to table triggers (Alexei)
git-svn-id: svn://svn.zabbix.com/trunk@278 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php')
| -rw-r--r-- | frontends/php/include/config.inc | 32 | ||||
| -rw-r--r-- | frontends/php/tr_status.html | 13 | ||||
| -rw-r--r-- | frontends/php/triggers.html | 4 |
3 files changed, 28 insertions, 21 deletions
diff --git a/frontends/php/include/config.inc b/frontends/php/include/config.inc index d28e1b1f..b7fd0935 100644 --- a/frontends/php/include/config.inc +++ b/frontends/php/include/config.inc @@ -8,18 +8,11 @@ { global $ERROR_MSG; - $sql="select triggerid,expression,description,istrue,priority,lastchange,dep_level,comments from triggers where triggerid=$triggerid"; + $sql="select triggerid,expression,description,istrue,priority,lastchange,dep_level,comments,url from triggers where triggerid=$triggerid"; $result=DBselect($sql); if(DBnum_rows($result) == 1) { - $trigger["groupid"]=DBget_field($result,0,0); - $trigger["expression"]=DBget_field($result,0,1); - $trigger["description"]=DBget_field($result,0,2); - $trigger["istrue"]=DBget_field($result,0,3); - $trigger["priority"]=DBget_field($result,0,4); - $trigger["lastchange"]=DBget_field($result,0,5); - $trigger["dep_level"]=DBget_field($result,0,6); - $trigger["comments"]=DBget_field($result,0,7); + return DBfetch($result); } else { @@ -1248,10 +1241,10 @@ # Add Trigger definition - function add_trigger($expression,$description,$priority,$istrue,$comments) + function add_trigger($expression,$description,$priority,$istrue,$comments,$url) { $description=addslashes($description); - $sql="insert into triggers (description,priority,istrue,comments) values ('$description',$priority,$istrue,'$comments')"; + $sql="insert into triggers (description,priority,istrue,comments,url) values ('$description',$priority,$istrue,'$comments','$url')"; # echo $sql,"<br>"; $result=DBexecute($sql); if(!$result) @@ -1304,7 +1297,7 @@ # Update Trigger definition - function update_trigger($triggerid,$expression,$description,$priority,$istrue,$comments) + function update_trigger($triggerid,$expression,$description,$priority,$istrue,$comments,$url) { $result=delete_function_by_triggerid($triggerid); @@ -1315,7 +1308,7 @@ $expression=implode_exp($expression,$triggerid); if($istrue != 2) $istrue="istrue"; - $sql="update triggers set expression='$expression',description='$description',priority=$priority,istrue=$istrue,comments='$comments' where triggerid=$triggerid"; + $sql="update triggers set expression='$expression',description='$description',priority=$priority,istrue=$istrue,comments='$comments',url='$url' where triggerid=$triggerid"; return DBexecute($sql); } @@ -1377,7 +1370,7 @@ } $description=sprintf($description,$host); - add_trigger($expression,$description,0,0,""); + add_trigger($expression,$description,0,0,"",""); } } return TRUE; @@ -2171,6 +2164,7 @@ $priority=$trigger["priority"]; $istrue=$trigger["istrue"]; $comments=$trigger["comments"]; + $url=$trigger["url"]; } else { @@ -2179,6 +2173,7 @@ $priority=0; $istrue=0; $comments=""; + $url=""; } echo "<br>"; @@ -2198,12 +2193,12 @@ echo "<input name=\"triggerid\" type=hidden value=$triggerid size=8>"; echo "Description"; show_table2_h_delimiter(); - echo "<input name=\"description\" value=\"$description\"size=70>"; + echo "<input name=\"description\" value=\"$description\" size=70>"; show_table2_v_delimiter(); echo "Expression"; show_table2_h_delimiter(); - echo "<input name=\"expression\" value=\"$expression\"size=70>"; + echo "<input name=\"expression\" value=\"$expression\" size=70>"; show_table2_v_delimiter(); echo "Priority"; @@ -2223,6 +2218,11 @@ echo "<TEXTAREA NAME=\"comments\" COLS=70 ROWS=\"7\" WRAP=\"SOFT\">$comments</TEXTAREA>"; show_table2_v_delimiter(); + echo "URL"; + show_table2_h_delimiter(); + echo "<input name=\"url\" value=\"$url\" size=70>"; + + show_table2_v_delimiter(); echo "Disabled"; show_table2_h_delimiter(); echo "<INPUT TYPE=\"CHECKBOX\" "; diff --git a/frontends/php/tr_status.html b/frontends/php/tr_status.html index 6a68b11f..c9fb1ead 100644 --- a/frontends/php/tr_status.html +++ b/frontends/php/tr_status.html @@ -284,11 +284,11 @@ if($onlytrue=='true') { - $result=DBselect("select distinct t.triggerid,t.istrue,t.description,t.expression,t.priority,t.lastchange,t.comments from triggers t,hosts h,items i,functions f where t.istrue=1 and f.itemid=i.itemid and h.hostid=i.hostid and t.description like \"%$txt_select%\" and t.triggerid=f.triggerid and i.status in (0,2) $cond $sort"); + $result=DBselect("select distinct t.triggerid,t.istrue,t.description,t.expression,t.priority,t.lastchange,t.comments,t.url from triggers t,hosts h,items i,functions f where t.istrue=1 and f.itemid=i.itemid and h.hostid=i.hostid and t.description like \"%$txt_select%\" and t.triggerid=f.triggerid and i.status in (0,2) $cond $sort"); } else { - $result=DBselect("select distinct t.triggerid,t.istrue,t.description,t.expression,t.priority,t.lastchange,t.comments from triggers t,hosts h,items i,functions f where f.itemid=i.itemid and h.hostid=i.hostid and t.triggerid=f.triggerid and t.description like \"%$txt_select%\" and i.status in (0,2) $cond $sort"); + $result=DBselect("select distinct t.triggerid,t.istrue,t.description,t.expression,t.priority,t.lastchange,t.comments,t.url from triggers t,hosts h,items i,functions f where f.itemid=i.itemid and h.hostid=i.hostid and t.triggerid=f.triggerid and t.description like \"%$txt_select%\" and i.status in (0,2) $cond $sort"); } $col=0; while($row=DBfetch($result)) @@ -310,7 +310,14 @@ echo "<TD>"; - echo $row["description"]; + if($row["url"] == "") + { + echo $row["description"]; + } + else + { + echo "<a href='".$row["url"]."'>".$row["description"]."</a>"; + } if($compact!='true') { diff --git a/frontends/php/triggers.html b/frontends/php/triggers.html index 9432b33f..17ca6b69 100644 --- a/frontends/php/triggers.html +++ b/frontends/php/triggers.html @@ -33,7 +33,7 @@ if(isset($disabled)) { $istrue=2; } else { $istrue=0; } - $result=update_trigger($triggerid,$expression,$description,$priority,$istrue,$comments); + $result=update_trigger($triggerid,$expression,$description,$priority,$istrue,$comments,$url); show_messages($result,"Trigger updated","Cannot update trigger"); } else @@ -49,7 +49,7 @@ if(isset($disabled)) { $istrue=2; } else { $istrue=0; } - $result=add_trigger($expression,$description,$priority,$istrue,$comments); + $result=add_trigger($expression,$description,$priority,$istrue,$comments,$url); show_messages($result,"Trigger added","Cannot add trigger"); } else |
