From e14e4090d294565fe9a93852be50d6e169db7031 Mon Sep 17 00:00:00 2001 From: fermin831 Date: Mon, 13 Jun 2016 16:47:38 +0200 Subject: [PATCH] Added Mark as read button to update manager messages --- .../update_manager.messages.php | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/pandora_console/godmode/update_manager/update_manager.messages.php b/pandora_console/godmode/update_manager/update_manager.messages.php index e4f6d3a3ac..39103a49b6 100644 --- a/pandora_console/godmode/update_manager/update_manager.messages.php +++ b/pandora_console/godmode/update_manager/update_manager.messages.php @@ -46,6 +46,7 @@ if (is_ajax()) { } $not_read_action = get_parameter('not_read_button', false); +$read_action = get_parameter('read_button', false); $delete_action = get_parameter ('delete_button', false); if ($not_read_action !== false) { @@ -57,6 +58,15 @@ if ($not_read_action !== false) { } } +if ($read_action !== false) { + + $selected = get_parameter ('select_multiple', false); + foreach ($selected as $k => $message_id) { + + update_manger_set_read_message ($message_id, 1); + } +} + if ($delete_action !== false) { $selected = get_parameter ('select_multiple', false); @@ -76,7 +86,8 @@ if ($total_messages){ $sql = 'SELECT data, svn_version, filename, data_rollback, db_field_value FROM tupdate '; $sql .= 'WHERE description NOT LIKE \'%"' . $config['id_user'] . '":1%\' '; $sql .= 'OR description IS NULL '; - $sql .= 'LIMIT ' . $offset . ',' . $config['block_size']; + $sql .= 'ORDER BY svn_version DESC '; + $sql .= 'LIMIT ' . $offset . ',' . $config['block_size'] . ' '; $um_messages = array (); $um_messages = db_get_all_rows_sql ($sql); @@ -94,6 +105,11 @@ if ($total_messages){ 'class="sub wand"'); echo ''; + echo '
'; + html_print_submit_button (__('Mark as read'), 'read_button', false, + 'class="sub upd"'); + echo '
'; + if ($total_messages > $config['block_size']) { ui_pagination (update_manager_get_total_messages (), false, 0); } @@ -173,6 +189,11 @@ if ($total_messages){ html_print_submit_button (__('Mark as not read'), 'not_read_button', false, 'class="sub wand"'); echo ''; + + echo '
'; + html_print_submit_button (__('Mark as read'), 'read_button', false, + 'class="sub upd"'); + echo '
'; echo ''; } else { ui_print_info_message ( array ( 'no_close' => true, 'message' => __('There is not any update manager messages.') ) ); @@ -269,7 +290,7 @@ if ($total_messages){ $(".um_individual_info, .um_individual_subject").hover( function () { - $(this).parent().css('background', '#EFFFEF'); + $(this).parent().css('background', '#F2F2F2'); }, function () { if ($(this).parent().find(":first-child").is(':checked')) {