summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/actions.inc.php
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2005-12-27 17:59:42 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2005-12-27 17:59:42 +0000
commit461bb2a4ff683a38e6b2066f8c3fec67e110e44a (patch)
tree330e16964a243f7c6f83a02af17c4c1b17441310 /frontends/php/include/actions.inc.php
parent324c7b6e8806397d52c637f352097158e8e0c7a4 (diff)
More changes for new configuration of actions.
git-svn-id: svn://svn.zabbix.com/trunk@2433 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/actions.inc.php')
-rw-r--r--frontends/php/include/actions.inc.php42
1 files changed, 39 insertions, 3 deletions
diff --git a/frontends/php/include/actions.inc.php b/frontends/php/include/actions.inc.php
index 7b6b4370..3364467f 100644
--- a/frontends/php/include/actions.inc.php
+++ b/frontends/php/include/actions.inc.php
@@ -62,7 +62,7 @@
# Add Action
- function add_action( $userid, $good, $delay, $subject, $message, $recipient, $usrgrpid, $maxrepeats, $repeatdelay)
+ function add_action( $userid, $delay, $subject, $message, $recipient, $usrgrpid, $maxrepeats, $repeatdelay)
{
// if(!check_right_on_trigger("A",$triggerid))
// {
@@ -79,7 +79,7 @@
$id = $usrgrpid;
}
- $sql="insert into actions (userid,good,delay,nextcheck,subject,message,recipient,maxrepeats,repeatdelay) values ($id,$good,$delay,0,'$subject','$message',$recipient,$maxrepeats,$repeatdelay)";
+ $sql="insert into actions (userid,delay,nextcheck,subject,message,recipient,maxrepeats,repeatdelay) values ($id,$delay,0,'$subject','$message',$recipient,$maxrepeats,$repeatdelay)";
$result=DBexecute($sql);
return DBinsert_id($result,"actions","actionid");
}
@@ -99,14 +99,26 @@
return DBexecute($sql);
}
+ # Delete Conditions associated with actionid
+
+ function delete_conditions_by_actionid($actionid)
+ {
+ $sql="delete from conditions where actionid=$actionid";
+ return DBexecute($sql);
+ }
+
# Delete Action
function delete_action( $actionid )
{
+ delete_conditions_by_actionid($actionid);
+ delete_alert_by_actionid($actionid);
+
$sql="delete from actions where actionid=$actionid";
$result=DBexecute($sql);
- return delete_alert_by_actionid($actionid);
+
+ return $result;
}
# Add action to hardlinked hosts
@@ -275,6 +287,22 @@
{
$op="<>";
}
+ else if($operator == CONDITION_OPERATOR_LIKE)
+ {
+ $op="like";
+ }
+ else if($operator == CONDITION_OPERATOR_NOT_LIKE)
+ {
+ $op="not like";
+ }
+ else if($operator == CONDITION_OPERATOR_IN)
+ {
+ $op="in";
+ }
+ else if($operator == CONDITION_OPERATOR_MORE_EQUAL)
+ {
+ $op=">=";
+ }
$desc=S_UNKNOWN;
if($conditiontype==CONDITION_TYPE_GROUP)
@@ -286,6 +314,14 @@
{
$desc=S_TRIGGER_DESCRIPTION." $op "."\"".$value."\"";
}
+ else if($conditiontype==CONDITION_TYPE_TRIGGER_SEVERITY)
+ {
+ $desc=S_TRIGGER_SEVERITY." $op "."\"".get_severity_description($value)."\"";
+ }
+ else if($conditiontype==CONDITION_TYPE_TIME_PERIOD)
+ {
+ $desc=S_TIME." $op "."\"".$value."\"";
+ }
else
{
}