diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 3286bb0a..3edf2686 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -27,6 +27,7 @@ Bugs: * #111: Generated urls for non-default ports included the port twice. * #28: Permission denied page. * #53: User selection on server edit page. +* #115: Warning on server page when notifications are disabled. * Composer added for dependencies. v3.0.1 (released April 12, 2014) diff --git a/src/lang/bg_BG.lang.php b/src/lang/bg_BG.lang.php index 26ffbbc0..048003ed 100644 --- a/src/lang/bg_BG.lang.php +++ b/src/lang/bg_BG.lang.php @@ -161,6 +161,9 @@ $sm_lang = array( 'chart_long_date_format' => '%d.%m.%Y %H:%M:%S', 'chart_short_date_format' => '%d.%m %H:%M', 'chart_short_time_format' => '%H:%M', + 'warning_notifications_disabled_sms' => 'SMS notifications are disabled.', + 'warning_notifications_disabled_email' => 'Email notifications are disabled.', + 'warning_notifications_disabled_pushover' => 'Pushover notifications are disabled.', 'error_server_no_match' => 'Server not found.', 'error_server_label_bad_length' => 'The label must be between 1 and 255 characters.', 'error_server_ip_bad_length' => 'The domain / IP must be between 1 and 255 characters.', diff --git a/src/lang/da_DK.lang.php b/src/lang/da_DK.lang.php index 4400b182..bca9c62d 100644 --- a/src/lang/da_DK.lang.php +++ b/src/lang/da_DK.lang.php @@ -161,6 +161,9 @@ $sm_lang = array( 'chart_long_date_format' => '%d-%m-%Y %H:%M:%S', 'chart_short_date_format' => '%d/%m %H:%M', 'chart_short_time_format' => '%H:%M', + 'warning_notifications_disabled_sms' => 'SMS notifications are disabled.', + 'warning_notifications_disabled_email' => 'Email notifications are disabled.', + 'warning_notifications_disabled_pushover' => 'Pushover notifications are disabled.', 'error_server_no_match' => 'Server not found.', 'error_server_label_bad_length' => 'The label must be between 1 and 255 characters.', 'error_server_ip_bad_length' => 'The domain / IP must be between 1 and 255 characters.', diff --git a/src/lang/de_DE.lang.php b/src/lang/de_DE.lang.php index 6023083e..f7353e81 100644 --- a/src/lang/de_DE.lang.php +++ b/src/lang/de_DE.lang.php @@ -161,6 +161,9 @@ $sm_lang = array( 'chart_long_date_format' => '%d.%m.%Y %H:%M:%S', 'chart_short_date_format' => '%d.%m %H:%M', 'chart_short_time_format' => '%H:%M', + 'warning_notifications_disabled_sms' => 'SMS notifications are disabled.', + 'warning_notifications_disabled_email' => 'Email notifications are disabled.', + 'warning_notifications_disabled_pushover' => 'Pushover notifications are disabled.', 'error_server_no_match' => 'Server not found.', 'error_server_label_bad_length' => 'The label must be between 1 and 255 characters.', 'error_server_ip_bad_length' => 'The domain / IP must be between 1 and 255 characters.', diff --git a/src/lang/en_US.lang.php b/src/lang/en_US.lang.php index 397dc898..999da3ad 100644 --- a/src/lang/en_US.lang.php +++ b/src/lang/en_US.lang.php @@ -161,6 +161,9 @@ $sm_lang = array( 'chart_long_date_format' => '%Y-%m-%d %H:%M:%S', 'chart_short_date_format' => '%m/%d %H:%M', 'chart_short_time_format' => '%H:%M', + 'warning_notifications_disabled_sms' => 'SMS notifications are disabled.', + 'warning_notifications_disabled_email' => 'Email notifications are disabled.', + 'warning_notifications_disabled_pushover' => 'Pushover notifications are disabled.', 'error_server_no_match' => 'Server not found.', 'error_server_label_bad_length' => 'The label must be between 1 and 255 characters.', 'error_server_ip_bad_length' => 'The domain / IP must be between 1 and 255 characters.', diff --git a/src/lang/es_ES.lang.php b/src/lang/es_ES.lang.php index a33dbf72..243f59d7 100644 --- a/src/lang/es_ES.lang.php +++ b/src/lang/es_ES.lang.php @@ -161,6 +161,9 @@ $sm_lang = array( 'chart_long_date_format' => '%Y-%m-%d %H:%M:%S', 'chart_short_date_format' => '%m/%d %H:%M', 'chart_short_time_format' => '%H:%M', + 'warning_notifications_disabled_sms' => 'SMS notifications are disabled.', + 'warning_notifications_disabled_email' => 'Email notifications are disabled.', + 'warning_notifications_disabled_pushover' => 'Pushover notifications are disabled.', 'error_server_no_match' => 'Server not found.', 'error_server_label_bad_length' => 'The label must be between 1 and 255 characters.', 'error_server_ip_bad_length' => 'The domain / IP must be between 1 and 255 characters.', diff --git a/src/lang/fr_FR.lang.php b/src/lang/fr_FR.lang.php index 041851e9..b326cf1f 100644 --- a/src/lang/fr_FR.lang.php +++ b/src/lang/fr_FR.lang.php @@ -161,6 +161,9 @@ $sm_lang = array( 'chart_long_date_format' => '%d/%m/%Y %H:%M:%S', 'chart_short_date_format' => '%d/%m %H:%M', 'chart_short_time_format' => '%H:%M', + 'warning_notifications_disabled_sms' => 'SMS notifications are disabled.', + 'warning_notifications_disabled_email' => 'Email notifications are disabled.', + 'warning_notifications_disabled_pushover' => 'Pushover notifications are disabled.', 'error_server_no_match' => 'Serveur non trouvé.', 'error_server_label_bad_length' => 'Le nom doit avoir entre 1 et 255 caractères.', 'error_server_ip_bad_length' => 'Domaine/IP doit avoir entre 1 et 255 caractères.', diff --git a/src/lang/it_IT.lang.php b/src/lang/it_IT.lang.php index 60b2b5be..1b831df8 100644 --- a/src/lang/it_IT.lang.php +++ b/src/lang/it_IT.lang.php @@ -161,6 +161,9 @@ $sm_lang = array( 'chart_long_date_format' => '%Y-%m-%d %H:%M:%S', 'chart_short_date_format' => '%m/%d %H:%M', 'chart_short_time_format' => '%H:%M', + 'warning_notifications_disabled_sms' => 'SMS notifications are disabled.', + 'warning_notifications_disabled_email' => 'Email notifications are disabled.', + 'warning_notifications_disabled_pushover' => 'Pushover notifications are disabled.', 'error_server_no_match' => 'Server not found.', 'error_server_label_bad_length' => 'The label must be between 1 and 255 characters.', 'error_server_ip_bad_length' => 'The domain / IP must be between 1 and 255 characters.', diff --git a/src/lang/ko_KR.lang.php b/src/lang/ko_KR.lang.php index 284ee09f..d9316189 100644 --- a/src/lang/ko_KR.lang.php +++ b/src/lang/ko_KR.lang.php @@ -161,6 +161,9 @@ $sm_lang = array( 'chart_long_date_format' => '%Y-%m-%d %H:%M:%S', 'chart_short_date_format' => '%m/%d %H:%M', 'chart_short_time_format' => '%H:%M', + 'warning_notifications_disabled_sms' => 'SMS notifications are disabled.', + 'warning_notifications_disabled_email' => 'Email notifications are disabled.', + 'warning_notifications_disabled_pushover' => 'Pushover notifications are disabled.', 'error_server_no_match' => 'Server not found.', 'error_server_label_bad_length' => 'The label must be between 1 and 255 characters.', 'error_server_ip_bad_length' => 'The domain / IP must be between 1 and 255 characters.', diff --git a/src/lang/nl_NL.lang.php b/src/lang/nl_NL.lang.php index 307ffee7..5864d8f6 100644 --- a/src/lang/nl_NL.lang.php +++ b/src/lang/nl_NL.lang.php @@ -87,7 +87,6 @@ $sm_lang = array( 'pushover_description' => 'Pushover is een dienst die het gemakkelijk maakt om real-time notificaties te ontvangen. Zie hun website voor meer informatie.', 'pushover_key' => 'Pushover Key', 'pushover_device' => 'Pushover Device', - 'pushover_device_description' => 'Device name to send the message to. Leave empty to send it to all devices.', 'pushover_device_description' => 'Apparaat waar de berichten naar toe gaan. Laat leeg voor alle apparaten.', 'delete_title' => 'Verwijder gebruiker', 'delete_message' => 'Weet je zeker dat je deze gebruiker wilt verwijderen: \'%1\'?', @@ -162,6 +161,9 @@ $sm_lang = array( 'chart_long_date_format' => '%d-%m-%Y %H:%M:%S', 'chart_short_date_format' => '%d-%m %H:%M', 'chart_short_time_format' => '%H:%M', + 'warning_notifications_disabled_sms' => 'SMS notificaties zijn uitgeschakeld.', + 'warning_notifications_disabled_email' => 'Email notificaties zijn uitgeschakeld.', + 'warning_notifications_disabled_pushover' => 'Pushover notificaties zijn uitgeschakeld.', 'error_server_no_match' => 'Server niet gevonden.', 'error_server_label_bad_length' => 'Het label moet tussen de 1 en 255 karakters lang zijn.', 'error_server_ip_bad_length' => 'Het domein / IP moet tussen de 1 en 255 karakters lang zijn.', @@ -199,7 +201,6 @@ $sm_lang = array( 'pushover_status' => 'Sta Pushover berichten toe?', 'pushover_description' => 'Pushover is een dienst die het gemakkelijk maakt om real-time notificaties te ontvangen. Zie hun website voor meer informatie.', 'pushover_api_token' => 'Pushover App API Token', - 'pushover_api_token_description' => 'Before you can use Pushover, you need to register an App at their website and enter the App API Token here.', 'pushover_api_token_description' => 'Voordat je Pushover kunt gebruiken moet je een App registreren via hun website, en daarvan de App API Token hier invullen.', 'alert_type' => 'Selecteer wanneer je een notificatie wilt.
', 'alert_type_description' => 'Status change: '. diff --git a/src/lang/pt_BR.lang.php b/src/lang/pt_BR.lang.php index 71b930e9..7921eecc 100644 --- a/src/lang/pt_BR.lang.php +++ b/src/lang/pt_BR.lang.php @@ -161,6 +161,9 @@ $sm_lang = array( 'chart_long_date_format' => '%d/%m/%Y %H:%M:%S', 'chart_short_date_format' => '%d/%m %H:%M', 'chart_short_time_format' => '%H:%M', + 'warning_notifications_disabled_sms' => 'SMS notifications are disabled.', + 'warning_notifications_disabled_email' => 'Email notifications are disabled.', + 'warning_notifications_disabled_pushover' => 'Pushover notifications are disabled.', 'error_server_no_match' => 'Server not found.', 'error_server_label_bad_length' => 'The label must be between 1 and 255 characters.', 'error_server_ip_bad_length' => 'The domain / IP must be between 1 and 255 characters.', diff --git a/src/lang/ru_RU.lang.php b/src/lang/ru_RU.lang.php index 892b894f..c9007b2c 100644 --- a/src/lang/ru_RU.lang.php +++ b/src/lang/ru_RU.lang.php @@ -161,6 +161,9 @@ $sm_lang = array( 'chart_long_date_format' => '%d-%m-%Y %H:%M:%S', 'chart_short_date_format' => '%d/%m %H:%M', 'chart_short_time_format' => '%H:%M', + 'warning_notifications_disabled_sms' => 'SMS notifications are disabled.', + 'warning_notifications_disabled_email' => 'Email notifications are disabled.', + 'warning_notifications_disabled_pushover' => 'Pushover notifications are disabled.', 'error_server_no_match' => 'Сервер не найден.', 'error_server_label_bad_length' => 'Лейбл должен содержать от 1 до 255 знака.', 'error_server_ip_bad_length' => 'Домен/IP должен содержать от 1 до 255 знаков', diff --git a/src/lang/zh_CN.lang.php b/src/lang/zh_CN.lang.php index fa617062..bb9fe4ec 100644 --- a/src/lang/zh_CN.lang.php +++ b/src/lang/zh_CN.lang.php @@ -161,6 +161,9 @@ $sm_lang = array( 'chart_long_date_format' => '%Y-%m-%d %H:%M:%S', 'chart_short_date_format' => '%m/%d %H:%M', 'chart_short_time_format' => '%H:%M', + 'warning_notifications_disabled_sms' => 'SMS notifications are disabled.', + 'warning_notifications_disabled_email' => 'Email notifications are disabled.', + 'warning_notifications_disabled_pushover' => 'Pushover notifications are disabled.', 'error_server_no_match' => 'Server not found.', 'error_server_label_bad_length' => 'The label must be between 1 and 255 characters.', 'error_server_ip_bad_length' => 'The domain / IP must be between 1 and 255 characters.', diff --git a/src/psm/Module/Server/Controller/ServerController.class.php b/src/psm/Module/Server/Controller/ServerController.class.php index 102abfd5..10e59878 100644 --- a/src/psm/Module/Server/Controller/ServerController.class.php +++ b/src/psm/Module/Server/Controller/ServerController.class.php @@ -220,10 +220,20 @@ class ServerController extends AbstractServerController { )); } - $this->tpl->addTemplateData( - $this->getTemplateId(), - $tpl_data - ); + $notifications = array('email', 'sms', 'pushover'); + $this->tpl->newTemplate('server_update_warning', 'server/server.tpl.html'); + foreach($notifications as $notification) { + if(psm_get_conf($notification . '_status') == 0) { + $tpl_data['control_class_' . $notification] = 'warning'; + $tpl_data['warning_' . $notification] = $this->tpl->addTemplateData( + $this->tpl->getTemplate('server_update_warning'), + array('label_warning' => psm_get_lang('servers', 'warning_notifications_disabled_' . $notification)), + true + ); + } + } + + $this->tpl->addTemplateData($this->getTemplateId(), $tpl_data); } /** @@ -234,8 +244,6 @@ class ServerController extends AbstractServerController { // dont process anything if no data has been posted return $this->executeIndex(); } - - $clean = array( 'label' => trim(strip_tags(psm_POST('label', ''))), 'ip' => trim(strip_tags(psm_POST('ip', ''))), diff --git a/src/templates/server/server.tpl.html b/src/templates/server/server.tpl.html index bb8c8990..56f8cf1f 100644 --- a/src/templates/server/server.tpl.html +++ b/src/templates/server/server.tpl.html @@ -131,8 +131,8 @@ -
- +
+
-
- +
+
-
- +
+