From 68e1e72b4673039bdbc6c36a4296ddd7856481cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Gonz=C3=A1lez?= Date: Fri, 23 Apr 2021 13:43:16 +0200 Subject: [PATCH] Controlled if Integria IMS is selected for show Create workunit switch --- .../godmode/alerts/configure_alert_action.php | 33 +++++++++++++++---- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/pandora_console/godmode/alerts/configure_alert_action.php b/pandora_console/godmode/alerts/configure_alert_action.php index bf0dbff521..459b12d1ac 100644 --- a/pandora_console/godmode/alerts/configure_alert_action.php +++ b/pandora_console/godmode/alerts/configure_alert_action.php @@ -91,6 +91,7 @@ if ($al_action !== false) { true ); } + $is_in_group = true; } @@ -177,7 +178,7 @@ $table->data[0][1] = html_print_input_text( '', '', '', - $is_central_policies_on_node | $disabled + ($is_central_policies_on_node | $disabled) ); if (io_safe_output($name) == 'Monitoring Event') { @@ -213,7 +214,7 @@ $table->data[1][1] = '
'.html_print_select_groups( false, true, '', - $is_central_policies_on_node | $disabled + ($is_central_policies_on_node | $disabled) ).'
'; $table->colspan[1][1] = 2; @@ -247,7 +248,7 @@ $table->data[2][1] = html_print_select_from_sql( true, false, false, - $is_central_policies_on_node | $disabled + ($is_central_policies_on_node | $disabled) ); $table->data[2][1] .= ' '; if ($is_central_policies_on_node === false @@ -274,7 +275,7 @@ $table->data[3][1] = html_print_extended_select_for_time( false, true, '', - $is_central_policies_on_node | $disabled, + ($is_central_policies_on_node | $disabled), false, '', false, @@ -306,11 +307,21 @@ $table->data[5][2] = html_print_textarea( true ); -$table->data[6][0] = __('Create workunit on recovery').ui_print_help_tip( +// Selector will work only with Integria activated. +$integriaIdName = 'integria_wu'; +$table->data[$integriaIdName][0] = __('Create workunit on recovery').ui_print_help_tip( __('If closed status is set on recovery, a workunit will be added to the ticket in Integria IMS rather that closing the ticket.'), true ); -$table->data[6][1] = html_print_checkbox_switch_extended('create_wu_integria', 1, $create_wu_integria, false, '', $disabled_attr, true); +$table->data[$integriaIdName][1] = html_print_checkbox_switch_extended( + 'create_wu_integria', + 1, + $create_wu_integria, + false, + '', + $disabled_attr, + true +); for ($i = 1; $i <= $config['max_macro_fields']; $i++) { $table->data['field'.$i][0] = html_print_image( @@ -344,7 +355,7 @@ for ($i = 1; $i <= $config['max_macro_fields']; $i++) { } -echo '
'; +echo ''; $table_html = html_print_table($table, true); echo $table_html; @@ -392,6 +403,7 @@ ui_require_javascript_file('tiny_mce', 'include/javascript/tiny_mce/'); $(document).ready (function () { var original_command; var origicommand_descriptionnal_command; + var integriaWorkUnitName = ""; if () { original_command = "', addslashes(io_safe_output(alerts_get_alert_command_command($id_command)))); ?>"; @@ -593,6 +605,13 @@ $(document).ready (function () { } + // Allow create workunit if Integria IMS Ticket is selected. + if (data['id'] == '14') { + $("#table_macros-"+integriaWorkUnitName).css('display', 'table-row'); + } else { + $("#table_macros-"+integriaWorkUnitName).css('display', 'none'); + } + var max_fields = parseInt(''); // Change the selected group