diff options
| author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-05-25 08:59:24 +0000 |
|---|---|---|
| committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-05-25 08:59:24 +0000 |
| commit | 3caf8639ef40a9cbb42c9dad28e1324d3dff17ed (patch) | |
| tree | 2ecab7c53e7ed4339c49d21eb804cccdffa7457a /frontends/php/include | |
| parent | a4abbb8aafb7da9f50fa8716954a43a3961a9082 (diff) | |
- dropped suport of delays between actions due to bad design (Alexei)
- fixed incorrect handling of actions (Alexei)
git-svn-id: svn://svn.zabbix.com/trunk@2904 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include')
| -rw-r--r-- | frontends/php/include/actions.inc.php | 14 | ||||
| -rw-r--r-- | frontends/php/include/forms.inc.php | 6 |
2 files changed, 9 insertions, 11 deletions
diff --git a/frontends/php/include/actions.inc.php b/frontends/php/include/actions.inc.php index 35607f12..55bbe745 100644 --- a/frontends/php/include/actions.inc.php +++ b/frontends/php/include/actions.inc.php @@ -37,7 +37,7 @@ # Add Action - function add_action($actiontype,$userid,$delay,$subject,$message,$recipient,$maxrepeats,$repeatdelay,$status,$scripts) + function add_action($actiontype,$userid,$subject,$message,$recipient,$maxrepeats,$repeatdelay,$status,$scripts) { // if(!check_right_on_trigger("A",$triggerid)) // { @@ -56,8 +56,8 @@ $recipient = 0; if(!check_commands($scripts)) return FALSE; } - $sql="insert into actions (actiontype,userid,delay,nextcheck,subject,message,recipient,". - "maxrepeats,repeatdelay,status,scripts) values ($actiontype,$userid,$delay,0,".zbx_dbstr($subject).",". + $sql="insert into actions (actiontype,userid,subject,message,recipient,". + "maxrepeats,repeatdelay,status,scripts) values ($actiontype,$userid,".zbx_dbstr($subject).",". zbx_dbstr($message).",$recipient,$maxrepeats,$repeatdelay,$status,".zbx_dbstr($scripts).")"; $result=DBexecute($sql); return DBinsert_id($result,"actions","actionid"); @@ -65,7 +65,7 @@ # Update Action - function update_action($actionid,$actiontype,$userid,$delay,$subject,$message,$recipient,$maxrepeats,$repeatdelay,$status,$scripts) + function update_action($actionid,$actiontype,$userid,$subject,$message,$recipient,$maxrepeats,$repeatdelay,$status,$scripts) { // if(!check_right_on_trigger("U",$triggerid)) // { @@ -84,7 +84,7 @@ if(!check_commands($scripts)) return FALSE; } - $result=DBexecute("update actions set actiontype=$actiontype,userid=$userid,delay=$delay,nextcheck=0,subject=".zbx_dbstr($subject).",message=".zbx_dbstr($message).",recipient=$recipient,maxrepeats=$maxrepeats, repeatdelay=$repeatdelay,status=$status,scripts=".zbx_dbstr($scripts)." where actionid=$actionid"); + $result=DBexecute("update actions set actiontype=$actiontype,userid=$userid,subject=".zbx_dbstr($subject).",message=".zbx_dbstr($message).",recipient=$recipient,maxrepeats=$maxrepeats, repeatdelay=$repeatdelay,status=$status,scripts=".zbx_dbstr($scripts)." where actionid=$actionid"); return $result; } @@ -169,7 +169,7 @@ $action["message"]); add_action($action["actiontype"],$row2["triggerid"], $action["userid"], $action["good"], - $action["delay"], $action["subject"], $message, $action["scope"], + $action["subject"], $message, $action["scope"], $action["severity"], $action["recipient"], $action["maxrepeats"], $action["repeatdelay"],$action["scripts"]); } @@ -262,7 +262,7 @@ { $host=get_host_by_hostid($row["hostid"]); $message=str_replace("{".$host_template["host"].":", "{".$host["host"].":", $action["message"]); - update_action($row3["actionid"], $action["actiontype"],$row2["triggerid"], $action["userid"], $action["good"], $action["delay"], $action["subject"], $message, $action["scope"], $action["severity"], $action["recipient"], $action["maxrepeats"],$action["repeatdelay"],$action["scripts"]); + update_action($row3["actionid"], $action["actiontype"],$row2["triggerid"], $action["userid"], $action["good"], $action["subject"], $message, $action["scope"], $action["severity"], $action["recipient"], $action["maxrepeats"],$action["repeatdelay"],$action["scripts"]); } } diff --git a/frontends/php/include/forms.inc.php b/frontends/php/include/forms.inc.php index 266b062c..fef8ec7a 100644 --- a/frontends/php/include/forms.inc.php +++ b/frontends/php/include/forms.inc.php @@ -1071,7 +1071,6 @@ { $actiontype = $action["actiontype"]; $source = $action["source"]; - $delay = $action["delay"]; $uid = $action["userid"]; $subject = $action["subject"]; $message = $action["message"]; @@ -1112,7 +1111,6 @@ $source = get_request("source",0); $actiontype = get_request("actiontype",ACTION_TYPE_MESSAGE); - $delay = get_request("delay",30); $subject = get_request("subject","{TRIGGER.NAME}: {STATUS}"); $message = get_request("message","{TRIGGER.NAME}: {STATUS}"); $scope = get_request("scope",0); @@ -1280,9 +1278,9 @@ // end of new condition preparation $frmAction->AddRow(S_CONDITION, $rowCondition); - $frmAction->AddRow( +/* $frmAction->AddRow( $actiontype == ACTION_TYPE_MESSAGE ? S_DELAY_BETWEEN_MESSAGES_IN_SEC : S_DELAY_BETWEEN_EXECUTIONS_IN_SEC, - new CTextBox('delay',$delay,5)); + new CTextBox('delay',$delay,5));*/ if($actiontype == ACTION_TYPE_MESSAGE) { |
