Minor fixes - #4644

This commit is contained in:
Tatiana Llorente 2019-09-23 15:09:52 +02:00
parent 51a1d7c0b7
commit 59eed5f1af
4 changed files with 36 additions and 39 deletions

View File

@ -27,11 +27,12 @@ require_once $config['homedir'].'/include/functions.php';
/** /**
* Show header tabs. * 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. * @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/'); $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'] = '<a href="'.$url_tabs.'list_integriaims_incidents">'.html_print_image('images/list.png', true, ['title' => __('List incidents')]).'</a>'; $list_tab['text'] = '<a href="'.$url_tabs.'list_integriaims_incidents">'.html_print_image('images/list.png', true, ['title' => __('List incidents')]).'</a>';
$create_tab['text'] = '<a href="'.$url_tabs.'configure_integriaims_incident">'.html_print_image('images/pencil.png', true, ['title' => __('New incident')]).'</a>'; $create_tab['text'] = '<a href="'.$url_tabs.'configure_integriaims_incident">'.html_print_image('images/pencil.png', true, ['title' => __('New incident')]).'</a>';
if ($active_tab) { switch ($active_tab) {
switch ($active_tab) { case 'setup_tab':
case 'setup_tab': $setup_tab['active'] = true;
$setup_tab['active'] = true; $list_tab['active'] = false;
$list_tab['active'] = false; $create_tab['active'] = false;
$create_tab['active'] = false; break;
break;
case 'list_tab': case 'list_tab':
$setup_tab['active'] = false; $setup_tab['active'] = false;
$list_tab['active'] = true; $list_tab['active'] = true;
$create_tab['active'] = false; $create_tab['active'] = false;
break; break;
case 'create_tab': case 'create_tab':
$setup_tab['active'] = false; $setup_tab['active'] = false;
$list_tab['active'] = false; $list_tab['active'] = false;
$create_tab['active'] = true; $create_tab['active'] = true;
break; break;
case is_numeric($active_tab): default:
$create_tab['text'] = '<a href="'.$url_tabs.'configure_integriaims_incident&incident_id='.$active_tab.'">'.html_print_image('images/pencil.png', true, ['title' => __('Edit incident')]).'</a>'; $setup_tab['active'] = false;
$view_tab['text'] = '<a href="'.$url_tabs.'dashboard_detail_integriaims_incident&incident_id='.$active_tab.'">'.html_print_image('images/operation.png', true, ['title' => __('View incident')]).'</a>'; $list_tab['active'] = false;
$setup_tab['active'] = false; $create_tab['active'] = false;
$list_tab['active'] = false; break;
$create_tab['active'] = false; }
$view_tab['active'] = true;
break;
default: if ($view) {
$setup_tab['active'] = false; $create_tab['text'] = '<a href="'.$url_tabs.'configure_integriaims_incident&incident_id='.$view.'">'.html_print_image('images/pencil.png', true, ['title' => __('Edit incident')]).'</a>';
$list_tab['active'] = false; $view_tab['text'] = '<a href="'.$url_tabs.'dashboard_detail_integriaims_incident&incident_id='.$view.'">'.html_print_image('images/operation.png', true, ['title' => __('View incident')]).'</a>';
$create_tab['active'] = false; // When the current page is the View page.
break; if (!$active_tab) {
$view_tab['active'] = true;
} }
} else {
$setup_tab['active'] = false;
$list_tab['active'] = false;
$create_tab['active'] = false;
} }
$onheader = [ $onheader = [

View File

@ -27,7 +27,8 @@ if (!(check_acl($config['id_user'], 0, 'IW') && check_acl($config['id_user'], 0,
$update = (isset($_GET['incident_id']) === true); $update = (isset($_GET['incident_id']) === true);
$onheader = integriaims_tabs('create_tab'); // Header tabs.
$onheader = integriaims_tabs('create_tab', $_GET['incident_id']);
if ($update) { if ($update) {
ui_print_page_header(__('Update Integria IMS Incident'), '', false, '', false, $onheader); ui_print_page_header(__('Update Integria IMS Incident'), '', false, '', false, $onheader);
} else { } else {

View File

@ -62,7 +62,7 @@ $array_get_incidents = $array_get_incidents[$incident_id];
// Header tabs. // 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); ui_print_page_header($array_get_incidents[3].' - '.__('Details'), '', false, '', false, $onheader);

View File

@ -98,6 +98,7 @@ $resolution_incident = integriaims_get_details('resolution');
$table = new StdClass(); $table = new StdClass();
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox filters'; $table->class = 'databox filters';
$table->styleTable = 'margin-bottom:0px';
$table->cellpadding = '0'; $table->cellpadding = '0';
$table->cellspacing = '0'; $table->cellspacing = '0';
$table->data = []; $table->data = [];
@ -205,7 +206,7 @@ $decode_csv = base64_encode(json_encode($tickets_filters));
// ---- PRINT TABLE FILTERS ---- // ---- PRINT TABLE FILTERS ----
$integria_incidents_form = '<form method="post" action="'.$url.'">'; $integria_incidents_form = '<form method="post" action="'.$url.'" style="padding:0px;">';
$integria_incidents_form .= html_print_table($table, true); $integria_incidents_form .= html_print_table($table, true);
$integria_incidents_form .= '<div style="width:100%; text-align:right;">'; $integria_incidents_form .= '<div style="width:100%; text-align:right;">';
$integria_incidents_form .= '<div style="float:right; margin-left: 5px;">'.html_print_button( $integria_incidents_form .= '<div style="float:right; margin-left: 5px;">'.html_print_button(