diff --git a/pandora_console/include/functions_integriaims.php b/pandora_console/include/functions_integriaims.php index c121572a73..74e97433cc 100644 --- a/pandora_console/include/functions_integriaims.php +++ b/pandora_console/include/functions_integriaims.php @@ -27,11 +27,12 @@ require_once $config['homedir'].'/include/functions.php'; /** * Show header tabs. * - * @param string $active_tab Current tab or id_incident. + * @param string $active_tab Current tab or false for View page. + * @param number $view Id of incident. Show View tab. * * @return html Print tabs in header. */ -function integriaims_tabs($active_tab=false) +function integriaims_tabs($active_tab, $view=false) { $url_tabs = ui_get_full_url('index.php?sec=incident&sec2=operation/incidents/'); @@ -39,45 +40,39 @@ function integriaims_tabs($active_tab=false) $list_tab['text'] = ''.html_print_image('images/list.png', true, ['title' => __('List incidents')]).''; $create_tab['text'] = ''.html_print_image('images/pencil.png', true, ['title' => __('New incident')]).''; - if ($active_tab) { - switch ($active_tab) { - case 'setup_tab': - $setup_tab['active'] = true; - $list_tab['active'] = false; - $create_tab['active'] = false; - break; + switch ($active_tab) { + case 'setup_tab': + $setup_tab['active'] = true; + $list_tab['active'] = false; + $create_tab['active'] = false; + break; - case 'list_tab': - $setup_tab['active'] = false; - $list_tab['active'] = true; - $create_tab['active'] = false; - break; + case 'list_tab': + $setup_tab['active'] = false; + $list_tab['active'] = true; + $create_tab['active'] = false; + break; - case 'create_tab': - $setup_tab['active'] = false; - $list_tab['active'] = false; - $create_tab['active'] = true; - break; + case 'create_tab': + $setup_tab['active'] = false; + $list_tab['active'] = false; + $create_tab['active'] = true; + break; - case is_numeric($active_tab): - $create_tab['text'] = ''.html_print_image('images/pencil.png', true, ['title' => __('Edit incident')]).''; - $view_tab['text'] = ''.html_print_image('images/operation.png', true, ['title' => __('View incident')]).''; - $setup_tab['active'] = false; - $list_tab['active'] = false; - $create_tab['active'] = false; - $view_tab['active'] = true; - break; + default: + $setup_tab['active'] = false; + $list_tab['active'] = false; + $create_tab['active'] = false; + break; + } - default: - $setup_tab['active'] = false; - $list_tab['active'] = false; - $create_tab['active'] = false; - break; + if ($view) { + $create_tab['text'] = ''.html_print_image('images/pencil.png', true, ['title' => __('Edit incident')]).''; + $view_tab['text'] = ''.html_print_image('images/operation.png', true, ['title' => __('View incident')]).''; + // When the current page is the View page. + if (!$active_tab) { + $view_tab['active'] = true; } - } else { - $setup_tab['active'] = false; - $list_tab['active'] = false; - $create_tab['active'] = false; } $onheader = [ diff --git a/pandora_console/operation/incidents/configure_integriaims_incident.php b/pandora_console/operation/incidents/configure_integriaims_incident.php index 5af26304f5..ba4b50e21d 100644 --- a/pandora_console/operation/incidents/configure_integriaims_incident.php +++ b/pandora_console/operation/incidents/configure_integriaims_incident.php @@ -27,7 +27,8 @@ if (!(check_acl($config['id_user'], 0, 'IW') && check_acl($config['id_user'], 0, $update = (isset($_GET['incident_id']) === true); -$onheader = integriaims_tabs('create_tab'); +// Header tabs. +$onheader = integriaims_tabs('create_tab', $_GET['incident_id']); if ($update) { ui_print_page_header(__('Update Integria IMS Incident'), '', false, '', false, $onheader); } else { diff --git a/pandora_console/operation/incidents/dashboard_detail_integriaims_incident.php b/pandora_console/operation/incidents/dashboard_detail_integriaims_incident.php index a37af0de50..903e96ad9f 100644 --- a/pandora_console/operation/incidents/dashboard_detail_integriaims_incident.php +++ b/pandora_console/operation/incidents/dashboard_detail_integriaims_incident.php @@ -62,7 +62,7 @@ $array_get_incidents = $array_get_incidents[$incident_id]; // Header tabs. -$onheader = integriaims_tabs($incident_id); +$onheader = integriaims_tabs(false, $incident_id); ui_print_page_header($array_get_incidents[3].' - '.__('Details'), '', false, '', false, $onheader); diff --git a/pandora_console/operation/incidents/list_integriaims_incidents.php b/pandora_console/operation/incidents/list_integriaims_incidents.php index e22d6c5f43..ab3282a722 100644 --- a/pandora_console/operation/incidents/list_integriaims_incidents.php +++ b/pandora_console/operation/incidents/list_integriaims_incidents.php @@ -98,6 +98,7 @@ $resolution_incident = integriaims_get_details('resolution'); $table = new StdClass(); $table->width = '100%'; $table->class = 'databox filters'; +$table->styleTable = 'margin-bottom:0px'; $table->cellpadding = '0'; $table->cellspacing = '0'; $table->data = []; @@ -205,7 +206,7 @@ $decode_csv = base64_encode(json_encode($tickets_filters)); // ---- PRINT TABLE FILTERS ---- -$integria_incidents_form = '