From ba0e54aebbbff6ef7024322c434e9766a2863004 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Wed, 4 Feb 2015 11:18:34 +0100 Subject: [PATCH] Set a data limit in the forms of massive operations. TICKET: #1700 --- .../massive/massive_add_action_alerts.php | 33 ++++++++++--- .../godmode/massive/massive_add_alerts.php | 17 +++++++ .../godmode/massive/massive_copy_modules.php | 42 ++++++++++++++-- .../godmode/massive/massive_delete_agents.php | 17 +++++++ .../godmode/massive/massive_delete_alerts.php | 18 +++++++ .../massive/massive_delete_modules.php | 17 +++++++ .../godmode/massive/massive_edit_agents.php | 49 ++++++++----------- .../godmode/massive/massive_edit_modules.php | 21 +++++++- .../godmode/massive/massive_operations.php | 43 ++++------------ .../godmode/setup/setup_general.php | 6 +++ pandora_console/include/functions_config.php | 6 +++ 11 files changed, 195 insertions(+), 74 deletions(-) mode change 100644 => 100755 pandora_console/godmode/massive/massive_add_action_alerts.php mode change 100644 => 100755 pandora_console/godmode/massive/massive_add_alerts.php mode change 100644 => 100755 pandora_console/godmode/massive/massive_copy_modules.php mode change 100644 => 100755 pandora_console/godmode/massive/massive_delete_agents.php mode change 100644 => 100755 pandora_console/godmode/massive/massive_delete_alerts.php mode change 100644 => 100755 pandora_console/godmode/massive/massive_delete_modules.php mode change 100644 => 100755 pandora_console/godmode/massive/massive_edit_agents.php mode change 100644 => 100755 pandora_console/godmode/massive/massive_edit_modules.php mode change 100644 => 100755 pandora_console/godmode/massive/massive_operations.php diff --git a/pandora_console/godmode/massive/massive_add_action_alerts.php b/pandora_console/godmode/massive/massive_add_action_alerts.php old mode 100644 new mode 100755 index 4c3715a598..85d32ae932 --- a/pandora_console/godmode/massive/massive_add_action_alerts.php +++ b/pandora_console/godmode/massive/massive_add_action_alerts.php @@ -37,7 +37,7 @@ if (is_ajax ()) { return; } - if(is_array($id_agents) && count($id_agents) == 1 && $id_agents[0] == '') { + if (is_array($id_agents) && count($id_agents) == 1 && $id_agents[0] == '') { $id_agents = false; } @@ -56,7 +56,7 @@ $recursion = get_parameter ('recursion'); $add = (bool) get_parameter_post ('add'); if ($add) { - if(empty($id_agents) || $id_agents[0] == 0) + if (empty($id_agents) || $id_agents[0] == 0) ui_print_result_message (false, '', __('Could not be added').". ".__('No agents selected')); else { $actions = get_parameter ('action'); @@ -76,9 +76,9 @@ if ($add) { $options = array(); - if($fires_min > 0) + if ($fires_min > 0) $options['fires_min'] = $fires_min; - if($fires_max > 0) + if ($fires_max > 0) $options['fires_max'] = $fires_max; if (empty($agent_alerts_id)) { @@ -87,9 +87,9 @@ if ($add) { else { $results = true; foreach ($agent_alerts_id as $agent_alert_id) { - foreach($actions as $action) { + foreach ($actions as $action) { $result = alerts_add_alert_agent_module_action($agent_alert_id, $action, $options); - if($result === false) + if ($result === false) $results = false; } } @@ -169,14 +169,14 @@ html_print_table ($table); $sql = 'SELECT id_agente FROM tagente_modulo WHERE id_agente_modulo IN (SELECT id_agent_module FROM talert_template_modules)'; $agents_with_templates = db_get_all_rows_sql($sql); $agents_with_templates_json = array(); -foreach($agents_with_templates as $ag) { +foreach ($agents_with_templates as $ag) { $agents_with_templates_json[] = $ag['id_agente']; } $agents_with_templates_json = json_encode($agents_with_templates_json); echo ""; -echo '
'; +echo '
'; html_print_input_hidden ('add', 1); html_print_submit_button (__('Add'), 'go', false, 'class="sub add"'); echo '
'; @@ -189,7 +189,24 @@ ui_require_jquery_file ('pandora.controls'); ?> diff --git a/pandora_console/godmode/massive/massive_edit_agents.php b/pandora_console/godmode/massive/massive_edit_agents.php old mode 100644 new mode 100755 index f66260edf7..fa7c302c87 --- a/pandora_console/godmode/massive/massive_edit_agents.php +++ b/pandora_console/godmode/massive/massive_edit_agents.php @@ -404,8 +404,7 @@ foreach ($fields as $field) { $custom_value = ''; } - $data[1] = html_print_textarea ('customvalue_' . $field['id_field'], - 2, 65, $custom_value, 'style="min-height: 30px;"', true); + $data[1] = html_print_textarea ('customvalue_'.$field['id_field'], 2, 65, $custom_value, 'style="min-height: 30px;"', true); array_push ($table->data, $data); } @@ -434,14 +433,30 @@ ui_require_jquery_file ('pandora.controls'); ui_require_jquery_file ('pandora.controls'); ui_require_jquery_file ('ajaxqueue'); ui_require_jquery_file ('bgiframe'); - -ui_require_javascript_file('tiny_mce', 'include/javascript/tiny_mce/'); ?> diff --git a/pandora_console/godmode/massive/massive_edit_modules.php b/pandora_console/godmode/massive/massive_edit_modules.php old mode 100644 new mode 100755 index 7e75bc1f00..8a4d05b603 --- a/pandora_console/godmode/massive/massive_edit_modules.php +++ b/pandora_console/godmode/massive/massive_edit_modules.php @@ -524,7 +524,9 @@ $table->data['edit11'][3] = html_print_input_text( ui_print_help_tip ( __('Seconds that agent will wait for the execution of the module.'), true); -echo '
'; +echo ''; html_print_table ($table); echo '
'; @@ -551,7 +553,24 @@ else {