mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-04-08 18:55:09 +02:00
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:
commit
ad01cd0303
@ -55,7 +55,7 @@ if ($has_connection === false && $config['integria_enabled']) {
|
||||
|
||||
if (get_parameter('update_config', 0) == 1) {
|
||||
// Try to retrieve event response 'Create incident in IntegriaIMS from event' to check if it exists.
|
||||
$event_response_exists = db_get_row_filter('tevent_response', ['name' => io_safe_input('Create incident in IntegriaIMS from event')]);
|
||||
$event_response_exists = db_get_row_filter('tevent_response', ['name' => io_safe_input('Create ticket in IntegriaIMS from event')]);
|
||||
|
||||
// Try to retrieve command 'Integia IMS Ticket' to check if it exists.
|
||||
$command_exists = db_get_row_filter('talert_commands', ['name' => io_safe_input('Integria IMS Ticket')]);
|
||||
@ -66,8 +66,8 @@ if (get_parameter('update_config', 0) == 1) {
|
||||
db_process_sql_insert(
|
||||
'tevent_response',
|
||||
[
|
||||
'name' => io_safe_input('Create incident in IntegriaIMS from event'),
|
||||
'description' => io_safe_input('Create an incident in Integria IMS from an event'),
|
||||
'name' => io_safe_input('Create ticket in IntegriaIMS from event'),
|
||||
'description' => io_safe_input('Create a ticket in Integria IMS from an event'),
|
||||
'target' => io_safe_input('index.php?sec=incident&sec2=operation/incidents/configure_integriaims_incident&from_event=_event_id_'),
|
||||
'type' => 'url',
|
||||
'id_group' => '0',
|
||||
@ -88,7 +88,7 @@ if (get_parameter('update_config', 0) == 1) {
|
||||
'name' => io_safe_input('Integria IMS Ticket'),
|
||||
'command' => io_safe_input('Internal type'),
|
||||
'internal' => 1,
|
||||
'description' => io_safe_input('Create an incident in Integria IMS'),
|
||||
'description' => io_safe_input('Create a ticket in Integria IMS'),
|
||||
'fields_descriptions' => '["'.io_safe_input('Ticket title').'","'.io_safe_input('Ticket group ID').'","'.io_safe_input('Ticket priority').'","'.io_safe_input('Ticket owner').'","'.io_safe_input('Ticket type').'","'.io_safe_input('Ticket status').'","'.io_safe_input('Ticket description').'"]',
|
||||
]
|
||||
);
|
||||
@ -140,7 +140,7 @@ if (get_parameter('update_config', 0) == 1) {
|
||||
} else {
|
||||
if ($event_response_exists != false) {
|
||||
// Delete 'Create incident in IntegriaIMS from event' event response if it does exist and IntegriaIMS integration is disabled.
|
||||
db_process_sql_delete('tevent_response', ['name' => io_safe_input('Create incident in IntegriaIMS from event')]);
|
||||
db_process_sql_delete('tevent_response', ['name' => io_safe_input('Create ticket in IntegriaIMS from event')]);
|
||||
}
|
||||
|
||||
if ($command_exists != false) {
|
||||
@ -197,7 +197,7 @@ $table_enable->style['name'] = 'font-weight: bold';
|
||||
|
||||
// Enable Integria.
|
||||
$row = [];
|
||||
$row['name'] = __('Enable Integria');
|
||||
$row['name'] = __('Enable Integria IMS');
|
||||
$row['control'] = html_print_checkbox_switch('integria_enabled', 1, $config['integria_enabled'], true);
|
||||
$table_enable->data['integria_enabled'] = $row;
|
||||
|
||||
@ -304,7 +304,7 @@ $table_cr_settings->data['custom_response_def_group'] = $row;
|
||||
|
||||
// Custom response default criticity.
|
||||
$row = [];
|
||||
$row['name'] = __('Criticity');
|
||||
$row['name'] = __('Priority');
|
||||
$row['control'] = html_print_select(
|
||||
$integria_criticity_values,
|
||||
'default_criticity',
|
||||
@ -413,7 +413,7 @@ if ($has_connection != false) {
|
||||
// Form custom response settings.
|
||||
echo '<div id="form_custom_response_settings">';
|
||||
echo '<fieldset>';
|
||||
echo '<legend>'.__('Incident default values').'</legend>';
|
||||
echo '<legend>'.__('Ticket default values').'</legend>';
|
||||
|
||||
html_print_table($table_cr_settings);
|
||||
|
||||
|
@ -1436,7 +1436,7 @@ function config_update_config()
|
||||
|
||||
case 'integria':
|
||||
if (!config_update_value('integria_enabled', (int) get_parameter('integria_enabled', 0))) {
|
||||
$error_update[] = __('Enable Integria');
|
||||
$error_update[] = __('Enable Integria IMS');
|
||||
}
|
||||
|
||||
if (!config_update_value('integria_user', (string) get_parameter('integria_user', $config['integria_user']))) {
|
||||
@ -1464,7 +1464,7 @@ function config_update_config()
|
||||
}
|
||||
|
||||
if (!config_update_value('default_criticity', (int) get_parameter('default_criticity', $config['default_criticity']))) {
|
||||
$error_update[] = __('Integria default criticity');
|
||||
$error_update[] = __('Integria default priority');
|
||||
}
|
||||
|
||||
if (!config_update_value('default_creator', (string) get_parameter('default_creator', $config['default_creator']))) {
|
||||
@ -1476,19 +1476,19 @@ function config_update_config()
|
||||
}
|
||||
|
||||
if (!config_update_value('incident_type', (int) get_parameter('incident_type', $config['incident_type']))) {
|
||||
$error_update[] = __('Integria default incident type');
|
||||
$error_update[] = __('Integria default ticket type');
|
||||
}
|
||||
|
||||
if (!config_update_value('incident_status', (int) get_parameter('incident_status', $config['incident_status']))) {
|
||||
$error_update[] = __('Integria default incident status');
|
||||
$error_update[] = __('Integria default ticket status');
|
||||
}
|
||||
|
||||
if (!config_update_value('incident_title', (string) get_parameter('incident_title', $config['incident_title']))) {
|
||||
$error_update[] = __('Integria default incident title');
|
||||
$error_update[] = __('Integria default ticket title');
|
||||
}
|
||||
|
||||
if (!config_update_value('incident_content', (string) get_parameter('incident_content', $config['incident_content']))) {
|
||||
$error_update[] = __('Integria default incident content');
|
||||
$error_update[] = __('Integria default ticket content');
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -39,8 +39,8 @@ function integriaims_tabs($active_tab, $view=false)
|
||||
$url_tabs = ui_get_full_url('index.php?sec=incident&sec2=operation/incidents/');
|
||||
|
||||
$setup_tab['text'] = '<a href="'.ui_get_full_url('index.php?sec=general&sec2=godmode/setup/setup§ion=integria').'">'.html_print_image('images/setup.png', true, ['title' => __('Configure Integria IMS')]).'</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>';
|
||||
$list_tab['text'] = '<a href="'.$url_tabs.'list_integriaims_incidents">'.html_print_image('images/list.png', true, ['title' => __('Ticket list')]).'</a>';
|
||||
$create_tab['text'] = '<a href="'.$url_tabs.'configure_integriaims_incident">'.html_print_image('images/pencil.png', true, ['title' => __('New ticket')]).'</a>';
|
||||
|
||||
switch ($active_tab) {
|
||||
case 'setup_tab':
|
||||
@ -69,8 +69,8 @@ function integriaims_tabs($active_tab, $view=false)
|
||||
}
|
||||
|
||||
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>';
|
||||
$create_tab['text'] = '<a href="'.$url_tabs.'configure_integriaims_incident&incident_id='.$view.'">'.html_print_image('images/pencil.png', true, ['title' => __('Edit ticket')]).'</a>';
|
||||
$view_tab['text'] = '<a href="'.$url_tabs.'dashboard_detail_integriaims_incident&incident_id='.$view.'">'.html_print_image('images/operation.png', true, ['title' => __('View ticket')]).'</a>';
|
||||
// When the current page is the View page.
|
||||
if (!$active_tab) {
|
||||
$view_tab['active'] = true;
|
||||
@ -83,7 +83,7 @@ function integriaims_tabs($active_tab, $view=false)
|
||||
$onheader['view'] = $view_tab;
|
||||
}
|
||||
|
||||
if (check_acl($config['id_user'], 0, 'PM') && is_user_admin($config['id_user'])) {
|
||||
if (check_acl($config['id_user'], 0, 'PM')) {
|
||||
$onheader['configure'] = $setup_tab;
|
||||
}
|
||||
|
||||
@ -91,7 +91,7 @@ function integriaims_tabs($active_tab, $view=false)
|
||||
$onheader['list'] = $list_tab;
|
||||
}
|
||||
|
||||
if ((check_acl($config['id_user'], 0, 'IW') && check_acl($config['id_user'], 0, 'IR'))) {
|
||||
if (check_acl($config['id_user'], 0, 'IW')) {
|
||||
$onheader['create'] = $create_tab;
|
||||
}
|
||||
|
||||
|
@ -30,9 +30,9 @@ $update = (isset($_GET['incident_id']) === true);
|
||||
// Header tabs.
|
||||
$onheader = integriaims_tabs('create_tab', $_GET['incident_id']);
|
||||
if ($update) {
|
||||
ui_print_page_header(__('Update Integria IMS Incident'), '', false, '', false, $onheader);
|
||||
ui_print_page_header(__('Update Integria IMS Ticket'), '', false, '', false, $onheader);
|
||||
} else {
|
||||
ui_print_page_header(__('Create Integria IMS Incident'), '', false, '', false, $onheader);
|
||||
ui_print_page_header(__('Create Integria IMS Ticket'), '', false, '', false, $onheader);
|
||||
}
|
||||
|
||||
// Check if Integria integration enabled.
|
||||
@ -241,7 +241,7 @@ $table->data[2][1] .= '<div class="label_select_parent">'.html_print_input_text(
|
||||
'w100p'
|
||||
).ui_print_help_tip(__('This field corresponds to the Integria IMS user specified in Integria IMS setup'), true).'</div>';
|
||||
|
||||
$table->data[1][2] = '<div class="label_select"><p class="input_label">'.__('Criticity').': </p>';
|
||||
$table->data[1][2] = '<div class="label_select"><p class="input_label">'.__('Priority').': </p>';
|
||||
$table->data[1][2] .= '<div class="label_select_parent">'.html_print_select(
|
||||
$integria_criticity_values,
|
||||
'criticity',
|
||||
|
@ -27,7 +27,7 @@ if (! check_acl($config['id_user'], 0, 'IR')) {
|
||||
|
||||
// Header tabs.
|
||||
$onheader = integriaims_tabs('list_tab');
|
||||
ui_print_page_header(__('Integria IMS Incidents'), '', false, '', false, $onheader);
|
||||
ui_print_page_header(__('Integria IMS Tickets'), '', false, '', false, $onheader);
|
||||
|
||||
// Check if Integria integration enabled.
|
||||
if ($config['integria_enabled'] == 0) {
|
||||
@ -112,7 +112,7 @@ $table->data[0][3] = html_print_select(
|
||||
'incident_status',
|
||||
$incident_status,
|
||||
'',
|
||||
__('Select'),
|
||||
__('All'),
|
||||
0,
|
||||
true
|
||||
);
|
||||
@ -123,7 +123,7 @@ $table->data[0][5] = html_print_select(
|
||||
'incident_group',
|
||||
$incident_group,
|
||||
'',
|
||||
__('Select'),
|
||||
__('All'),
|
||||
1,
|
||||
true
|
||||
);
|
||||
@ -140,7 +140,7 @@ $table->data[1][5] = html_print_select(
|
||||
'incident_priority',
|
||||
$incident_priority,
|
||||
'',
|
||||
__('Select'),
|
||||
__('All'),
|
||||
-1,
|
||||
true
|
||||
);
|
||||
@ -151,7 +151,7 @@ $table->data[2][1] = html_print_select(
|
||||
'incident_resolution',
|
||||
$incident_resolution,
|
||||
'',
|
||||
__('Select'),
|
||||
__('All'),
|
||||
'',
|
||||
true
|
||||
);
|
||||
@ -221,7 +221,7 @@ $integria_incidents_form .= '<div>'.html_print_submit_button(__('Filter'), 'filt
|
||||
$integria_incidents_form .= '</div>';
|
||||
$integria_incidents_form .= '</form>';
|
||||
|
||||
ui_toggle($integria_incidents_form, __('Add Custom filter'), '', '', false);
|
||||
ui_toggle($integria_incidents_form, __('Filter'), '', '', false);
|
||||
|
||||
/*
|
||||
* Order api call 'get_incidents'.
|
||||
@ -306,7 +306,7 @@ foreach ($incidents_paginated as $key => $value) {
|
||||
// Show table incidents.
|
||||
ui_pagination(count($array_get_incidents), $url, $offset);
|
||||
if (empty($table->data) === true) {
|
||||
ui_print_info_message(['no_close' => true, 'message' => __('No incidents to show').'.' ]);
|
||||
ui_print_info_message(['no_close' => true, 'message' => __('No tickets to show').'.' ]);
|
||||
} else {
|
||||
html_print_table($table);
|
||||
ui_pagination(count($array_get_incidents), $url, $offset, 0, false, 'offset', true, 'pagination-bottom');
|
||||
|
@ -479,7 +479,7 @@ if (check_acl($config['id_user'], 0, 'IR')
|
||||
$sub2 = [];
|
||||
$sub2['operation/incidents/incident']['text'] = __('List of Incidents');
|
||||
$sub2[$sec2sub]['text'] = __('Statistics');
|
||||
$sub2['operation/incidents/list_integriaims_incidents']['text'] = __('Integria IMS Incidents');
|
||||
$sub2['operation/incidents/list_integriaims_incidents']['text'] = __('Integria IMS Tickets');
|
||||
|
||||
$sub[$sec2]['sub2'] = $sub2;
|
||||
$sec2 = $temp_sec2;
|
||||
|
Loading…
x
Reference in New Issue
Block a user