Merge branch 'ent-9662-second-round' of brutus.artica.es:artica/pandorafms into ent-9662-second-round

This commit is contained in:
Pablo Aragon 2023-03-22 16:42:15 +01:00
commit 8b163cd100
11 changed files with 585 additions and 393 deletions

View File

@ -240,7 +240,28 @@ function pandora_files_repo_operation()
}
// Header.
ui_print_page_header(__('Files repository'), 'images/extensions.png', false, '', false, $onheader);
ui_print_standard_header(
__('Files repository'),
'images/extensions.png',
false,
'',
false,
$onheader,
[
[
'link' => '',
'label' => __('Admin tools'),
],
[
'link' => '',
'label' => __('Extension manager'),
],
[
'link' => '',
'label' => __('Files repository'),
],
]
);
$full_extensions_dir = $config['homedir'].'/'.EXTENSIONS_DIR.'/';
include_once $full_extensions_dir.'files_repo/functions_files_repo.php';

View File

@ -445,79 +445,75 @@ $tableBasicThresholds->rowclass['caption_warning_threshold'] = 'field_half_width
$tableBasicThresholds->rowclass['warning_threshold'] = 'field_half_width';
$tableBasicThresholds->data['caption_warning_threshold'][0] .= __('Warning threshold').' ';
if ((isset($stringTypeModule) === false || $stringTypeModule === false)) {
$tableBasicThresholds->data['caption_warning_threshold'][0] .= '<span class="font_11" id="caption_minmax_warning">('.__('Min / Max').')</span>';
$tableBasicThresholds->data['warning_threshold'][0] .= html_print_input_text(
'min_warning',
$min_warning,
'',
10,
255,
true,
$disabledBecauseInPolicy || $edit === true,
false,
'',
$classdisabledBecauseInPolicy
);
$tableBasicThresholds->data['warning_threshold'][1] .= html_print_input_text(
'max_warning',
$max_warning,
'',
10,
255,
true,
$disabledBecauseInPolicy || $edit === true,
false,
'',
$classdisabledBecauseInPolicy
).'</span>';
$tableBasicThresholds->data['caption_warning_threshold'][0] .= '<span class="font_11" id="caption_minmax_warning">('.__('Min / Max').')</span>';
$tableBasicThresholds->data['warning_threshold'][0] .= html_print_input_text(
'min_warning',
$min_warning,
'',
10,
255,
true,
$disabledBecauseInPolicy || $edit === true,
false,
'',
$classdisabledBecauseInPolicy
);
$tableBasicThresholds->data['warning_threshold'][1] .= html_print_input_text(
'max_warning',
$max_warning,
'',
10,
255,
true,
$disabledBecauseInPolicy || $edit === true,
false,
'',
$classdisabledBecauseInPolicy
).'</span>';
$tableBasicThresholds->data['switch_warning_threshold'][0] .= html_print_switch_radio_button(
[
html_print_radio_button_extended('warning_thresholds_checks', 'normal_warning', __('Normal'), ($percentage_warning && $warning_inverse) === false, false, '', '', true, false, '', 'radius-normal_warning'),
html_print_radio_button_extended('warning_thresholds_checks', 'warning_inverse', __('Inverse interval'), $warning_inverse, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-warning_inverse'),
html_print_radio_button_extended('warning_thresholds_checks', 'percentage_warning', __('Percentage'), $percentage_warning, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-percentage_warning'),
],
[ 'class' => 'margin-top-10' ],
true
);
}
$tableBasicThresholds->data['switch_warning_threshold'][0] .= html_print_switch_radio_button(
[
html_print_radio_button_extended('warning_thresholds_checks', 'normal_warning', __('Normal'), ($percentage_warning && $warning_inverse) === false, false, '', '', true, false, '', 'radius-normal_warning'),
html_print_radio_button_extended('warning_thresholds_checks', 'warning_inverse', __('Inverse interval'), $warning_inverse, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-warning_inverse'),
html_print_radio_button_extended('warning_thresholds_checks', 'percentage_warning', __('Percentage'), $percentage_warning, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-percentage_warning'),
],
[ 'class' => 'margin-top-10' ],
true
);
if (isset($stringTypeModule) === true && $stringTypeModule === true) {
$basicThresholdsIntervalWarning = [];
$basicThresholdsIntervalWarning[] = '<span>'.__('Inverse interval').'</span>';
$basicThresholdsIntervalWarning[] = html_print_checkbox_switch(
'warning_inverse_string',
1,
$warning_inverse,
true,
$disabledBecauseInPolicy
);
$basicThresholdsIntervalWarning = [];
$basicThresholdsIntervalWarning[] = '<span>'.__('Inverse interval').'</span>';
$basicThresholdsIntervalWarning[] = html_print_checkbox_switch(
'warning_inverse_string',
1,
$warning_inverse,
true,
$disabledBecauseInPolicy
);
$tableBasicThresholds->rowclass['caption_switch_warning_inverse_string'] = 'field_half_width';
$tableBasicThresholds->data['caption_switch_warning_inverse_string'][0] = html_print_div(
[
'class' => 'margin-top-10',
'style' => 'display: flex; flex-direction: row-reverse; align-items: center;',
'content' => implode('', $basicThresholdsIntervalWarning),
],
true
);
$tableBasicThresholds->rowclass['caption_switch_warning_inverse_string'] = 'field_half_width';
$tableBasicThresholds->data['caption_switch_warning_inverse_string'][0] = html_print_div(
[
'class' => 'margin-top-10',
'style' => 'display: flex; flex-direction: row-reverse; align-items: center;',
'content' => implode('', $basicThresholdsIntervalWarning),
],
true
);
$tableBasicThresholds->data['caption_warning_threshold'][0] .= '<span class="font_11" id="caption_str_warning">('.__('Str.').')</span>';
$tableBasicThresholds->data['warning_threshold'][0] .= html_print_input_text(
'str_warning',
str_replace('"', '', $str_warning),
'',
10,
1024,
true,
$disabledBecauseInPolicy || $edit === false,
false,
'',
$classdisabledBecauseInPolicy
).'</span>';
}
$tableBasicThresholds->data['caption_warning_threshold'][0] .= '<span class="font_11" id="caption_str_warning">('.__('Str.').')</span>';
$tableBasicThresholds->data['warning_threshold'][0] .= html_print_input_text(
'str_warning',
str_replace('"', '', $str_warning),
'',
10,
1024,
true,
$disabledBecauseInPolicy || $edit === false,
false,
'',
$classdisabledBecauseInPolicy
).'</span>';
$tableBasicThresholds->data['switch_warning_threshold'][0] .= html_print_div(
@ -532,87 +528,84 @@ $tableBasicThresholds->data['switch_warning_threshold'][0] .= html_print_div(
$tableBasicThresholds->rowclass['caption_critical_threshold'] = 'field_half_width pdd_t_10px';
$tableBasicThresholds->rowclass['critical_threshold'] = 'field_half_width';
$tableBasicThresholds->data['caption_critical_threshold'][0] .= __('Critical threshold').'&nbsp;';
if ((isset($stringTypeModule) === false || $stringTypeModule === false)) {
$tableBasicThresholds->data['caption_critical_threshold'][0] .= '<span class="font_11" id="caption_minmax_critical">('.__('Min / Max').')</span>';
$tableBasicThresholds->data['critical_threshold'][0] .= html_print_input_text(
'min_critical',
$min_critical,
'',
10,
255,
true,
$disabledBecauseInPolicy || $edit === false,
false,
'',
$classdisabledBecauseInPolicy
);
$tableBasicThresholds->data['critical_threshold'][1] .= html_print_input_text(
'max_critical',
$max_critical,
'',
10,
255,
true,
$disabledBecauseInPolicy || $edit === false,
false,
'',
$classdisabledBecauseInPolicy
).'</span>';
$tableBasicThresholds->data['caption_critical_threshold'][0] .= '<span class="font_11" id="caption_minmax_critical">('.__('Min / Max').')</span>';
$tableBasicThresholds->data['critical_threshold'][0] .= html_print_input_text(
'min_critical',
$min_critical,
'',
10,
255,
true,
$disabledBecauseInPolicy || $edit === false,
false,
'',
$classdisabledBecauseInPolicy
);
$tableBasicThresholds->data['critical_threshold'][1] .= html_print_input_text(
'max_critical',
$max_critical,
'',
10,
255,
true,
$disabledBecauseInPolicy || $edit === false,
false,
'',
$classdisabledBecauseInPolicy
).'</span>';
$tableBasicThresholds->data['switch_critical_threshold'][0] .= html_print_switch_radio_button(
[
html_print_radio_button_extended('critical_thresholds_checks', 'normal_critical', __('Normal'), ($percentage_critical && $critical_inverse) === false, false, '', '', true, false, '', 'radius-normal_critical'),
html_print_radio_button_extended('critical_thresholds_checks', 'critical_inverse', __('Inverse interval'), $critical_inverse, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-critical_inverse'),
html_print_radio_button_extended('critical_thresholds_checks', 'percentage_critical', __('Percentage'), $percentage_critical, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-percentage_critical'),
],
[ 'class' => 'margin-top-10' ],
true
);
}
$tableBasicThresholds->data['switch_critical_threshold'][0] .= html_print_switch_radio_button(
[
html_print_radio_button_extended('critical_thresholds_checks', 'normal_critical', __('Normal'), ($percentage_critical && $critical_inverse) === false, false, '', '', true, false, '', 'radius-normal_critical'),
html_print_radio_button_extended('critical_thresholds_checks', 'critical_inverse', __('Inverse interval'), $critical_inverse, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-critical_inverse'),
html_print_radio_button_extended('critical_thresholds_checks', 'percentage_critical', __('Percentage'), $percentage_critical, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-percentage_critical'),
],
[ 'class' => 'margin-top-10' ],
true
);
if (isset($stringTypeModule) === true && $stringTypeModule === true) {
$basicThresholdsIntervalCritical = [];
$basicThresholdsIntervalCritical[] = '<span>'.__('Inverse interval').'</span>';
$basicThresholdsIntervalCritical[] = html_print_checkbox_switch(
'critical_inverse_string',
1,
$critical_inverse,
true,
$disabledBecauseInPolicy
);
$tableBasicThresholds->rowclass['caption_switch_critical_inverse_string'] = 'field_half_width';
$tableBasicThresholds->data['caption_switch_critical_inverse_string'][0] = html_print_div(
[
'class' => 'margin-top-10',
'style' => 'display: flex; flex-direction: row-reverse; align-items: center;',
'content' => implode('', $basicThresholdsIntervalCritical),
],
true
);
$basicThresholdsIntervalCritical = [];
$basicThresholdsIntervalCritical[] = '<span>'.__('Inverse interval').'</span>';
$basicThresholdsIntervalCritical[] = html_print_checkbox_switch(
'critical_inverse_string',
1,
$critical_inverse,
true,
$disabledBecauseInPolicy
);
$tableBasicThresholds->data['switch_critical_threshold'][0] .= html_print_div(
[
'id' => 'percentage_critical',
'content' => $divPercentageContent,
],
true
);
$tableBasicThresholds->rowclass['caption_switch_critical_inverse_string'] = 'field_half_width';
$tableBasicThresholds->data['caption_switch_critical_inverse_string'][0] = html_print_div(
[
'class' => 'margin-top-10',
'style' => 'display: flex; flex-direction: row-reverse; align-items: center;',
'content' => implode('', $basicThresholdsIntervalCritical),
],
true
);
$tableBasicThresholds->data['caption_critical_threshold'][0] .= '<span class="font_11" id="caption_str_critical">('.__('Str.').')</span>';
$tableBasicThresholds->data['critical_threshold'][0] .= html_print_input_text(
'str_critical',
str_replace('"', '', $str_critical),
'',
10,
1024,
true,
$disabledBecauseInPolicy,
false,
'',
$classdisabledBecauseInPolicy
);
}
$tableBasicThresholds->data['switch_critical_threshold'][0] .= html_print_div(
[
'id' => 'percentage_critical',
'content' => $divPercentageContent,
],
true
);
$tableBasicThresholds->data['caption_critical_threshold'][0] .= '<span class="font_11" id="caption_str_critical">('.__('Str.').')</span>';
$tableBasicThresholds->data['critical_threshold'][0] .= html_print_input_text(
'str_critical',
str_replace('"', '', $str_critical),
'',
10,
1024,
true,
$disabledBecauseInPolicy,
false,
'',
$classdisabledBecauseInPolicy
);
$table_simple->rowstyle['thresholds_table'] = 'margin-top: 15px;height: 340px;width: 100%';
$table_simple->cellclass['thresholds_table'][0] = 'table_section half_section_left';
@ -1623,6 +1616,11 @@ ui_require_jquery_file('json');
/* <![CDATA[ */
$(document).ready (function () {
var disabledBecauseInPolicy = <?php echo '\''.((empty($disabledBecauseInPolicy) === true) ? '0' : '1').'\''; ?>;
var idModuleType = '<?php echo $type_names_hash[$id_module_type]; ?>';
if (idModuleType != '') {
setModuleType(idModuleType);
}
$("#right").click (function () {
jQuery.each($("select[name='id_tag_available[]'] option:selected"), function (key, value) {
tag_name = $(value).html();

View File

@ -69,7 +69,6 @@ if ($is_management_allowed === true) {
$table->head[4] = '';
}
$table->align[1] = 'center';
if ($is_management_allowed === true) {
$table->align[4] = 'center';
}
@ -100,7 +99,7 @@ $table->data = [];
foreach ($osList as $os) {
$data = [];
$data[] = $os['id_os'];
$data[] = html_print_div(['class' => 'invert_filter main_menu_icon', 'content' => ui_print_os_icon($os['id_os'], false, true)], true);
$data[] = ui_print_os_icon($os['id_os'], false, true);
if ($is_management_allowed === true) {
if (is_metaconsole() === true) {
$osNameUrl = 'index.php?sec=advanced&sec2=advanced/component_management&tab=os_manage&action=edit&tab2=builder&id_os='.$os['id_os'];

View File

@ -6097,6 +6097,8 @@ function html_print_autocomplete_users_from_integria(
$attrs['class'] = $class;
}
ui_print_help_tip(__('Type at least two characters to search the user.'), false);
html_print_input_text_extended(
$name,
$default,
@ -6110,8 +6112,6 @@ function html_print_autocomplete_users_from_integria(
);
html_print_input_hidden($name.'_hidden', $id_agent_module);
ui_print_help_tip(__('Type at least two characters to search the user.'), false);
$javascript_ajax_page = ui_get_full_url('ajax.php', false, false, false, false);
?>
<script type="text/javascript">

View File

@ -31,7 +31,7 @@ require_once $config['homedir'].'/include/functions.php';
* @param string $active_tab Current tab or false for View page.
* @param number $view Id of incident. Show View tab.
*
* @return string HTML code. Print tabs in header.
* @return array HTML code. Print tabs in header.
*/
function integriaims_tabs($active_tab, $view=false)
{

View File

@ -558,6 +558,16 @@ table.filter-table-adv td > div label {
margin-bottom: 10px;
}
div.filter-table-adv-manual > div.inline,
table.filter-table-adv td > div.inline {
display: block;
}
div.filter-table-adv-manual > div.inline input,
table.filter-table-adv td > div.inline input {
margin-top: 10px;
}
table.filter-table-adv td > div.add-input-reverse {
flex-direction: row-reverse;
justify-content: flex-end;

View File

@ -1163,7 +1163,6 @@ foreach ($agents as $agent) {
$data[2] = html_print_div(
[
'class' => 'invert_filter main_menu_icon',
'content' => ui_print_os_icon($agent['id_os'], false, true),
],
true

View File

@ -23,11 +23,30 @@ $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 Ticket'), '', false, '', false, $onheader);
$title_header = __('Update Integria IMS Ticket');
} else {
ui_print_page_header(__('Create Integria IMS Ticket'), '', false, '', false, $onheader);
$title_header = __('Create Integria IMS Ticket');
}
ui_print_standard_header(
$title_header,
'',
false,
'',
false,
$onheader,
[
[
'link' => '',
'label' => __('Issues'),
],
[
'link' => '',
'label' => $title_header,
],
]
);
// Check if Integria integration enabled.
if ($config['integria_enabled'] == 0) {
ui_print_error_message(__('In order to access ticket management system, integration with Integria IMS must be enabled and properly configured'));
@ -166,19 +185,14 @@ if ($update) {
$table = new stdClass();
$table->width = '100%';
$table->id = 'add_alert_table';
$table->class = 'databox filters integria_incidents_options';
$table->class = 'databox filter-table-adv';
$table->head = [];
$table->data = [];
$table->size = [];
$table->size = [];
$table->style[0] = 'width: 33%; padding-right: 50px; padding-left: 100px;';
$table->style[1] = 'width: 33%; padding-right: 50px; padding-left: 50px;';
$table->style[2] = 'width: 33%; padding-right: 100px; padding-left: 50px;';
$table->colspan[0][0] = 2;
$table->colspan[4][0] = 3;
$table->colspan[6][0] = 3;
$help_macros = isset($_GET['from_event']) ? ui_print_help_icon('response_macros', true) : '';
if ($update) {
@ -210,177 +224,205 @@ if ($update) {
$input_value_resolution = 0;
}
$table->data[0][0] = '<div class="label_select"><p class="input_label">'.__('Title').':&nbsp'.$help_macros.'</p>';
$table->data[0][0] .= '<div class="label_select_parent">'.html_print_input_text(
'incident_title',
$input_value_title,
__('Name'),
50,
100,
true,
false,
true,
'',
'w100p'
).'</div>';
$table->data[0][0] = html_print_label_input_block(
__('Title').$help_macros,
html_print_input_text(
'incident_title',
$input_value_title,
__('Name'),
50,
100,
true,
false,
true,
'',
'w100p'
)
);
$integria_logo = 'images/integria_logo_gray.png';
if ($config['style'] === 'pandora_black' && !is_metaconsole()) {
$integria_logo = 'images/integria_logo.svg';
}
$table->data[0][2] = html_print_image($integria_logo, true, ['style' => 'width: 70%; float: right;'], false);
$table->data[0][2] = html_print_image($integria_logo, true, ['style' => 'width: 30%; float: right;'], false);
$table->data[1][0] = '<div class="label_select"><p class="input_label">'.__('Type').': </p>';
$table->data[1][0] .= '<div class="label_select_parent">'.html_print_select(
$integria_types_values,
'type',
$input_value_type,
'',
__('Select'),
0,
true,
false,
true,
'',
false,
'width: 100%;'
).'</div>';
$table->data[1][0] = html_print_label_input_block(
__('Type'),
html_print_select(
$integria_types_values,
'type',
$input_value_type,
'',
__('Select'),
0,
true,
false,
true,
'',
false,
'width: 100%;'
)
);
$table->data[2][0] = '<div class="label_select"><p class="input_label">'.__('Status').': </p>';
$table->data[2][0] .= '<div class="label_select_parent">'.html_print_select(
$integria_status_values,
'status',
$input_value_status,
'',
__('Select'),
1,
true,
false,
true,
'',
false,
'width: 100%;'
).'</div>';
$table->data[1][1] = html_print_label_input_block(
__('Group'),
html_print_select(
$integria_group_values,
'group',
$input_value_group,
'',
'',
0,
true,
false,
true,
'',
false,
'width: 100%;'
)
);
$table->data[1][1] = '<div class="label_select"><p class="input_label">'.__('Group').': </p>';
$table->data[1][1] .= '<div class="label_select_parent">'.html_print_select(
$integria_group_values,
'group',
$input_value_group,
'',
'',
0,
true,
false,
true,
'',
false,
'width: 100%;'
).'</div>';
$table->data[1][2] = html_print_label_input_block(
__('Priority'),
html_print_select(
$integria_criticity_values,
'criticity',
$input_value_criticity,
'',
__('Select'),
0,
true,
false,
true,
'',
false,
'width: 100%;'
)
);
$table->data[2][1] = '<div class="label_select"><p class="input_label">'.__('Creator').': </p>';
$table->data[2][1] .= '<div class="label_select_parent">'.html_print_input_text(
'creator',
$config['integria_user'],
'',
'30',
100,
true,
true,
false,
'',
'w100p'
).ui_print_help_tip(__('This field corresponds to the Integria IMS user specified in Integria IMS setup'), true).'</div>';
$table->data[2][0] = html_print_label_input_block(
__('Status'),
html_print_select(
$integria_status_values,
'status',
$input_value_status,
'',
__('Select'),
1,
true,
false,
true,
'',
false,
'width: 100%;'
)
);
$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',
$input_value_criticity,
'',
__('Select'),
0,
true,
false,
true,
'',
false,
'width: 100%;'
).'</div>';
$table->data[2][1] = html_print_label_input_block(
__('Creator').ui_print_help_tip(__('This field corresponds to the Integria IMS user specified in Integria IMS setup'), true),
html_print_input_text(
'creator',
$config['integria_user'],
'',
'30',
100,
true,
true,
false,
'',
'w100p'
)
);
$table->data[2][2] = '<div class="label_select"><p class="input_label">'.__('Owner').': </p>';
$table->data[2][2] = html_print_label_input_block(
__('Owner'),
html_print_autocomplete_users_from_integria(
'owner',
$input_value_owner,
true,
'30',
false,
false,
'w100p'
),
['div_class' => 'inline']
);
$table->data[2][2] .= '<div class="label_select_parent">'.html_print_autocomplete_users_from_integria(
'owner',
$input_value_owner,
true,
'30',
false,
false,
'w100p'
).'</div>';
$table->data[3][0] = html_print_label_input_block(
__('Resolution'),
html_print_select(
$integria_resolution_values,
'resolution',
$input_value_resolution,
'',
'',
1,
true,
false,
true,
'',
false,
'width: 100%;'
)
);
$table->data[4][0] = html_print_label_input_block(
__('Description').$help_macros,
html_print_textarea(
'incident_content',
3,
20,
$input_value_content,
'',
true
)
);
$table->data[3][0] = '<div class="label_select"><p class="input_label">'.__('Resolution').': </p>';
$table->data[5][0] = html_print_label_input_block(
__('File name'),
html_print_input_file('userfile', true)
);
$table->data[3][0] .= '<div class="label_select_parent">'.html_print_select(
$integria_resolution_values,
'resolution',
$input_value_resolution,
'',
'',
1,
true,
false,
true,
'',
false,
'width: 100%;'
).'</div>';
$table->data[4][0] = '<div class="label_select"><p class="input_label">'.__('Description').':&nbsp'.$help_macros.'</p>';
$table->data[4][0] .= '<div class="label_select_parent">'.html_print_textarea(
'incident_content',
3,
20,
$input_value_content,
'',
true
).'</div>';
$table->data[5][0] = '<div class="label_select"><p class="input_label">'.__('File name').':</p>';
$table->data[5][0] .= html_print_input_file('userfile', true);
$table->data[6][0] = '<div class="label_select"><p class="input_label">'.__('Attachment description').':</p>';
$table->data[6][0] .= html_print_textarea(
'file_description',
3,
20,
'',
'',
true
$table->data[6][0] = html_print_label_input_block(
__('Attachment description'),
html_print_textarea(
'file_description',
3,
20,
'',
'',
true
)
);
// Print forms and stuff.
echo '<form id="create_integria_incident_form" name="create_integria_incident_form" method="POST" enctype="multipart/form-data">';
echo '<form class="max_floating_element_size" id="create_integria_incident_form" name="create_integria_incident_form" method="POST" enctype="multipart/form-data">';
html_print_table($table);
$buttons = '';
if (!$update) {
html_print_input_hidden('create_incident', 1);
$buttons .= html_print_input_hidden('create_incident', 1, true);
$buttons .= html_print_submit_button(
__('Create'),
'accion',
false,
[ 'icon' => 'next' ],
true
);
} else {
html_print_input_hidden('update_incident', 1);
$buttons .= html_print_input_hidden('update_incident', 1, true);
$buttons .= html_print_submit_button(
__('Update'),
'accion',
false,
[ 'icon' => 'upd' ],
true
);
}
html_print_action_buttons($buttons);
echo '</form>';
echo '<div class="w100p right">';
if ($update) {
html_print_submit_button(__('Update'), 'accion', false, 'form="create_integria_incident_form" class="sub wand"');
} else {
html_print_submit_button(__('Create'), 'accion', false, 'form="create_integria_incident_form" class="sub wand"');
}
echo '</div>';
?>
<script type="text/javascript">

View File

@ -50,14 +50,30 @@ $result_api_call_list = integria_api_call(
// Return array of api call 'get_incidents'.
$array_get_incidents = [];
get_array_from_csv_data_all($result_api_call_list, $array_get_incidents);
// Remove index (id)
$array_get_incidents = $array_get_incidents[$incident_id];
// Remove index (id).
$array_get_incidents = $array_get_incidents[$incident_id];
// Header tabs.
$onheader = integriaims_tabs(false, $incident_id);
ui_print_page_header($array_get_incidents[3].' - '.__('Details'), '', false, '', false, $onheader);
ui_print_standard_header(
$array_get_incidents[3],
'',
false,
'',
false,
$onheader,
[
[
'link' => '',
'label' => __('Issues'),
],
[
'link' => '',
'label' => __('Details'),
],
]
);
// Data.
$status = $array_get_incidents[6];
@ -215,7 +231,7 @@ $table_files_section->data[1][0] .= html_print_textarea(
true
);
$table_files_section->data[2][0] .= '<div class="w100p right">'.html_print_submit_button(__('Upload'), 'accion', false, 'class="sub wand"', true).'</div>';
$table_files_section->data[2][0] .= '<div class="w100p right">'.html_print_submit_button(__('Upload'), 'accion', false, ['icon' => 'wand', 'mode' => 'mini secondary'], true).'</div>';
$upload_file_form = '<div class="w100p">';
@ -268,7 +284,7 @@ $table_comments_section->data[0][0] .= html_print_textarea(
true
);
$table_comments_section->data[1][1] .= '<div class="w100p right">'.html_print_submit_button(__('Add'), 'accion', $comment_disabled, 'class="sub wand"', true).'</div>';
$table_comments_section->data[1][1] .= '<div class="w100p right">'.html_print_submit_button(__('Add'), 'accion', $comment_disabled, ['icon' => 'wand', 'mode' => 'mini secondary'], true).'</div>';
// Upload comment. If ticket is closed, this action cannot be performed.
if ($upload_comment && $array_get_incidents[6] != 7) {
@ -399,8 +415,8 @@ ui_toggle(
'',
true,
false,
'white_box white_box_opened',
'no-border flex'
'white-box-content',
'w98p'
);
echo '</div>';
@ -412,15 +428,14 @@ ui_toggle(
'',
true,
false,
'white_box white_box_opened',
'no-border flex'
'white-box-content',
'w98p'
);
echo '</div>';
?>
<script type="text/javascript">
$(document).ready (function () {
$('#details_box .white_table_graph_header').click(function(){
$('div#details_box').toggleClass('integria_details_shadow');
});
@ -432,6 +447,5 @@ $(document).ready (function () {
$('#dates_box .white_table_graph_header').click(function(){
$('div#dates_box').toggleClass('integria_details_shadow');
});
});
</script>

View File

@ -18,13 +18,31 @@ require_once $config['homedir'].'/include/functions_graph.php';
check_login();
ui_print_page_header(__('Incidents').' &raquo; '.__('Statistics'), 'images/book_edit.png', false, '', false, '');
ui_print_standard_header(
__('Statistics'),
'images/book_edit.png',
false,
'',
false,
[],
[
[
'link' => '',
'label' => __('Issues'),
],
[
'link' => '',
'label' => __('Statistics'),
],
]
);
if (!$config['integria_enabled']) {
ui_print_error_message(__('In order to access ticket management system, integration with Integria IMS must be enabled and properly configured'));
exit;
}
echo '<div class="info_box">';
echo '<table width="90%">
<tr><td valign="top" style="width:50%;"><h3>'.__('Incidents by status').'</h3>';
echo graph_incidents_status();
@ -39,3 +57,4 @@ echo '<td style="width:50%;"><h3>'.__('Incidents by user').'</h3>';
echo graphic_incident_user();
echo '</table>';
echo '</div>';

View File

@ -20,13 +20,23 @@ check_login();
// Header tabs.
$onheader = integriaims_tabs('list_tab');
ui_print_page_header(
ui_print_standard_header(
__('Integria IMS Tickets'),
'',
false,
'integria_tab',
false,
$onheader
$onheader,
[
[
'link' => '',
'label' => __('Issues'),
],
[
'link' => '',
'label' => __('Integria IMS Tickets'),
],
]
);
// Check if Integria integration enabled.
@ -308,68 +318,100 @@ $resolution_incident = integriaims_get_details('resolution');
// TABLE FILTERS.
$table = new StdClass();
$table->width = '100%';
$table->class = 'databox filters';
$table->styleTable = 'margin-bottom:0px';
$table->cellpadding = '0';
$table->cellspacing = '0';
$table->size = [];
$table->size[0] = '33%';
$table->size[1] = '33%';
$table->size[2] = '33%';
$table->class = 'filter-table-adv';
$table->data = [];
$table->data[0][0] = __('Text filter');
$table->data[0][1] = html_print_input_text('incident_text', $incident_text, '', 30, 100, true);
$table->data[0][2] = __('Status');
$table->data[0][3] = html_print_select(
$status_incident,
'incident_status',
$incident_status,
'',
__('All'),
0,
true
$table->data[0][0] = html_print_label_input_block(
__('Text filter'),
html_print_input_text('incident_text', $incident_text, '', 30, 100, true)
);
$table->data[0][4] = __('Group');
$table->data[0][5] = html_print_select(
$group_incident,
'incident_group',
$incident_group,
'',
__('All'),
1,
true
$table->data[0][1] = html_print_label_input_block(
__('Status'),
html_print_select(
$status_incident,
'incident_status',
$incident_status,
'',
__('All'),
0,
true
)
);
$table->data[1][0] = __('Owner');
$table->data[1][1] = html_print_autocomplete_users_from_integria('incident_owner', $incident_owner, true);
$table->data[1][2] = __('Creator');
$table->data[1][3] = html_print_autocomplete_users_from_integria('incident_creator', $incident_creator, true);
$table->data[1][4] = __('Priority');
$table->data[1][5] = html_print_select(
$priority_incident,
'incident_priority',
$incident_priority,
'',
__('All'),
-1,
true
$table->data[0][2] = html_print_label_input_block(
__('Group'),
html_print_select(
$group_incident,
'incident_group',
$incident_group,
'',
__('All'),
1,
true
)
);
$table->data[2][0] = __('Resolution');
$table->data[2][1] = html_print_select(
$resolution_incident,
'incident_resolution',
$incident_resolution,
'',
__('All'),
'',
true
$table->data[1][0] = html_print_label_input_block(
__('Owner'),
html_print_autocomplete_users_from_integria(
'incident_owner',
$incident_owner,
true,
'30',
false,
false,
'w100p'
),
['div_class' => 'inline']
);
// TODO: field type date.
$table->data[2][2] = __('Date');
$table->data[2][3] = html_print_input_text_extended(
$table->data[1][1] = html_print_label_input_block(
__('Creator'),
html_print_autocomplete_users_from_integria(
'incident_creator',
$incident_creator,
true,
'30',
false,
false,
'w100p'
),
['div_class' => 'inline']
);
$table->data[1][2] = html_print_label_input_block(
__('Priority'),
html_print_select(
$priority_incident,
'incident_priority',
$incident_priority,
'',
__('All'),
-1,
true
)
);
$table->data[2][0] = html_print_label_input_block(
__('Resolution'),
html_print_select(
$resolution_incident,
'incident_resolution',
$incident_resolution,
'',
__('All'),
'',
true
)
);
$input_date = '<div>';
$input_date .= html_print_input_text_extended(
'created_from',
$created_from,
'created_from',
@ -381,7 +423,7 @@ $table->data[2][3] = html_print_input_text_extended(
'placeholder="'.__('Created from').'"',
true
);
$table->data[2][3] .= html_print_input_text_extended(
$input_date .= html_print_input_text_extended(
'created_to',
$created_to,
'created_to',
@ -393,11 +435,12 @@ $table->data[2][3] .= html_print_input_text_extended(
'class="mrgn_lft_5px" placeholder="'.__('Created to').'"',
true
);
$input_date .= '</div>';
// TODO: image of Integria IMS.
$table->data[2][4] = '';
$table->data[2][5] = '';
$table->data[2][2] = html_print_label_input_block(
__('Date'),
$input_date
);
// Send filters to get_tickets_integriaims().
$tickets_filters = [
@ -423,20 +466,48 @@ $url = ui_get_full_url(
// ---- PRINT TABLE FILTERS ----
$integria_incidents_form = '<form method="post" action="'.$url.'" class="pdd_0px">';
$integria_incidents_form .= html_print_table($table, true);
$integria_incidents_form .= '<div class="w100p right">';
$integria_incidents_form .= '<div class="float-right mrgn_lft_5px">'.html_print_button(
$buttons = html_print_submit_button(
__('Filter'),
'filter_button',
false,
[
'icon' => 'search',
'mode' => 'mini secondary',
],
true
);
$buttons .= html_print_button(
__('Export to CSV'),
'csv_export',
false,
"blockResubmit($(this)); location.href='operation/incidents/integriaims_export_csv.php?tickets_filters=$decode_csv'",
'class="sub next"',
[
'icon' => 'cog',
'mode' => 'mini secondary',
],
true
).'</div>';
$integria_incidents_form .= '<div>'.html_print_submit_button(__('Filter'), 'filter_button', false, 'class="sub filter"', true).'</div>';
$integria_incidents_form .= '</div>';
);
$integria_incidents_form .= html_print_div(
[
'class' => 'action-buttons',
'content' => $buttons,
],
true
);
$integria_incidents_form .= '</form>';
ui_toggle($integria_incidents_form, __('Filter'), '', '', false);
ui_toggle(
$integria_incidents_form,
'<span class="subsection_header_title">'.__('Filters').'</span>',
'filter_form',
'',
true,
false,
'',
'white-box-content',
'box-flat white_table_graph fixed_filter_bar'
);
/*
* Order api call 'get_incidents'.
@ -552,33 +623,52 @@ foreach ($incidents_paginated as $key => $value) {
$table->data[$i][8] .= '<a id="link_delete_incident" href="'.ui_get_full_url('index.php?sec=incident&sec2=operation/incidents/list_integriaims_incidents&delete_incident='.$array_get_incidents[$key][0]).'"
onClick="javascript:if (!confirm(\''.__('Are you sure?').'\')) return false;">';
$table->data[$i][8] .= html_print_image('images/delete.svg', true, ['title' => __('Delete'), 'class' => 'invert_filter']);
$table->data[$i][8] .= html_print_image('images/delete.svg', true, ['title' => __('Delete'), 'class' => 'invert_filter main_menu_icon']);
$table->data[$i][8] .= '</a>';
$i++;
}
$tablePagination = '';
// 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 tickets to show').'.' ]);
} else {
html_print_table($table);
ui_pagination(count($array_get_incidents), $url, $offset, 0, false, 'offset', true, 'pagination-bottom');
$tablePagination = ui_pagination(
count($array_get_incidents),
$url,
$offset,
0,
true,
'offset',
false,
'pagination-bottom'
);
}
// Show button to create incident.
echo '<form method="POST" action="'.ui_get_full_url('index.php?sec=incident&sec2=operation/incidents/configure_integriaims_incident').'">';
echo '<div class="wi100p right">';
html_print_submit_button(__('Create'), 'create_new_incident', false, 'class="sub next"');
echo '</div>';
html_print_action_buttons(
html_print_submit_button(
__('Create'),
'create_new_incident',
false,
[ 'icon' => 'next' ],
true
),
[
'type' => 'data_table',
'class' => 'fixed_action_buttons',
'right_content' => $tablePagination,
]
);
echo '</form>';
// Datapicker library for show calendar.
ui_require_jquery_file('ui.datepicker-'.get_user_language(), 'include/javascript/i18n/');
?>
<script language="javascript" type="text/javascript">
$(document).ready( function() {
$("#created_from, #created_to").datepicker({