From 650dff4c20cf2caf43ef750d8cb3286a991b1929 Mon Sep 17 00:00:00 2001 From: jmontoyaa Date: Tue, 24 May 2016 12:11:22 +0200 Subject: [PATCH] Add breadcrumb, fix notices --- plugin/ticket/src/categories.php | 13 +++--- plugin/ticket/src/categories_add_user.php | 2 +- plugin/ticket/src/new_ticket.php | 48 +++-------------------- 3 files changed, 15 insertions(+), 48 deletions(-) diff --git a/plugin/ticket/src/categories.php b/plugin/ticket/src/categories.php index e885ca66dd..d7ff60f35e 100644 --- a/plugin/ticket/src/categories.php +++ b/plugin/ticket/src/categories.php @@ -15,8 +15,7 @@ $plugin = TicketPlugin::create(); api_protect_admin_script(true); -$tool_name = $plugin->get_lang('LastEdit'); - +$toolName = $plugin->get_lang('Categories'); $libPath = api_get_path(LIBRARY_PATH); $webLibPath = api_get_path(WEB_LIBRARY_PATH); @@ -38,6 +37,8 @@ if ($table->per_page == 0) { $formToString = ''; $id = isset($_GET['id']) ? intval($_GET['id']) : 0; +$interbreadcrumb[] = array('url' => 'myticket.php', 'name' => $plugin->get_lang('MyTickets')); + if (isset($_GET['action'])) { global $table; $action = $_GET['action']; @@ -49,6 +50,8 @@ if (isset($_GET['action'])) { header("Location: ".api_get_self()); break; case 'add': + $toolName = get_lang('Add'); + $interbreadcrumb[] = array('url' => 'categories.php', 'name' => $plugin->get_lang('Categories')); $url = api_get_self().'?action=add'; $form = TicketManager::getCategoryForm($url); $formToString = $form->returnForm(); @@ -71,6 +74,8 @@ if (isset($_GET['action'])) { } break; case 'edit': + $toolName = get_lang('Edit'); + $interbreadcrumb[] = array('url' => 'categories.php', 'name' => $plugin->get_lang('Categories')); $url = api_get_self().'?action=edit&id='.$id; $form = TicketManager::getCategoryForm($url); @@ -134,9 +139,7 @@ $table->set_header(3, $plugin->get_lang('TotalTickets'), false); $table->set_header(4, get_lang('Actions'), true); $table->set_column_filter(4, 'modify_filter'); -$interbreadcrumb[] = array('url' => 'myticket.php', 'name' => $plugin->get_lang('MyTickets')); - -Display::display_header($plugin->get_lang('Categories')); +Display::display_header($toolName); $items = [ [ diff --git a/plugin/ticket/src/categories_add_user.php b/plugin/ticket/src/categories_add_user.php index b55ac91f5c..7e8793860b 100644 --- a/plugin/ticket/src/categories_add_user.php +++ b/plugin/ticket/src/categories_add_user.php @@ -51,5 +51,5 @@ if ($form->validate()) { $interbreadcrumb[] = array('url' => 'myticket.php', 'name' => $plugin->get_lang('MyTickets')); $interbreadcrumb[] = array('url' => 'categories.php', 'name' => get_lang('Categories')); -Display::display_header(); +Display::display_header(get_lang('Users')); $form->display(); diff --git a/plugin/ticket/src/new_ticket.php b/plugin/ticket/src/new_ticket.php index 374a7545a4..6a3801dd5c 100755 --- a/plugin/ticket/src/new_ticket.php +++ b/plugin/ticket/src/new_ticket.php @@ -325,7 +325,7 @@ function show_form_send_ticket() 'Height' => '250' ) ); - + //if (api_is_platform_admin()) { $form->addElement( 'SelectAjax', @@ -336,7 +336,7 @@ function show_form_send_ticket() ); //} - + $form->addElement( 'text', @@ -444,7 +444,7 @@ function save_ticket() $status = $_POST['status_id']; $file_attachments = $_FILES; $responsible = (api_is_platform_admin() ? api_get_user_id() : 0); - + if (TicketManager::insert_new_ticket( $category_id, $course_id, @@ -576,48 +576,12 @@ function get_user_data($from, $number_of_items, $column, $direction) return $users; } + +$interbreadcrumb[] = array('url' => 'myticket.php', 'name' => $plugin->get_lang('MyTickets')); + if (!isset($_POST['compose'])) { if (api_is_platform_admin()) { Display::display_header(get_lang('ComposeMessage')); - - /* - $message = $plugin->get_lang('PleaseBeforeRegisterATicketSelectOneUser'); - Display::display_warning_message($message); - echo ' -
-   - -
'; - echo '
'; - $order = (api_is_western_name_order() || api_sort_by_first_name()) ? 3 : 2; - $table = new SortableTable( - 'users', - 'get_number_of_users', - 'get_user_data', - $order, - 10 - ); - $table->set_header(0, '', false, 'width="18px"'); - $table->set_header(0, get_lang('Photo'), false); - $table->set_header(1, get_lang('OfficialCode')); - if (api_is_western_name_order()) { - $table->set_header(2, get_lang('FirstName')); - $table->set_header(3, get_lang('LastName')); - } else { - $table->set_header(2, get_lang('LastName')); - $table->set_header(3, get_lang('FirstName')); - } - $table->set_header(4, get_lang('LoginName')); - $table->set_header(5, get_lang('Email')); - $table->set_header(6, get_lang('Action')); - $table->display(); - echo '
';*/ } else { $userInfo = api_get_user_info(); $htmlHeadXtra[] = "