summaryrefslogtreecommitdiffstats
path: root/frontends/php/include
diff options
context:
space:
mode:
authorosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-03-26 13:28:43 +0000
committerosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-03-26 13:28:43 +0000
commit84b76acee504a3160ab2b568ab7517aedc8e5eb5 (patch)
tree56b02f3a783860393fe18603104c71b8070f875e /frontends/php/include
parent45dd16822e8717f9685eb05ec2d6f7c5c43f1e3a (diff)
downloadzabbix-84b76acee504a3160ab2b568ab7517aedc8e5eb5.tar.gz
zabbix-84b76acee504a3160ab2b568ab7517aedc8e5eb5.tar.xz
zabbix-84b76acee504a3160ab2b568ab7517aedc8e5eb5.zip
- support of multiple actions per set of conidtions (Eugene)
git-svn-id: svn://svn.zabbix.com/trunk@3927 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include')
-rw-r--r--frontends/php/include/actions.inc.php256
-rw-r--r--frontends/php/include/classes/clink.inc.php3
-rw-r--r--frontends/php/include/classes/ctag.inc.php12
-rw-r--r--frontends/php/include/config.inc.php21
-rw-r--r--frontends/php/include/defines.inc.php8
-rw-r--r--frontends/php/include/events.inc.php13
-rw-r--r--frontends/php/include/forms.inc.php534
-rw-r--r--frontends/php/include/locales/en_gb.inc.php13
-rw-r--r--frontends/php/include/users.inc.php4
9 files changed, 583 insertions, 281 deletions
diff --git a/frontends/php/include/actions.inc.php b/frontends/php/include/actions.inc.php
index 436ae2b1..9303c125 100644
--- a/frontends/php/include/actions.inc.php
+++ b/frontends/php/include/actions.inc.php
@@ -67,6 +67,48 @@
return $result;
}
+ function check_permission_for_action_conditions($conditions)
+ {
+ global $USER_DETAILS;
+
+ $result = true;
+
+ $denyed_hosts = get_accessible_hosts_by_user($USER_DETAILS,PERM_READ_ONLY, PERM_MODE_LT);
+ $denyed_groups = get_accessible_groups_by_user($USER_DETAILS,PERM_READ_ONLY, PERM_MODE_LT);
+
+ foreach($conditions as $ac_data)
+ {
+ if($ac_data['operator'] != 0) continue;
+
+ switch($ac_data['type'])
+ {
+ case CONDITION_TYPE_GROUP:
+ if(in_array($ac_data['value'],explode(',',$denyed_groups)))
+ {
+ $result = false;
+ }
+ break;
+ case CONDITION_TYPE_HOST:
+ if(in_array($ac_data['value'],explode(',',$denyed_hosts)))
+ {
+ $result = false;
+ }
+ break;
+ case CONDITION_TYPE_TRIGGER:
+ if(!DBfetch(DBselect("select distinct t.*".
+ " from triggers t,items i,functions f".
+ " where f.itemid=i.itemid and t.triggerid=f.triggerid".
+ " and i.hostid not in (".$denyed_hosts.") and t.triggerid=".$ac_data['value'])))
+ {
+ $result = false;
+ }
+ break;
+ }
+ if(!$result) break;
+ }
+ return $result;
+ }
+
function get_action_by_actionid($actionid)
{
$sql="select * from actions where actionid=$actionid";
@@ -83,52 +125,136 @@
return $result;
}
- # Add Action
+ # Add Action's condition
+
+ function add_action_condition($actionid, $condition)
+ {
+ $conditionid = get_dbid("conditions","conditionid");
+
+ $result = DBexecute('insert into conditions (conditionid,actionid,conditiontype,operator,value)'.
+ ' values ('.$conditionid.','.$actionid.','.
+ $condition['type'].','.
+ $condition['operator'].','.
+ zbx_dbstr($condition['value']).
+ ')');
+
+ if(!$result)
+ return $result;
+
+ return $conditionid;
+ }
- function add_action($actiontype,$userid,$subject,$message,$recipient,$status,$scripts,$evaltype)
+ function add_action_operation($actionid, $operation)
{
- // TODO check permission by new value.
+ $operationid = get_dbid('operations','operationid');
+
+ $result = DBexecute('insert into operations (operationid,actionid,operationtype,object,objectid,shortdata,longdata)'.
+ ' values('.$operationid.','.$actionid.','.
+ $operation['operationtype'].','.
+ $operation['object'].','.
+ $operation['objectid'].','.
+ zbx_dbstr($operation['shortdata']).','.
+ zbx_dbstr($operation['longdata']).
+ ')');
+ if(!$result)
+ return $result;
+
+ return $operationid;
+ }
+ # Add Action
- if($actiontype == ACTION_TYPE_MESSAGE)
+ function add_action($name, $eventsource, $evaltype, $status, $conditions, $operations)
+ {
+ if(!is_array($conditions) || count($conditions) == 0)
{
- $scripts = "";
+ error(S_NO_CONDITIONS_DEFINED);
+ return false;
}
- elseif($actiontype == ACTION_TYPE_COMMAND)
+
+ if(!check_permission_for_action_conditions($conditions))
+ return false;
+
+ if(!is_array($operations) || count($operations) == 0)
{
- $subject = $message = "";
- $userid = 0;
- $recipient = 0;
- if(!check_commands($scripts)) return FALSE;
+ error(S_NO_OPERATIONS_DEFINED);
+ return false;
}
+
+ foreach($operations as $operation)
+ if($operation['operationtype'] == OPERATION_TYPE_COMMAND && !check_commands($operation['longdata']))
+ return false;
+
$actionid=get_dbid("actions","actionid");
- $sql="insert into actions (actionid,actiontype,userid,subject,message,recipient,".
- "status,scripts,evaltype) values ($actionid,$actiontype,$userid,".zbx_dbstr($subject).",".
- zbx_dbstr($message).",$recipient,$status,".zbx_dbstr($scripts).",$evaltype)";
- $result=DBexecute($sql);
+
+ $result = DBexecute('insert into actions (actionid,name,eventsource,evaltype,status)'.
+ ' values ('.$actionid.','.zbx_dbstr($name).','.$eventsource.','.$evaltype.','.$status.')');
+
if(!$result)
return $result;
+
+ foreach($operations as $operation)
+ if( !($result = add_action_operation($actionid, $operation)))
+ break;
+
+ if($result)
+ {
+ foreach($conditions as $condition)
+ if( !($result = add_action_condition($actionid, $condition)))
+ break;
+ }
+
+ if(!$result)
+ {
+ delete_action($actionid);
+ $actionid = $result;
+ }
+
return $actionid;
}
# Update Action
- function update_action($actionid,$actiontype,$userid,$subject,$message,$recipient,$status,$scripts,$evaltype)
+ function update_action($actionid, $name, $eventsource, $evaltype, $status, $conditions, $operations)
{
- // TODO check permission by new value.
+ if(!is_array($conditions) || count($conditions) == 0)
+ {
+ error(S_NO_CONDITIONS_DEFINED);
+ return false;
+ }
+
+ if(!check_permission_for_action_conditions($conditions))
+ return false;
- if($actiontype == ACTION_TYPE_MESSAGE)
+ if(!is_array($operations) || count($operations) == 0)
{
- $scripts = "";
+ error(S_NO_OPERATIONS_DEFINED);
+ return false;
}
- elseif($actiontype == ACTION_TYPE_COMMAND)
+
+ foreach($operations as $operation)
+ if($operation['operationtype'] == OPERATION_TYPE_COMMAND && !check_commands($operation['longdata']))
+ return false;
+
+ $result = DBexecute('update actions set name='.zbx_dbstr($name).',eventsource='.$eventsource.','.
+ 'evaltype='.$evaltype.',status='.$status.' where actionid='.$actionid);
+
+ if($result)
{
- $subject = $message = "";
- $userid = 0;
- $recipient = 0;
- if(!check_commands($scripts)) return FALSE;
+ DBexecute('delete from conditions where actionid='.$actionid);
+ DBexecute('delete from operations where actionid='.$actionid);
+
+ foreach($operations as $operation)
+ if( !($result = add_action_operation($actionid, $operation)))
+ break;
+
+ if($result)
+ {
+ foreach($conditions as $condition)
+ if( !($result = add_action_condition($actionid, $condition)))
+ break;
+ }
}
- $result=DBexecute("update actions set actiontype=$actiontype,userid=$userid,subject=".zbx_dbstr($subject).",message=".zbx_dbstr($message).",recipient=$recipient,status=$status,scripts=".zbx_dbstr($scripts).",evaltype=$evaltype where actionid=$actionid");
return $result;
}
@@ -139,6 +265,9 @@
$return = DBexecute('delete from conditions where actionid='.$actionid);
if($return)
+ $result = DBexecute('delete from operations where actionid='.$actionid);
+
+ if($return)
$result = DBexecute('delete from alerts where actionid='.$actionid);
if($return)
@@ -147,20 +276,6 @@
return $result;
}
- function get_source_description($source)
- {
- $desc = S_UNKNOWN;
- if($source==1)
- {
- $desc=S_IT_SERVICE;
- }
- elseif($source==0)
- {
- $desc=S_TRIGGER;
- }
- return $desc;
- }
-
function get_condition_desc($conditiontype, $operator, $value)
{
if($operator == CONDITION_OPERATOR_EQUAL)
@@ -232,17 +347,62 @@
return $desc;
}
- # Add Action's condition
-
- function add_action_condition($actionid, $conditiontype, $operator, $value)
+ define('LONG_DESCRITION', 0);
+ define('SHORT_DESCRITION', 1);
+ function get_operation_desc($type=SHORT_DESCRITION, $data)
{
- $conditionid=get_dbid("conditions","conditionid");
- $sql="insert into conditions (conditionid,actionid,conditiontype,operator,value)".
- " values ($conditionid,$actionid,$conditiontype,$operator,".zbx_dbstr($value).")";
- $result=DBexecute($sql);
- if(!$result)
- return $result;
- return $conditionid;
+ global $cashed_data_for_oper_desc;
+
+ $cash_id = sprintf("%s%02d%02d", $data['objectid'], $data['operationtype'], $data['object']);
+
+ if(!isset($cashed_data_for_oper_desc[$cash_id]))
+ {
+ unset($cashed_data_for_oper_desc);
+
+ switch($data['object'])
+ {
+ case OPERATION_OBJECT_USER:
+ $cashed_data_for_oper_desc[$cash_id] = get_user_by_userid($data['objectid']);
+ $cashed_data_for_oper_desc[$cash_id] = S_USER.' "'.$cashed_data_for_oper_desc[$cash_id]['name'].'"';
+ break;
+ case OPERATION_OBJECT_GROUP:
+ $cashed_data_for_oper_desc[$cash_id] = get_group_by_usrgrpid($data['objectid']);
+ $cashed_data_for_oper_desc[$cash_id] = S_GROUP.' "'.$cashed_data_for_oper_desc[$cash_id]['name'].'"';
+ break;
+ }
+ }
+
+ switch($type)
+ {
+ case SHORT_DESCRITION:
+ switch($data['operationtype'])
+ {
+ case OPERATION_TYPE_MESSAGE:
+ $result = S_SEND_MESSAGE_TO.' '.$cashed_data_for_oper_desc[$cash_id];
+ break;
+ case OPERATION_TYPE_COMMAND:
+ $result = S_RUN_REMOTE_COMMANDS;
+ break;
+ default: break;
+ }
+ break;
+ case LONG_DESCRITION:
+ default:
+ switch($data['operationtype'])
+ {
+ case OPERATION_TYPE_MESSAGE:
+ $result = bold(S_SUBJECT).': '.$data['shortdata']."\n";
+ $result .= bold(S_MESSAGE).":\n".$data['longdata'];
+ break;
+ case OPERATION_TYPE_COMMAND:
+ $result = bold(S_REMOTE_COMMANDS).":\n".$data['longdata'];
+ break;
+ default: break;
+ }
+ break;
+ }
+
+ return $result;
}
function update_action_status($actionid, $status)
diff --git a/frontends/php/include/classes/clink.inc.php b/frontends/php/include/classes/clink.inc.php
index eb785941..ecb6ca00 100644
--- a/frontends/php/include/classes/clink.inc.php
+++ b/frontends/php/include/classes/clink.inc.php
@@ -22,7 +22,7 @@
class CLink extends CTag
{
/* public */
- function CLink($item=NULL,$url=NULL,$class=NULL)
+ function CLink($item=NULL,$url=NULL,$class=NULL,$action=NULL)
{
parent::CTag("a","yes");
@@ -34,6 +34,7 @@
if(!is_null($class)) $this->SetClass($class);
if(!is_null($item)) $this->AddItem($item);
if(!is_null($url)) $this->SetUrl($url);
+ if(!is_null($action)) $this->SetAction($action);
}
function SetAction($value=NULL)
{
diff --git a/frontends/php/include/classes/ctag.inc.php b/frontends/php/include/classes/ctag.inc.php
index 93671c81..abc6bd4b 100644
--- a/frontends/php/include/classes/ctag.inc.php
+++ b/frontends/php/include/classes/ctag.inc.php
@@ -51,6 +51,16 @@
return $res;
}
+ function implode_objects($glue, &$pieces)
+ {
+ if( !is_array($pieces) ) return unpack_object($pieces);
+
+ foreach($pieces as $id => $piece)
+ $pieces[$id] = unpack_object($piece);
+
+ return implode($glue, $pieces);
+ }
+
class CObject
{
function CObject($items=null)
@@ -240,7 +250,7 @@
function AddAction($name, $value)
{
if(!empty($value))
- $this->options[$name] = htmlentities(str_replace("\n", '', strval($value)),ENT_COMPAT);
+ $this->options[$name] = htmlentities(str_replace(array("\r", "\n"), '', strval($value)),ENT_COMPAT);
}
function AddOption($name, $value)
diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php
index 012a0566..c3c1b316 100644
--- a/frontends/php/include/config.inc.php
+++ b/frontends/php/include/config.inc.php
@@ -20,6 +20,7 @@
function SDI($msg="SDI") { echo "DEBUG INFO: "; var_export($msg); echo BR; } // DEBUG INFO!!!
function VDP($var, $msg=null) { echo "DEBUG DUMP: "; if(isset($msg)) echo '"'.$msg.'"'.SPACE; var_dump($var); echo BR; } // DEBUG INFO!!!
+function TODO($msg) { echo "TODO: ".$msg.BR; } // DEBUG INFO!!!
?>
@@ -1999,4 +2000,24 @@ else if (document.getElementById)
return isset($array[$keys]);
}
+
+ /* function:
+ * zbx_rksort
+ *
+ * description:
+ * Recursively sort an array by key
+ *
+ * author: Eugene Grigorjev
+ */
+ function zbx_rksort(&$array, $flags=NULL)
+ {
+ if(is_array($array))
+ {
+ foreach($array as $id => $data)
+ zbx_rksort($array[$id]);
+
+ ksort($array,$flags);
+ }
+ return $array;
+ }
?>
diff --git a/frontends/php/include/defines.inc.php b/frontends/php/include/defines.inc.php
index 2d9dd41e..248fdb18 100644
--- a/frontends/php/include/defines.inc.php
+++ b/frontends/php/include/defines.inc.php
@@ -197,8 +197,8 @@
define('ACTION_STATUS_ENABLED',0);
define('ACTION_STATUS_DISABLED',1);
- define('ACTION_TYPE_MESSAGE',0);
- define('ACTION_TYPE_COMMAND',1);
+ define('OPERATION_TYPE_MESSAGE', 0);
+ define('OPERATION_TYPE_COMMAND', 1);
define('ACTION_EVAL_TYPE_AND_OR',0);
define('ACTION_EVAL_TYPE_AND',1);
@@ -208,8 +208,8 @@
define('TRIGGER_STATUS_DISABLED',1);
define('TRIGGER_STATUS_UNKNOWN',2);
- define('RECIPIENT_TYPE_USER',0);
- define('RECIPIENT_TYPE_GROUP',1);
+ define('OPERATION_OBJECT_USER', 0);
+ define('OPERATION_OBJECT_GROUP', 1);
define('LOGFILE_SEVERITY_NOT_CLASSIFIED',0);
define('LOGFILE_SEVERITY_INFORMATION',1);
diff --git a/frontends/php/include/events.inc.php b/frontends/php/include/events.inc.php
index a18968f7..d5fc0592 100644
--- a/frontends/php/include/events.inc.php
+++ b/frontends/php/include/events.inc.php
@@ -19,8 +19,17 @@
**/
?>
<?php
+ function event_source2str($sourceid)
+ {
+ switch($sourceid)
+ {
+ case EVENT_SOURCE_TRIGGERS: return S_TRIGGERS;
+ case EVENT_SOURCE_DISCOVERY: return S_DISCOVERY;
+ default: return S_UNKNOWN;
+ }
+ }
- function get_history_of_triggers_events($start,$num, $groupid=0, $hostid=0, $nodeid=null)
+ function get_history_of_triggers_events($start,$num, $groupid=0, $hostid=0, $nodeid=null)
{
global $ZBX_CURNODEID;
global $USER_DETAILS;
@@ -90,7 +99,7 @@
return $table;
}
- function get_history_of_discovery_events($start,$num,$nodeid=null)
+ function get_history_of_discovery_events($start,$num,$nodeid=null)
{
global $ZBX_CURNODEID;
global $USER_DETAILS;
diff --git a/frontends/php/include/forms.inc.php b/frontends/php/include/forms.inc.php
index 3f3a1b3f..5adf0938 100644
--- a/frontends/php/include/forms.inc.php
+++ b/frontends/php/include/forms.inc.php
@@ -2645,318 +2645,409 @@
$uid=null;
$frmAction = new CFormTable(S_ACTION,'actionconf.php','post');
- $frmAction->SetHelp('web.actions.action.php');
+ $frmAction->SetHelp('config_actions.php');
- $conditions = get_request("conditions",array());
-
- $new_condition_type = get_request("new_condition_type", 0);
- $new_condition_operator = get_request("new_condition_operator", 0);
- $new_condition_value = get_request("new_condition_value", 0);
-
- if(isset($_REQUEST["actionid"]))
+ if(isset($_REQUEST['actionid']))
{
- $action=get_action_by_actionid($_REQUEST["actionid"]);
- $frmAction->AddVar('actionid',$_REQUEST["actionid"]);
+ $action = get_action_by_actionid($_REQUEST['actionid']);
+ $frmAction->AddVar('actionid',$_REQUEST['actionid']);
}
+
+ $conditions = get_request('conditions',array());
+ $operations = get_request("operations",array());
- if(isset($_REQUEST["actionid"]) && !isset($_REQUEST["form_refresh"]))
- {
- $actiontype = $action["actiontype"];
- $source = $action["source"];
- $uid = $action["userid"];
- $subject = $action["subject"];
- $message = $action["message"];
- $recipient = $action["recipient"];
- $status = $action["status"];
- $scripts = $action["scripts"];
- $evaltype = $action["evaltype"];
-
- $result=DBselect("select conditiontype, operator, value from conditions".
- " where actionid=".$_REQUEST["actionid"]." order by conditiontype");
-
- while($condition=DBfetch($result))
+ if(isset($_REQUEST['actionid']) && !isset($_REQUEST['form_refresh']))
+ {
+ $name = $action['name'];
+ $eventsource = $action['eventsource'];
+ $evaltype = $action['evaltype'];
+ $status = $action['status'];
+
+ /* prepare conditions */
+ $db_conditions = DBselect('select conditiontype, operator, value from conditions'.
+ ' where actionid='.$_REQUEST['actionid'].' order by conditiontype,conditionid');
+
+ while($condition_data = DBfetch($db_conditions))
{
- $condition = array(
- "type" => $condition["conditiontype"],
- "operator" => $condition["operator"],
- "value" => $condition["value"]);
+ $condition_data = array(
+ 'type' => $condition_data['conditiontype'],
+ 'operator' => $condition_data['operator'],
+ 'value' => $condition_data['value']);
+
+ if(in_array($condition_data, $conditions)) continue;
+ array_push($conditions, $condition_data);
+ }
+ unset($condition_data, $db_conditions);
- if(in_array($condition, $conditions)) continue;
- array_push($conditions, $condition);
+ /* prepate operations */
+ $db_operations = DBselect('select operationtype,object,objectid,shortdata,longdata from operations'.
+ ' where actionid='.$_REQUEST['actionid'].' order by operationtype,object,operationid');
+
+ while($operation_data = DBfetch($db_operations))
+ {
+ $operation_data = array(
+ 'operationtype' => $operation_data['operationtype'],
+ 'object' => $operation_data['object'],
+ 'objectid' => $operation_data['objectid'],
+ 'shortdata' => $operation_data['shortdata'],
+ 'longdata' => $operation_data['longdata']);
+
+ if(in_array($operation_data, $operations)) continue;
+ array_push($operations, $operation_data);
}
+ unset($db_operations, $operation_data);
}
else
{
- $source = get_request("source",0);
- $actiontype = get_request("actiontype",ACTION_TYPE_MESSAGE);
+ $name = get_request('name');
+ $eventsource = get_request('eventsource');
+ $evaltype = get_request('evaltype');
+ $status = get_request('status');
+ }
- $subject = get_request("subject","{TRIGGER.NAME}: {STATUS}");
- $message = get_request("message","{TRIGGER.NAME}: {STATUS}");
- $scope = get_request("scope",0);
- $recipient = get_request("recipient",RECIPIENT_TYPE_GROUP);
- $severity = get_request("severity",0);
- $status = get_request("status",ACTION_STATUS_ENABLED);
- $uid = get_request("userid",0);
- $scripts = get_request("scripts","");
- $evaltype = get_request("evaltype",ACTION_EVAL_TYPE_AND_OR);
+ /* init new_condition variable */
+ $new_condition = get_request('new_condition', array());
+ if( !is_array($new_condition) ) $new_condition = array();
- }
+ if( !isset($new_condition['type']) ) $new_condition['type'] = CONDITION_TYPE_TRIGGER_NAME;
+ if( !isset($new_condition['operator'])) $new_condition['operator'] = CONDITION_OPERATOR_LIKE;
+ if( !isset($new_condition['value']) ) $new_condition['value'] = '';
+
+ /* init new_operation variable */
+ $new_operation = get_request('new_operation', array());
+ if( !is_array($new_operation) ) $new_operation = array();
+
+ if( !isset($new_operation['operationtype'])) $new_operation['operationtype'] = OPERATION_TYPE_MESSAGE;
+ if( !isset($new_operation['object'])) $new_operation['object'] = OPERATION_OBJECT_GROUP;
+ if( !isset($new_operation['objectid'])) $new_operation['objectid'] = 0;
+ if( !isset($new_operation['shortdata'])) $new_operation['shortdata'] = '{TRIGGER.NAME}: {STATUS}';
+ if( !isset($new_operation['longdata'])) $new_operation['longdata'] = '{TRIGGER.NAME}: {STATUS}';
- $cmbActionType = new CComboBox('actiontype', $actiontype,'submit()');
- $cmbActionType->AddItem(ACTION_TYPE_MESSAGE,S_SEND_MESSAGE);
- $cmbActionType->AddItem(ACTION_TYPE_COMMAND,S_REMOTE_COMMAND);
- $frmAction->AddRow(S_ACTION_TYPE, $cmbActionType);
+ $frmAction->AddRow(S_NAME, new CTextBox('name', $name, 50));
- $cmbSource = new CComboBox('source', $source);
- $cmbSource->AddItem(0, S_TRIGGER);
- $frmAction->AddRow(S_SOURCE, $cmbSource);
+ /* form row generation */
+ $cmbSource = new CComboBox('eventsource', $eventsource);
+ $cmbSource->AddItem(EVENT_SOURCE_TRIGGERS, S_TRIGGERS);
+ $cmbSource->AddItem(EVENT_SOURCE_DISCOVERY, S_DISCOVERY, null, 'no');
+ $frmAction->AddRow(S_EVENT_SOURCE, $cmbSource);
// prepare condition list
- sort($conditions);
+ zbx_rksort($conditions);
+ /* group conditions by type */
$grouped_conditions = array();
$cond_el = new CTable();
$i=0;
foreach($conditions as $val)
{
- $label = chr(65 + $i);
- $cond_el->AddRow(array(
- '('.$label.')',
- new CCheckBox("rem_condition[]", 'no', null,$i),
- get_condition_desc(
- $val["type"],
- $val["operator"],
- $val["value"]
- )
+ $label = chr(ord('A') + $i);
+ $cond_el->AddRow(array('('.$label.')',array(
+ new CCheckBox("g_conditionid[]", 'no', null,$i),
+ get_condition_desc($val["type"], $val["operator"], $val["value"]))
));
$frmAction->AddVar("conditions[$i][type]", $val["type"]);
$frmAction->AddVar("conditions[$i][operator]", $val["operator"]);
$frmAction->AddVar("conditions[$i][value]", $val["value"]);
- if(!isset($grouped_conditions[$val["type"]]) || !is_array($grouped_conditions[$val["type"]]))
- $grouped_conditions[$val["type"]] = array();
-
- array_push($grouped_conditions[$val["type"]], $label);
+ $grouped_conditions[$val["type"]][] = $label;
$i++;
}
unset($conditions);
+ $cond_buttons = array();
+
+ if(!isset($_REQUEST['new_condition']))
+ {
+ $cond_buttons[] = new CButton('new_condition',S_NEW);
+ }
+
if($cond_el->ItemsCount() == 0)
- $cond_el = S_NO_CONDITIONS_DEFINED;
+ {
+ $cond_el = array(S_NO_CONDITIONS_DEFINED,BR);
+ $frmAction->AddVar('evaltype', ACTION_EVAL_TYPE_AND_OR);
+ }
else
{
if($cond_el->ItemsCount() > 1)
{
switch($evaltype)
{
- case ACTION_EVAL_TYPE_AND:
- $group_op = $glog_op = S_AND;
- break;
- case ACTION_EVAL_TYPE_OR:
- $group_op = $glog_op = S_OR;
- break;
- default:
- $group_op = S_OR;
- $glog_op = S_AND;
+ case ACTION_EVAL_TYPE_AND: $group_op = $glog_op = S_AND; break;
+ case ACTION_EVAL_TYPE_OR: $group_op = $glog_op = S_OR; break;
+ default: $group_op = S_OR; $glog_op = S_AND; break;
}
foreach($grouped_conditions as $id => $val)
- {
$grouped_conditions[$id] = '('.implode(' '.$group_op.' ', $val).')';
- }
+
$grouped_conditions = implode(' '.$glog_op.' ', $grouped_conditions);
$cmb_calc_type = new CComboBox('evaltype', $evaltype, 'submit()');
$cmb_calc_type->AddItem(ACTION_EVAL_TYPE_AND_OR, S_AND_OR_BIG);
$cmb_calc_type->AddItem(ACTION_EVAL_TYPE_AND, S_AND_BIG);
$cmb_calc_type->AddItem(ACTION_EVAL_TYPE_OR, S_OR_BIG);
- $frmAction->AddRow(S_TYPE_OF_CALCULATION, array($cmb_calc_type,new CTextBox('preview', $grouped_conditions, 60,'yes')));
+ $frmAction->AddRow(S_TYPE_OF_CALCULATION,
+ array($cmb_calc_type, new CTextBox('preview', $grouped_conditions, 60,'yes')));
+ unset($cmb_calc_type, $group_op, $glog_op);
}
else
{
$frmAction->AddVar('evaltype', ACTION_EVAL_TYPE_AND_OR);
}
- $cond_el = array($cond_el, new CButton('del_condition','delete selected'));
+ $cond_buttons[] = new CButton('del_condition',S_DELETE_SELECTED);
}
- unset($grouped_conditions);
// end of condition list preparation
- $frmAction->AddRow(S_CONDITIONS, $cond_el);
+ $frmAction->AddRow(S_CONDITIONS, array($cond_el, $cond_buttons));
+ unset($grouped_conditions,$cond_el,$cond_buttons);
+ if(isset($_REQUEST['new_condition']))
+ {
// prepare new condition
- $rowCondition=array();
-
-// add condition type
- $cmbCondType = new CComboBox('new_condition_type',$new_condition_type,'submit()');
- $cmbCondType->AddItem(CONDITION_TYPE_GROUP, S_HOST_GROUP);
- $cmbCondType->AddItem(CONDITION_TYPE_HOST, S_HOST);
- $cmbCondType->AddItem(CONDITION_TYPE_TRIGGER, S_TRIGGER);
- $cmbCondType->AddItem(CONDITION_TYPE_TRIGGER_NAME, S_TRIGGER_NAME);
- $cmbCondType->AddItem(CONDITION_TYPE_TRIGGER_SEVERITY, S_TRIGGER_SEVERITY);
- $cmbCondType->AddItem(CONDITION_TYPE_TRIGGER_VALUE, S_TRIGGER_VALUE);
- $cmbCondType->AddItem(CONDITION_TYPE_TIME_PERIOD, S_TIME_PERIOD);
-
- array_push($rowCondition,$cmbCondType);
-
-// add condition operation
- $cmbCondOp = new CComboBox('new_condition_operator');
- if(in_array($new_condition_type, array(
- CONDITION_TYPE_GROUP,
- CONDITION_TYPE_HOST,
- CONDITION_TYPE_TRIGGER,
- CONDITION_TYPE_TRIGGER_SEVERITY,
- CONDITION_TYPE_TRIGGER_VALUE)))
- $cmbCondOp->AddItem(CONDITION_OPERATOR_EQUAL, '=');
- if(in_array($new_condition_type,array(
- CONDITION_TYPE_GROUP,
- CONDITION_TYPE_HOST,
- CONDITION_TYPE_TRIGGER,
- CONDITION_TYPE_TRIGGER_SEVERITY)))
- $cmbCondOp->AddItem(CONDITION_OPERATOR_NOT_EQUAL, '<>');
- if(in_array($new_condition_type,array(CONDITION_TYPE_TRIGGER_NAME)))
- $cmbCondOp->AddItem(CONDITION_OPERATOR_LIKE, 'like');
- if(in_array($new_condition_type,array(CONDITION_TYPE_TRIGGER_NAME)))
- $cmbCondOp->AddItem(CONDITION_OPERATOR_NOT_LIKE, 'not like');
- if(in_array($new_condition_type,array(CONDITION_TYPE_TIME_PERIOD)))
- $cmbCondOp->AddItem(CONDITION_OPERATOR_IN, 'in');
- if(in_array($new_condition_type,array(CONDITION_TYPE_TRIGGER_SEVERITY)))
- $cmbCondOp->AddItem(CONDITION_OPERATOR_MORE_EQUAL, '>=');
- if(in_array($new_condition_type,array(CONDITION_TYPE_TRIGGER_SEVERITY)))
- $cmbCondOp->AddItem(CONDITION_OPERATOR_LESS_EQUAL, '<=');
-
- array_push($rowCondition,$cmbCondOp);
-
-
-// add condition value
- if($new_condition_type == CONDITION_TYPE_GROUP)
- {
- $frmAction->AddVar('new_condition_value','0');
-
- $txtCondVal = new CTextBox('group','',20);
- $txtCondVal->SetReadonly('yes');
+ $rowCondition=array();
+
+ // add condition type
+ $cmbCondType = new CComboBox('new_condition[type]',$new_condition['type'],'submit()');
+ $cmbCondType->AddItem(CONDITION_TYPE_GROUP, S_HOST_GROUP);
+ $cmbCondType->AddItem(CONDITION_TYPE_HOST, S_HOST);
+ $cmbCondType->AddItem(CONDITION_TYPE_TRIGGER, S_TRIGGER);
+ $cmbCondType->AddItem(CONDITION_TYPE_TRIGGER_NAME, S_TRIGGER_NAME);
+ $cmbCondType->AddItem(CONDITION_TYPE_TRIGGER_SEVERITY, S_TRIGGER_SEVERITY);
+ $cmbCondType->AddItem(CONDITION_TYPE_TRIGGER_VALUE, S_TRIGGER_VALUE);
+ $cmbCondType->AddItem(CONDITION_TYPE_TIME_PERIOD, S_TIME_PERIOD);
+
+ array_push($rowCondition,$cmbCondType);
+
+ // add condition operation
+ $cmbCondOp = new CComboBox('new_condition[operator]');
+ if(in_array($new_condition['type'], array(
+ CONDITION_TYPE_GROUP,
+ CONDITION_TYPE_HOST,
+ CONDITION_TYPE_TRIGGER,
+ CONDITION_TYPE_TRIGGER_SEVERITY,
+ CONDITION_TYPE_TRIGGER_VALUE)))
+ $cmbCondOp->AddItem(CONDITION_OPERATOR_EQUAL, '=');
+ if(in_array($new_condition['type'],array(
+ CONDITION_TYPE_GROUP,
+ CONDITION_TYPE_HOST,
+ CONDITION_TYPE_TRIGGER,
+ CONDITION_TYPE_TRIGGER_SEVERITY)))
+ $cmbCondOp->AddItem(CONDITION_OPERATOR_NOT_EQUAL, '<>');
+ if(in_array($new_condition['type'],array(CONDITION_TYPE_TRIGGER_NAME)))
+ $cmbCondOp->AddItem(CONDITION_OPERATOR_LIKE, 'like');
+ if(in_array($new_condition['type'],array(CONDITION_TYPE_TRIGGER_NAME)))
+ $cmbCondOp->AddItem(CONDITION_OPERATOR_NOT_LIKE, 'not like');
+ if(in_array($new_condition['type'],array(CONDITION_TYPE_TIME_PERIOD)))
+ $cmbCondOp->AddItem(CONDITION_OPERATOR_IN, 'in');
+ if(in_array($new_condition['type'],array(CONDITION_TYPE_TRIGGER_SEVERITY)))
+ $cmbCondOp->AddItem(CONDITION_OPERATOR_MORE_EQUAL, '>=');
+ if(in_array($new_condition['type'],array(CONDITION_TYPE_TRIGGER_SEVERITY)))
+ $cmbCondOp->AddItem(CONDITION_OPERATOR_LESS_EQUAL, '<=');
+
+ array_push($rowCondition,$cmbCondOp);
+
+
+ // add condition value
+ if($new_condition['type'] == CONDITION_TYPE_GROUP)
+ {
+ $frmAction->AddVar('new_condition[value]','0');
- $btnSelect = new CButton('btn1',S_SELECT,
- "return PopUp('popup.php?dstfrm=".$frmAction->GetName().
- "&dstfld1=new_condition_value&dstfld2=group&srctbl=host_group&srcfld1=groupid&srcfld2=name',450,450);");
- $btnSelect->SetAccessKey('T');
+ $txtCondVal = new CTextBox('group','',20);
+ $txtCondVal->SetReadonly('yes');
- array_push($rowCondition, $txtCondVal, $btnSelect);
- }
- else if($new_condition_type == CONDITION_TYPE_HOST)
- {
- $frmAction->AddVar('new_condition_value','0');
+ $btnSelect = new CButton('btn1',S_SELECT,
+ "return PopUp('popup.php?dstfrm=".$frmAction->GetName().
+ "&dstfld1=new_condition%5Bvalue%5D&dstfld2=group&srctbl=host_group&srcfld1=groupid&srcfld2=name',450,450);");
+ $btnSelect->SetAccessKey('T');
- $txtCondVal = new CTextBox('host','',20);
- $txtCondVal->SetReadonly('yes');
+ array_push($rowCondition, $txtCondVal, $btnSelect);
+ }
+ else if($new_condition['type'] == CONDITION_TYPE_HOST)
+ {
+ $frmAction->AddVar('new_condition[value]','0');
- $btnSelect = new CButton('btn1',S_SELECT,
- "return PopUp('popup.php?dstfrm=".$frmAction->GetName().
- "&dstfld1=new_condition_value&dstfld2=host&srctbl=hosts&srcfld1=hostid&srcfld2=host',450,450);");
- $btnSelect->SetAccessKey('T');
+ $txtCondVal = new CTextBox('host','',20);
+ $txtCondVal->SetReadonly('yes');
- array_push($rowCondition, $txtCondVal, $btnSelect);
- }
- else if($new_condition_type == CONDITION_TYPE_TRIGGER)
- {
- $frmAction->AddVar('new_condition_value','0');
+ $btnSelect = new CButton('btn1',S_SELECT,
+ "return PopUp('popup.php?dstfrm=".$frmAction->GetName().
+ "&dstfld1=new_condition%5Bvalue%5D&dstfld2=host&srctbl=hosts&srcfld1=hostid&srcfld2=host',450,450);");
+ $btnSelect->SetAccessKey('T');
- $txtCondVal = new CTextBox('trigger','',20);
- $txtCondVal->SetReadonly('yes');
+ array_push($rowCondition, $txtCondVal, $btnSelect);
+ }
+ else if($new_condition['type'] == CONDITION_TYPE_TRIGGER)
+ {
+ $frmAction->AddVar('new_condition[value]','0');
- $btnSelect = new CButton('btn1',S_SELECT,
- "return PopUp('popup.php?dstfrm=".$frmAction->GetName().
- "&dstfld1=new_condition_value&dstfld2=trigger&srctbl=triggers&srcfld1=triggerid&srcfld2=description');");
- $btnSelect->SetAccessKey('T');
- array_push($rowCondition, $txtCondVal, $btnSelect);
+ $txtCondVal = new CTextBox('trigger','',20);
+ $txtCondVal->SetReadonly('yes');
+
+ $btnSelect = new CButton('btn1',S_SELECT,
+ "return PopUp('popup.php?dstfrm=".$frmAction->GetName().
+ "&dstfld1=new_condition%5Bvalue%5D&dstfld2=trigger&srctbl=triggers&srcfld1=triggerid&srcfld2=description');");
+ $btnSelect->SetAccessKey('T');
+ array_push($rowCondition, $txtCondVal, $btnSelect);
+ }
+ else if($new_condition['type'] == CONDITION_TYPE_TRIGGER_NAME)
+ {
+ array_push($rowCondition, new CTextBox('new_condition[value]', "", 40));
+ }
+ else if($new_condition['type'] == CONDITION_TYPE_TRIGGER_VALUE)
+ {
+ $cmbCondVal = new CComboBox('new_condition[value]');
+ $cmbCondVal->AddItem(0,"OFF");
+ $cmbCondVal->AddItem(1,"ON");
+ array_push($rowCondition,$cmbCondVal);
+ }
+ else if($new_condition['type'] == CONDITION_TYPE_TIME_PERIOD)
+ {
+ array_push($rowCondition, new CTextBox('new_condition[value]', "1-7,00:00-23:59", 40));
+ }
+ else if($new_condition['type'] == CONDITION_TYPE_TRIGGER_SEVERITY)
+ {
+ $cmbCondVal = new CComboBox('new_condition[value]');
+ foreach(array(0,1,2,3,4,5) as $id)
+ $cmbCondVal->AddItem($id,get_severity_description($id));
+
+ array_push($rowCondition,$cmbCondVal);
+ }
+ // add condition button
+ array_push($rowCondition,
+ BR,
+ new CButton('add_condition',S_ADD),
+ new CButton('cancel_new_condition',S_CANCEL)
+ );
+
+ $frmAction->AddRow(S_NEW_CONDITION, $rowCondition, 'new');
+// end of new condition preparation
}
- else if($new_condition_type == CONDITION_TYPE_TRIGGER_NAME)
+
+ zbx_rksort($operations);
+
+ $oper_el = new CTable();
+ foreach($operations as $id => $val)
{
- array_push($rowCondition, new CTextBox('new_condition_value', "", 40));
+ $oper_details = new CSpan(get_operation_desc(SHORT_DESCRITION, $val));
+ $oper_details->SetHint(nl2br(get_operation_desc(LONG_DESCRITION, $val)));
+
+ $oper_el->AddRow(array(
+ new CCol(array(
+ new CCheckBox("g_operationid[]", 'no', null,$id),
+ $oper_details)),
+ new CButton('edit_operationid['.$id.']',S_EDIT)
+ ));
+
+ $frmAction->AddVar('operations['.$id.'][operationtype]' ,$val['operationtype'] );
+ $frmAction->AddVar('operations['.$id.'][object]' ,$val['object'] );
+ $frmAction->AddVar('operations['.$id.'][objectid]' ,$val['objectid'] );
+ $frmAction->AddVar('operations['.$id.'][shortdata]' ,$val['shortdata'] );
+ $frmAction->AddVar('operations['.$id.'][longdata]' ,$val['longdata'] );
}
- else if($new_condition_type == CONDITION_TYPE_TRIGGER_VALUE)
+
+ $oper_buttons = array();
+
+ if(!isset($_REQUEST['new_operation']))
{
- $cmbCondVal = new CComboBox('new_condition_value');
- $cmbCondVal->AddItem(0,"OFF");
- $cmbCondVal->AddItem(1,"ON");
- array_push($rowCondition,$cmbCondVal);
+ $oper_buttons[] = new CButton('new_operation',S_NEW);
}
- else if($new_condition_type == CONDITION_TYPE_TIME_PERIOD)
+
+ if(count($operations) <= 0)
{
- array_push($rowCondition, new CTextBox('new_condition_value', "1-7,00:00-23:59", 40));
+ $operations = array();
+ $operations[] = S_NO_OPERATIONS_DEFINED;
}
- else if($new_condition_type == CONDITION_TYPE_TRIGGER_SEVERITY)
+ else
{
- $cmbCondVal = new CComboBox('new_condition_value');
- foreach(array(0,1,2,3,4,5) as $id)
- $cmbCondVal->AddItem($id,get_severity_description($id));
-
- array_push($rowCondition,$cmbCondVal);
+ $oper_buttons[] =new CButton('del_operation',S_DELETE_SELECTED);
}
-// add condition button
- array_push($rowCondition,BR,new CButton('add_condition','add'));
-// end of new condition preparation
- $frmAction->AddRow(S_CONDITION, $rowCondition);
+// end of condition list preparation
-/* $frmAction->AddRow(
- $actiontype == ACTION_TYPE_MESSAGE ? S_DELAY_BETWEEN_MESSAGES_IN_SEC : S_DELAY_BETWEEN_EXECUTIONS_IN_SEC,
- new CTextBox('delay',$delay,5));*/
+ $frmAction->AddRow(S_OPERATIONS, array($oper_el, $oper_buttons));
+ unset($operations, $oper_el, $oper_buttons);
- if($actiontype == ACTION_TYPE_MESSAGE)
+ if(isset($_REQUEST['new_operation']))
{
- $cmbRecipient = new CComboBox('recipient', $recipient,'submit()');
- $cmbRecipient->AddItem(0,S_SINGLE_USER);
- $cmbRecipient->AddItem(1,S_USER_GROUP);
- $frmAction->AddRow(S_SEND_MESSAGE_TO, $cmbRecipient);
+ unset($update_mode);
+ if(isset($new_operation['id']))
+ {
+ $frmAction->AddVar('new_operation[id]', $new_operation['id']);
+ $update_mode = true;
+ }
+
+ $tblNewOperation = new CTable(null,'nowrap');
+
+ $cmbOpType = new CComboBox('new_operation[operationtype]', $new_operation['operationtype'],'submit()');
+ $cmbOpType->AddItem(OPERATION_TYPE_MESSAGE,S_SEND_MESSAGE);
+ $cmbOpType->AddItem(OPERATION_TYPE_COMMAND,S_REMOTE_COMMAND);
+ $tblNewOperation->AddRow(array(S_OPERATION_TYPE, $cmbOpType));
- if($recipient==RECIPIENT_TYPE_GROUP)
+ if($new_operation['operationtype'] == OPERATION_TYPE_MESSAGE)
{
-
- $cmbGroups = new CComboBox('userid', $uid);
-
- $groups = DBselect("select usrgrpid,name from usrgrp ".
- " where ".Dbid2nodeid("usrgrpid")."=".$ZBX_CURNODEID.
- " order by name");
- while($group=DBfetch($groups))
+ if( $new_operation['object'] == OPERATION_OBJECT_GROUP)
+ {
+ $object_srctbl = 'usrgrp';
+ $object_srcfld1 = 'usrgrpid';
+ $object_name = get_group_by_usrgrpid($new_operation['objectid']);
+ }
+ else
{
- $cmbGroups->AddItem($group['usrgrpid'],$group['name']);
+ $object_srctbl = 'users';
+ $object_srcfld1 = 'userid';
+ $object_name = get_user_by_userid($new_operation['objectid']);
}
- $frmAction->AddRow(S_GROUP, $cmbGroups);
+ $frmAction->AddVar('new_operation[objectid]', $new_operation['objectid']);
+
+ if($object_name) $object_name = $object_name['name'];
+
+ $cmbObject = new CComboBox('new_operation[object]', $new_operation['object'],'submit()');
+ $cmbObject->AddItem(OPERATION_OBJECT_USER,S_SINGLE_USER);
+ $cmbObject->AddItem(OPERATION_OBJECT_GROUP,S_USER_GROUP);
+
+ $tblNewOperation->AddRow(array(S_SEND_MESSAGE_TO, array(
+ $cmbObject,
+ new CTextBox('object_name', $object_name, 40, 'yes'),
+ new CButton('select_object',S_SELECT,
+ 'return PopUp("popup.php?dstfrm='.$frmAction->GetName().
+ '&dstfld1=new_operation%5Bobjectid%5D&dstfld2=object_name'.
+ '&srctbl='.$object_srctbl.'&srcfld1='.$object_srcfld1.'&srcfld2=name'.
+ '",450,450)',
+ 'T')
+ )));
+
+ $tblNewOperation->AddRow(array(S_SUBJECT, new CTextBox('new_operation[shortdata]',$new_operation['shortdata'],77)));
+ $tblNewOperation->AddRow(array(S_MESSAGE, new CTextArea('new_operation[longdata]',$new_operation['longdata'],77,7)));
}
else
{
- $cmbUser = new CComboBox('userid', $uid);
-
- $users=DBselect("select userid,alias from users ".
- " where ".Dbid2nodeid("userid")."=".$ZBX_CURNODEID.
- " order by alias");
- while($user=DBfetch($users))
- {
- $cmbUser->AddItem($user['userid'],$user['alias']);
- }
+ $frmAction->AddVar('new_operation[object]',0);
+ $frmAction->AddVar('new_operation[objectid]',0);
+ $frmAction->AddVar('new_operation[shortdata]','');
- $frmAction->AddRow(S_USER, $cmbUser);
+ $tblNewOperation->AddRow(array(S_REMOTE_COMMAND, new CTextArea('new_operation[longdata]',$new_operation['longdata'],77,7)));
}
- $frmAction->AddRow(S_SUBJECT, new CTextBox('subject',$subject,80));
- $frmAction->AddRow(S_MESSAGE, new CTextArea('message',$message,77,7));
- $frmAction->AddVar("scripts",$scripts);
- }
- else
- {
- $frmAction->AddRow(S_REMOTE_COMMAND, new CTextArea('scripts',$scripts,77,7));
- $frmAction->AddVar("recipient",$recipient);
- $frmAction->AddVar("userid",$uid);
- $frmAction->AddVar("subject",$subject);
- $frmAction->AddVar("message",$message);
+
+ $tblNewOperation->AddRow(new CCol(array(
+ new CButton('add_operation', isset($update_mode) ? S_SAVE : S_ADD ),
+ SPACE,
+ new CButton('cancel_new_operation',S_CANCEL)
+ )));
+
+ $frmAction->AddRow(
+ isset($update_mode) ? S_EDIT_OPERATION : S_NEW_OPERATION,
+ $tblNewOperation,
+ isset($update_mode) ? 'edit' : 'new'
+ );
}
$cmbStatus = new CComboBox('status',$status);
- $cmbStatus->AddItem(0,S_ENABLED);
- $cmbStatus->AddItem(1,S_DISABLED);
+ $cmbStatus->AddItem(ACTION_STATUS_ENABLED,S_ENABLED);
+ $cmbStatus->AddItem(ACTION_STATUS_DISABLED,S_DISABLED);
$frmAction->AddRow(S_STATUS, $cmbStatus);
$frmAction->AddItemToBottomRow(new CButton('save',S_SAVE));
@@ -2965,11 +3056,10 @@
$frmAction->AddItemToBottomRow(SPACE);
$frmAction->AddItemToBottomRow(new CButton('clone',S_CLONE));
$frmAction->AddItemToBottomRow(SPACE);
- $frmAction->AddItemToBottomRow(new CButtonDelete("Delete selected action?",
- url_param("form").url_param("actiontype").url_param("actionid").
- "&subject=".$subject));
+ $frmAction->AddItemToBottomRow(new CButtonDelete(S_DELETE_SELECTED_ACTION_Q,
+ url_param('form').url_param('eventsource').
+ url_param('actionid')));
- } else {
}
$frmAction->AddItemToBottomRow(SPACE);
$frmAction->AddItemToBottomRow(new CButtonCancel(url_param("actiontype")));
diff --git a/frontends/php/include/locales/en_gb.inc.php b/frontends/php/include/locales/en_gb.inc.php
index 8634abb9..cbe7d98b 100644
--- a/frontends/php/include/locales/en_gb.inc.php
+++ b/frontends/php/include/locales/en_gb.inc.php
@@ -49,6 +49,8 @@
'S_CREATE_RULE'=> 'Create rule',
'S_DELETE_RULE_Q'=> 'Delete rule?',
+ 'S_EVENT_SOURCE'=> 'Event source',
+
'S_UPEVENT'=> 'Up event (hours)',
'S_DOWNEVENT'=> 'Down event (hours)',
'S_SVCUPEVENT'=> 'Service up event (hours)',
@@ -196,9 +198,10 @@
'S_FILTER_TRIGGER_NAME'=> 'Filter: Trigger name',
'S_FILTER_TRIGGER_SEVERITY'=> 'Filter: Trigger severity',
'S_FILTER_WHEN_TRIGGER_BECOMES'=> 'Filter: When trigger becomes',
- 'S_ACTION_TYPE'=> 'Action type',
+ 'S_OPERATION_TYPE'=> 'Operation type',
'S_SEND_MESSAGE'=> 'Send message',
'S_REMOTE_COMMAND'=> 'Remote command',
+ 'S_REMOTE_COMMANDS'=> 'Remote commands',
'S_FILTER'=> 'Filter',
'S_FILTER_TYPE'=> 'Filter type',
'S_TRIGGER_NAME'=> 'Trigger name',
@@ -208,9 +211,16 @@
'S_TRIGGER_DESCRIPTION'=> 'Trigger description',
'S_CONDITIONS'=> 'Conditions',
'S_CONDITION'=> 'Condition',
+ 'S_NEW_CONDITION'=> 'New condition',
+ 'S_OPERATIONS'=> 'Operations',
+ 'S_OPERATION'=> 'Operation',
+ 'S_NEW_OPERATION'=> 'New operation',
+ 'S_EDIT_OPERATION'=> 'Edit operation',
'S_NO_CONDITIONS_DEFINED'=> 'No conditions defined',
'S_ACTIONS_DELETED'=> 'Actions deleted',
'S_CANNOT_DELETE_ACTIONS'=> 'Cannot delete actions',
+ 'S_NO_OPERATIONS_DEFINED'=> 'No operations defined',
+ 'S_NEW'=> 'New',
// actions.php
'S_ACTIONS'=> 'Actions',
@@ -223,6 +233,7 @@
'S_CANNOT_DELETE_ACTION'=> 'Cannot delete action',
'S_SCOPE'=> 'Scope',
'S_SEND_MESSAGE_TO'=> 'Send message to',
+ 'S_RUN_REMOTE_COMMANDS'=> 'Run remote commands',
'S_WHEN_TRIGGER'=> 'When trigger',
'S_DELAY'=> 'Delay',
'S_SUBJECT'=> 'Subject',
diff --git a/frontends/php/include/users.inc.php b/frontends/php/include/users.inc.php
index 6407ca58..6994cf86 100644
--- a/frontends/php/include/users.inc.php
+++ b/frontends/php/include/users.inc.php
@@ -188,7 +188,7 @@
{
return $row;
}
- error("No user with id [$userid]");
+ /* error("No user with id [$userid]"); */
return false;
}
@@ -286,7 +286,7 @@
{
return $row;
}
- error("No user groups with id [$usrgrpid]");
+ /* error("No user groups with id [$usrgrpid]"); */
return FALSE;
}
?>