diff --git a/pandora_console/godmode/setup/setup_notifications.php b/pandora_console/godmode/setup/setup_notifications.php index 40a4031dbb..c105b89e62 100644 --- a/pandora_console/godmode/setup/setup_notifications.php +++ b/pandora_console/godmode/setup/setup_notifications.php @@ -34,12 +34,15 @@ if (get_parameter('update_config', 0)) { $enable_value = switch_to_int(get_parameter("enable-$id")); $mail_value = (int)get_parameter("mail-{$id}", 0); $user_value = (int)get_parameter("user-{$id}", 0); + $postpone_value = (int)get_parameter("postpone-{$id}", 0); $res = mysql_db_process_sql_update( 'tnotification_source', array( 'enabled' => $enable_value, 'user_editable' => $user_value, - 'also_mail' => $mail_value), + 'also_mail' => $mail_value, + 'max_postpone_time' => $postpone_value + ), array('id' => $source['id']) ); return $res && $carry; diff --git a/pandora_console/include/functions_notifications.php b/pandora_console/include/functions_notifications.php index d7810417db..85bcf5caf3 100644 --- a/pandora_console/include/functions_notifications.php +++ b/pandora_console/include/functions_notifications.php @@ -27,6 +27,7 @@ * ============================================================================ */ +define('NOTIFICATIONS_POSTPONE_FOREVER', -1); /** * Retrieves source ID for given source. @@ -214,6 +215,26 @@ function notifications_print_global_source_configuration($source) { $html_checkboxes .= " "; $html_checkboxes .= ""; + // Generate the select with the time + $html_select_pospone = __('Users can postpone notifications up to'); + $html_select_pospone .= html_print_select ( + array( + SECONDS_5MINUTES => __('5 minutes'), + SECONDS_15MINUTES => __('15 minutes'), + SECONDS_12HOURS => __('12 hours'), + SECONDS_1DAY => __('1 day'), + SECONDS_1WEEK => __('1 week'), + SECONDS_15DAYS => __('15 days'), + SECONDS_1MONTH => __('1 month'), + NOTIFICATIONS_POSTPONE_FOREVER => __('forever')), + "postpone-{$id}", + $source['max_postpone_time'], + '', + '', + 0, + true + ); + // Return all html - return $html_title . $html_checkboxes; + return $html_title . $html_checkboxes . $html_select_pospone; }