diff --git a/pandora_console/godmode/update_manager/update_manager.messages.php b/pandora_console/godmode/update_manager/update_manager.messages.php new file mode 100644 index 0000000000..aef074e5ae --- /dev/null +++ b/pandora_console/godmode/update_manager/update_manager.messages.php @@ -0,0 +1,231 @@ + $message_id) { + + update_manger_set_read_message ($message_id, 0); + } +} + +if ($delete_action !== false) { + + $selected = get_parameter ('select_multiple', false); + foreach ($selected as $k => $message_id) { + + db_process_sql_delete ('tupdate', array('svn_version' => $message_id)); + } + +} + +// Get all messages +$sql = 'SELECT data, svn_version, filename, data_rollback, description FROM tupdate'; +$um_messages = array (); +$um_messages = db_get_all_rows_sql ($sql); + +echo '
'; +?> + + diff --git a/pandora_console/godmode/update_manager/update_manager.php b/pandora_console/godmode/update_manager/update_manager.php index 4659550a4e..27590bc011 100644 --- a/pandora_console/godmode/update_manager/update_manager.php +++ b/pandora_console/godmode/update_manager/update_manager.php @@ -40,7 +40,11 @@ $buttons = array( 'online' => array( 'active' => ($tab == 'online') ? true : false, 'text' => '' . - html_print_image("images/op_gis.png", true, array ("title" => __('Online update manager'))) .'') + html_print_image("images/op_gis.png", true, array ("title" => __('Online update manager'))) .''), + 'messages' => array( + 'active' => ($tab == 'messages') ? true : false, + 'text' => '' . + html_print_image("images/hourglass.png", true, array ("title" => __('Update manager messages'))) .'') ); switch ($tab) { @@ -53,6 +57,9 @@ switch ($tab) { case 'online': $title = __('Update manager » Online'); break; + case 'messages': + $title = __('Update manager » Messages'); + break; } ui_print_page_header($title, @@ -65,6 +72,9 @@ switch ($tab) { case 'offline': require($config['homedir'] . "/godmode/update_manager/update_manager.offline.php"); break; + case 'messages': + require($config['homedir'] . "/godmode/update_manager/update_manager.messages.php"); + break; case 'online': default: require($config['homedir'] . "/godmode/update_manager/update_manager.online.php"); diff --git a/pandora_console/include/functions_update_manager.php b/pandora_console/include/functions_update_manager.php index b4ec1c2ae7..02a4b07d13 100755 --- a/pandora_console/include/functions_update_manager.php +++ b/pandora_console/include/functions_update_manager.php @@ -523,4 +523,31 @@ function update_manager_get_current_package() { return $current_update; } + +// Set the read or not read status message of current user +function update_manger_set_read_message ($message_id, $status) { + global $config; + + $rollback = db_get_value('data_rollback', 'tupdate', 'svn_version', $message_id); + $users_read = json_decode ($rollback, true); + $users_read[$config['id_user']] = $status; + + $rollback = json_encode ($users_read); + db_process_sql_update('tupdate', array('data_rollback' => $rollback), array('svn_version' => $message_id)); +} + +// Get the read or not read status message +function update_manger_get_read_message ($message_id, $rollback = false) { + global $config; + + if ($rollback === false) { + $rollback = db_get_value('data_rollback', 'tupdate', 'svn_version', $message_id); + } + $users_read = json_decode ($rollback, true); + + if (isset ($users_read[$config['id_user']]) && ($users_read[$config['id_user']] == 1)) { + return true; + } + return false; +} ?> diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 0a5506346d..03c3c1d023 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -3098,6 +3098,14 @@ table#policy_modules td * { margin-left: 3%; } +.um_not_read_message{ + font-weight: 900; +} +.um_read_message{ + font-weight: 500; + color: #bbbbbb; +} + /* The items with the class 'spinner' will rotate */ /* Not supported on IE9 and below */ .spinner {