"; } 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) { $group=get_group_by_groupid($value); if($group) $desc=S_HOST_GROUP." $op "."\"".$group["name"]."\""; } if($conditiontype==CONDITION_TYPE_TRIGGER) { $trigger=get_trigger_by_triggerid($value); if($trigger) $desc=S_TRIGGER." $op "."\"".$trigger["description"]."\""; } else if($conditiontype==CONDITION_TYPE_HOST) { $host=get_host_by_hostid($value); if($host) $desc=S_HOST." $op "."\"".$host["host"]."\""; } else if($conditiontype==CONDITION_TYPE_TRIGGER_NAME) { $desc=S_TRIGGER_DESCRIPTION." $op "."\"".$value."\""; } else if($conditiontype==CONDITION_TYPE_TRIGGER_VALUE) { if($value==0) $desc=S_TRIGGER_VALUE." $op "."\"OFF\""; if($value==1) $desc=S_TRIGGER_VALUE." $op "."\"ON\""; } 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 { } return $desc; } # Add Action's condition function add_action_condition($actionid, $conditiontype, $operator, $value) { $sql="insert into conditions (actionid,conditiontype,operator,value) values ($actionid,$conditiontype,$operator,'".zbx_ads($value)."')"; $result=DBexecute($sql); return DBinsert_id($result,"conditions","conditionid"); } ?>