summaryrefslogtreecommitdiffstats
path: root/frontends/php/include
diff options
context:
space:
mode:
authorsasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-05-27 09:26:12 +0000
committersasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-05-27 09:26:12 +0000
commit70f35ff303e4c22ff4e38d42953f2008f10824da (patch)
treed838dc5ad1254e9847627c5491c1bd24d9e6a5ec /frontends/php/include
parent0ee1e17fdd240f0121f7eed9bd26959910075569 (diff)
downloadzabbix-70f35ff303e4c22ff4e38d42953f2008f10824da.tar.gz
zabbix-70f35ff303e4c22ff4e38d42953f2008f10824da.tar.xz
zabbix-70f35ff303e4c22ff4e38d42953f2008f10824da.zip
- [DEV-173] added support of notification escalations on server side
git-svn-id: svn://svn.zabbix.com/trunk@5727 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include')
-rw-r--r--frontends/php/include/actions.inc.php10
-rw-r--r--frontends/php/include/defines.inc.php11
-rw-r--r--frontends/php/include/forms.inc.php18
-rw-r--r--frontends/php/include/media.inc.php8
4 files changed, 25 insertions, 22 deletions
diff --git a/frontends/php/include/actions.inc.php b/frontends/php/include/actions.inc.php
index 302d424e..97c6c6e2 100644
--- a/frontends/php/include/actions.inc.php
+++ b/frontends/php/include/actions.inc.php
@@ -798,7 +798,7 @@ include_once 'include/discovery.inc.php';
$sql = 'SELECT DISTINCT a.alertid,a.clock,mt.description,a.sendto,a.subject,a.message,a.status,a.retries,a.error '.
' FROM events e,alerts a'.
' left join media_type mt on mt.mediatypeid=a.mediatypeid'.
- ' WHERE e.eventid = a.eventid'.
+ ' WHERE e.eventid = a.eventid and alerttype in ('.ALERT_TYPE_MESSAGE.')'.
$sql_cond.
' AND '.DBcondition('e.objectid',$available_triggers).
' AND '.DBin_node('a.alertid').
@@ -872,12 +872,12 @@ function get_actions_for_event($eventid){
$result=DBselect('SELECT DISTINCT a.alertid,a.clock,mt.description,a.sendto,a.subject,a.message,a.status,a.retries,a.error '.
' FROM events e,alerts a'.
' left join media_type mt on mt.mediatypeid=a.mediatypeid'.
- ' WHERE a.eventid='.$eventid.
+ ' WHERE a.eventid='.$eventid.' and alerttype in ('.ALERT_TYPE_MESSAGE.')'.
' AND e.eventid = a.eventid'.
' AND '.DBcondition('e.objectid',$available_triggers).
' AND '.DBin_node('a.alertid').
order_by('a.clock,a.alertid,mt.description,a.sendto,a.status,a.retries'));
-
+
while($row=DBfetch($result)){
$time=date("Y.M.d H:i:s",$row["clock"]);
@@ -934,7 +934,7 @@ function get_actions_hint_by_eventid($eventid,$status=NULL){
$sql = 'SELECT DISTINCT a.alertid,mt.description,a.sendto,a.status,u.alias '.
' FROM events e,users u,alerts a'.
' left join media_type mt on mt.mediatypeid=a.mediatypeid'.
- ' WHERE a.eventid='.$eventid.
+ ' WHERE a.eventid='.$eventid.' and alerttype in ('.ALERT_TYPE_MESSAGE.')'.
(is_null($status)?'':' AND a.status='.$status).
' AND e.eventid = a.eventid'.
' AND '.DBcondition('e.objectid',$available_triggers).
@@ -942,7 +942,7 @@ function get_actions_hint_by_eventid($eventid,$status=NULL){
' AND u.userid=a.userid '.
' ORDER BY mt.description';
$result=DBselect($sql);
-
+
while($row=DBfetch($result)){
if($row["status"] == ALERT_STATUS_SENT){
diff --git a/frontends/php/include/defines.inc.php b/frontends/php/include/defines.inc.php
index 07610a02..d6eb158e 100644
--- a/frontends/php/include/defines.inc.php
+++ b/frontends/php/include/defines.inc.php
@@ -230,10 +230,13 @@
define('ALERT_STATUS_SENT',1);
define('ALERT_STATUS_FAILED',2);
- define('ALERT_TYPE_EMAIL',0);
- define('ALERT_TYPE_EXEC',1);
- define('ALERT_TYPE_SMS',2);
- define('ALERT_TYPE_JABBER',3);
+ define('ALERT_TYPE_MESSAGE',0);
+ define('ALERT_TYPE_COMMAND',1);
+
+ define('MEDIA_TYPE_EMAIL',0);
+ define('MEDIA_TYPE_EXEC',1);
+ define('MEDIA_TYPE_SMS',2);
+ define('MEDIA_TYPE_JABBER',3);
define('ACTION_STATUS_ENABLED',0);
define('ACTION_STATUS_DISABLED',1);
diff --git a/frontends/php/include/forms.inc.php b/frontends/php/include/forms.inc.php
index 600e8fbd..2736910c 100644
--- a/frontends/php/include/forms.inc.php
+++ b/frontends/php/include/forms.inc.php
@@ -3386,26 +3386,26 @@
$frmMeadia->AddRow(S_DESCRIPTION,new CTextBox("description",$description,30));
$cmbType = new CComboBox("type",$type,"submit()");
- $cmbType->AddItem(ALERT_TYPE_EMAIL,S_EMAIL);
- $cmbType->AddItem(ALERT_TYPE_JABBER,S_JABBER);
- $cmbType->AddItem(ALERT_TYPE_SMS,S_SMS);
- $cmbType->AddItem(ALERT_TYPE_EXEC,S_SCRIPT);
+ $cmbType->AddItem(MEDIA_TYPE_EMAIL,S_EMAIL);
+ $cmbType->AddItem(MEDIA_TYPE_JABBER,S_JABBER);
+ $cmbType->AddItem(MEDIA_TYPE_SMS,S_SMS);
+ $cmbType->AddItem(MEDIA_TYPE_EXEC,S_SCRIPT);
$frmMeadia->AddRow(S_TYPE,$cmbType);
switch($type)
{
- case ALERT_TYPE_EMAIL:
+ case MEDIA_TYPE_EMAIL:
$frmMeadia->AddRow(S_SMTP_SERVER,new CTextBox("smtp_server",$smtp_server,30));
$frmMeadia->AddRow(S_SMTP_HELO,new CTextBox("smtp_helo",$smtp_helo,30));
$frmMeadia->AddRow(S_SMTP_EMAIL,new CTextBox("smtp_email",$smtp_email,30));
break;
- case ALERT_TYPE_SMS:
+ case MEDIA_TYPE_SMS:
$frmMeadia->AddRow(S_GSM_MODEM,new CTextBox("gsm_modem",$gsm_modem,50));
break;
- case ALERT_TYPE_EXEC:
+ case MEDIA_TYPE_EXEC:
$frmMeadia->AddRow(S_SCRIPT_NAME,new CTextBox("exec_path",$exec_path,50));
break;
- case ALERT_TYPE_JABBER:
+ case MEDIA_TYPE_JABBER:
$frmMeadia->AddRow(S_JABBER_IDENTIFIER, new CTextBox("username",$username,30));
$frmMeadia->AddRow(S_PASSWORD, new CPassBox("password",$password,30));
}
@@ -5302,4 +5302,4 @@
$frmResult->Show();
}
-?> \ No newline at end of file
+?>
diff --git a/frontends/php/include/media.inc.php b/frontends/php/include/media.inc.php
index 9effc6dd..fd63eb14 100644
--- a/frontends/php/include/media.inc.php
+++ b/frontends/php/include/media.inc.php
@@ -22,10 +22,10 @@
function media_type2str($type)
{
- $str_type[ALERT_TYPE_EMAIL] = S_EMAIL;
- $str_type[ALERT_TYPE_EXEC] = S_SCRIPT;
- $str_type[ALERT_TYPE_SMS] = S_SMS;
- $str_type[ALERT_TYPE_JABBER] = S_JABBER;
+ $str_type[MEDIA_TYPE_EMAIL] = S_EMAIL;
+ $str_type[MEDIA_TYPE_EXEC] = S_SCRIPT;
+ $str_type[MEDIA_TYPE_SMS] = S_SMS;
+ $str_type[MEDIA_TYPE_JABBER] = S_JABBER;
if(isset($str_type[$type]))
return $str_type[$type];