From a5de6f1e75b93c30b478952b7c179dff57b6ff94 Mon Sep 17 00:00:00 2001 From: Imanol Losada Date: Thu, 30 Apr 2015 11:53:55 -0500 Subject: [PATCH] Remove notices and warning messages - refs #7670 --- plugin/ticket/src/myticket.php | 40 +++++++++++++++++++++++----- plugin/ticket/src/new_ticket.php | 5 +++- plugin/ticket/src/ticket.class.php | 18 ++++++++----- plugin/ticket/src/ticket_details.php | 12 +++++---- 4 files changed, 56 insertions(+), 19 deletions(-) diff --git a/plugin/ticket/src/myticket.php b/plugin/ticket/src/myticket.php index a0e79494e4..5fbda89c8b 100755 --- a/plugin/ticket/src/myticket.php +++ b/plugin/ticket/src/myticket.php @@ -199,9 +199,35 @@ $isAdmin = api_is_platform_admin(); Display::display_header($plugin->get_lang('MyTickets')); if ($isAdmin) { - $get_parameter = '&keyword=' . Security::remove_XSS($_GET['keyword']) . '&keyword_status=' . Security::remove_XSS($_GET['keyword_status']) . '&keyword_category=' .Security::remove_XSS($_GET['keyword_category']). '&keyword_request_user=' . Security::remove_XSS($_GET['keyword_request_user']); - $get_parameter .= '&keyword_admin=' . Security::remove_XSS($_GET['keyword_admin']) . '&keyword_start_date=' . Security::remove_XSS($_GET['keyword_start_date']) . '&keyword_unread=' . Security::remove_XSS($_GET['keyword_unread']); - $get_parameter2 = '&Tickets_per_page=' . Security::remove_XSS($_GET['Tickets_per_page']) . '&Tickets_column=' . Security::remove_XSS($_GET['Tickets_column']); + $getParameters = [ + 'keyword', + 'keyword_status', + 'keyword_category', + 'keyword_request_user', + 'keyword_admin', + 'keyword_start_date', + 'keyword_unread', + 'Tickets_per_page', + 'Tickets_column' + ]; + $get_parameter = ''; + foreach ($getParameters as $getParameter) { + if (isset($_GET[$getParameter])) { + $get_parameter .= "&$getParameter=".Security::remove_XSS($_GET[$getParameter]); + } + } + + $getParameters = [ + 'Tickets_per_page', + 'Tickets_column' + ]; + $get_parameter2 = ''; + foreach ($getParameters as $getParameter) { + if (isset($_GET[$getParameter])) { + $get_parameter2 .= "&$getParameter=".Security::remove_XSS($_GET[$getParameter]); + } + } + if (isset($_GET['submit_advanced'])) { $get_parameter .= "&submit_advanced="; } @@ -209,7 +235,7 @@ if ($isAdmin) { $get_parameter .= "&submit_simple="; } //select categories - $select_types .= ''; $select_types .= ''; $types = TicketManager::get_all_tickets_categories(); foreach ($types as $type) { @@ -217,7 +243,7 @@ if ($isAdmin) { } $select_types .= ""; //select admins - $select_admins .= ''; $select_admins .= ''; $select_admins .= ''; $admins = UserManager::get_user_list_like(array("status" => "1"), array("username"), true); @@ -226,7 +252,7 @@ if ($isAdmin) { } $select_admins .= ""; //select status - $select_status .= ''; $select_status .= ''; $status = TicketManager::get_all_tickets_status(); foreach ($status as $stat) { @@ -234,7 +260,7 @@ if ($isAdmin) { } $select_status .= ""; //select priority - $select_priority .= ''; $select_priority .= ''; $select_priority .= ''; $select_priority .= ''; diff --git a/plugin/ticket/src/new_ticket.php b/plugin/ticket/src/new_ticket.php index 8c29143fff..8fdd6187f3 100755 --- a/plugin/ticket/src/new_ticket.php +++ b/plugin/ticket/src/new_ticket.php @@ -411,8 +411,11 @@ function show_form_send_ticket() 'button', 'compose', get_lang('SendMessage'), + null, + null, + null, + 'save', array( - 'class' => 'save', 'id' => 'btnsubmit' ) ); diff --git a/plugin/ticket/src/ticket.class.php b/plugin/ticket/src/ticket.class.php index f5dece4692..056cc64023 100755 --- a/plugin/ticket/src/ticket.class.php +++ b/plugin/ticket/src/ticket.class.php @@ -504,9 +504,12 @@ class TicketManager if (!$isAdmin) { $sql .= " AND request_user = '$user_id' "; } - $keyword_unread = Database::escape_string( - trim($_GET['keyword_unread']) - ); + $keyword_unread = ''; + if (isset($_GET['keyword_unread'])) { + $keyword_unread = Database::escape_string( + trim($_GET['keyword_unread']) + ); + } //Search simple if (isset($_GET['submit_simple'])) { if ($_GET['keyword'] != '') { @@ -812,9 +815,12 @@ class TicketManager OR user.username LIKE '%$keyword%') "; } } - $keyword_unread = Database::escape_string( - trim($_GET['keyword_unread']) - ); + $keyword_unread = ''; + if (isset($_GET['keyword_unread'])) { + $keyword_unread = Database::escape_string( + trim($_GET['keyword_unread']) + ); + } //Search advanced if (isset($_GET['submit_advanced'])) { $keyword_category = Database::escape_string( diff --git a/plugin/ticket/src/ticket_details.php b/plugin/ticket/src/ticket_details.php index 2998ca740e..4b154d55c5 100755 --- a/plugin/ticket/src/ticket_details.php +++ b/plugin/ticket/src/ticket_details.php @@ -247,13 +247,14 @@ if (!isset($_POST['compose'])) { } } $titulo = '

Ticket #' . $ticket['ticket']['ticket_code'] . '

'; + $img_assing = ''; if ($isAdmin && $ticket['ticket']['status_id'] != 'CLS' && $ticket['ticket']['status_id'] != 'REE') { if ($ticket['ticket']['assigned_last_user'] != 0 && $ticket['ticket']['assigned_last_user'] == $user_id) { $img_assing = ' '; } else { - $img_assing .= ''; + $img_assing = ''; } } $bold = ''; @@ -306,7 +307,7 @@ if (!isset($_POST['compose'])) { '; } //select admins - $select_admins .= ''; $admins = UserManager::get_user_list_like(array("status" => "1"), array("username"), true); foreach ($admins as $admin) { @@ -450,9 +451,10 @@ function show_form_send_message() 'button', 'compose', get_lang('SendMessage'), - array( - 'class' => 'save' - ) + null, + null, + null, + 'save' ); $form->display();