Merge branch 'ent-4461-Configuracion-integracion-integria' of https://brutus.artica.lan:8081/artica/pandorafms into ent-4461-Configuracion-integracion-integria

This commit is contained in:
alejandro-campos 2019-09-23 15:17:22 +02:00
commit 8d2820df37
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.
*
* @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'] = '<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>';
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'] = '<a href="'.$url_tabs.'configure_integriaims_incident&incident_id='.$active_tab.'">'.html_print_image('images/pencil.png', true, ['title' => __('Edit incident')]).'</a>';
$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>';
$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'] = '<a href="'.$url_tabs.'configure_integriaims_incident&incident_id='.$view.'">'.html_print_image('images/pencil.png', true, ['title' => __('Edit incident')]).'</a>';
$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>';
// 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 = [

View File

@ -27,7 +27,8 @@ require_once $config['homedir'].'/include/functions_integriaims.php';
$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 {

View File

@ -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);

View File

@ -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 = '<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 .= '<div style="width:100%; text-align:right;">';
$integria_incidents_form .= '<div style="float:right; margin-left: 5px;">'.html_print_button(