From 665976e011fdbbbfb90d6b34949f49abae73f183 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Mon, 27 Mar 2023 11:10:51 +0200 Subject: [PATCH] Bulks masive visual action buttons --- .../massive/massive_add_action_alerts.php | 2 +- .../godmode/massive/massive_add_alerts.php | 2 +- .../godmode/massive/massive_add_profiles.php | 2 +- .../godmode/massive/massive_copy_modules.php | 2 +- .../massive/massive_delete_action_alerts.php | 2 +- .../godmode/massive/massive_delete_agents.php | 2 +- .../godmode/massive/massive_delete_alerts.php | 2 +- .../massive/massive_delete_modules.php | 2 +- .../massive/massive_delete_profiles.php | 2 +- .../godmode/massive/massive_edit_agents.php | 2 +- .../godmode/massive/massive_edit_modules.php | 2 +- .../godmode/massive/massive_edit_plugins.php | 2 +- .../godmode/massive/massive_edit_users.php | 2 +- .../godmode/massive/massive_operations.php | 25 ++++++++--------- pandora_console/godmode/setup/gis_step_2.php | 28 ++++++++++++++++--- .../include/functions_massive_operations.php | 5 ++-- pandora_console/include/functions_menu.php | 4 +++ 17 files changed, 55 insertions(+), 33 deletions(-) diff --git a/pandora_console/godmode/massive/massive_add_action_alerts.php b/pandora_console/godmode/massive/massive_add_action_alerts.php index fcc9957bdb..4b6c333468 100755 --- a/pandora_console/godmode/massive/massive_add_action_alerts.php +++ b/pandora_console/godmode/massive/massive_add_action_alerts.php @@ -270,7 +270,7 @@ $agents_with_templates_json = json_encode($agents_with_templates_json); echo ""; -attachActionButton('add', 'create', $table->width); +attachActionButton('add', 'create', $table->width, false, $SelectAction); echo ''; diff --git a/pandora_console/godmode/massive/massive_add_alerts.php b/pandora_console/godmode/massive/massive_add_alerts.php index 92027c3529..8fbb307e97 100755 --- a/pandora_console/godmode/massive/massive_add_alerts.php +++ b/pandora_console/godmode/massive/massive_add_alerts.php @@ -293,7 +293,7 @@ $table->data[2][3] = ''; echo '
'; html_print_table($table); -attachActionButton('add', 'add', $table->width); +attachActionButton('add', 'add', $table->width, false, $SelectAction); echo '
'; diff --git a/pandora_console/godmode/massive/massive_add_profiles.php b/pandora_console/godmode/massive/massive_add_profiles.php index 9e84c44b71..38657bdf1c 100644 --- a/pandora_console/godmode/massive/massive_add_profiles.php +++ b/pandora_console/godmode/massive/massive_add_profiles.php @@ -295,7 +295,7 @@ array_push($table->data, $data); html_print_table($table); -attachActionButton('create_profiles', 'update', $table->width); +attachActionButton('create_profiles', 'update', $table->width, false, $SelectAction); echo ''; diff --git a/pandora_console/godmode/massive/massive_copy_modules.php b/pandora_console/godmode/massive/massive_copy_modules.php index 4bccfa6007..c3a65ad624 100755 --- a/pandora_console/godmode/massive/massive_copy_modules.php +++ b/pandora_console/godmode/massive/massive_copy_modules.php @@ -310,7 +310,7 @@ echo ''.__('To agent(s)').''; html_print_table($table); echo ''; -attachActionButton('do_operation', 'copy', $table->width); +attachActionButton('do_operation', 'copy', $table->width, false, $SelectAction); echo ''; diff --git a/pandora_console/godmode/massive/massive_delete_action_alerts.php b/pandora_console/godmode/massive/massive_delete_action_alerts.php index c19823fc57..1df2809c75 100644 --- a/pandora_console/godmode/massive/massive_delete_action_alerts.php +++ b/pandora_console/godmode/massive/massive_delete_action_alerts.php @@ -298,7 +298,7 @@ $agents_with_templates_json = json_encode($agents_with_templates_json); echo ""; -attachActionButton('delete', 'delete', $table->width); +attachActionButton('delete', 'delete', $table->width, false, $SelectAction); echo ''; diff --git a/pandora_console/godmode/massive/massive_delete_agents.php b/pandora_console/godmode/massive/massive_delete_agents.php index bb0dd1799d..f5b194f3cc 100755 --- a/pandora_console/godmode/massive/massive_delete_agents.php +++ b/pandora_console/godmode/massive/massive_delete_agents.php @@ -188,7 +188,7 @@ $params = [ echo get_table_inputs_masive_agents($params); if (is_metaconsole() === true || is_management_allowed() === true) { - attachActionButton('delete', 'delete', '100%'); + attachActionButton('delete', 'delete', '100%', false, $SelectAction); } echo ''; diff --git a/pandora_console/godmode/massive/massive_delete_alerts.php b/pandora_console/godmode/massive/massive_delete_alerts.php index 7e899e7f9f..1c4117828e 100755 --- a/pandora_console/godmode/massive/massive_delete_alerts.php +++ b/pandora_console/godmode/massive/massive_delete_alerts.php @@ -358,7 +358,7 @@ $table->data[2][3] = html_print_select([], 'module[]', '', false, '', '', true, echo '
'; html_print_table($table); -attachActionButton('delete', 'delete', $table->width); +attachActionButton('delete', 'delete', $table->width, false, $SelectAction); echo '
'; diff --git a/pandora_console/godmode/massive/massive_delete_modules.php b/pandora_console/godmode/massive/massive_delete_modules.php index f54a127b19..cb885e7ec2 100755 --- a/pandora_console/godmode/massive/massive_delete_modules.php +++ b/pandora_console/godmode/massive/massive_delete_modules.php @@ -583,7 +583,7 @@ $table->data['form_agents_3'][3] = html_print_select( echo '
'; html_print_table($table); -attachActionButton('delete', 'delete', $table->width); +attachActionButton('delete', 'delete', $table->width, false, $SelectAction); echo '
'; diff --git a/pandora_console/godmode/massive/massive_delete_profiles.php b/pandora_console/godmode/massive/massive_delete_profiles.php index 7c45b2a285..46824e90ba 100644 --- a/pandora_console/godmode/massive/massive_delete_profiles.php +++ b/pandora_console/godmode/massive/massive_delete_profiles.php @@ -246,7 +246,7 @@ array_push($table->data, $data); html_print_table($table); -attachActionButton('delete_profiles', 'delete', $table->width); +attachActionButton('delete_profiles', 'delete', $table->width, false, $SelectAction); echo ''; diff --git a/pandora_console/godmode/massive/massive_edit_agents.php b/pandora_console/godmode/massive/massive_edit_agents.php index b5da8ca9ae..a6bb7a9322 100755 --- a/pandora_console/godmode/massive/massive_edit_agents.php +++ b/pandora_console/godmode/massive/massive_edit_agents.php @@ -1257,7 +1257,7 @@ echo ''; html_print_input_hidden('id_agente', $id_agente); -attachActionButton('update_agents', 'update', $table->width); +attachActionButton('update_agents', 'update', $table->width, false, $SelectAction); // Shown and hide div. echo ''; diff --git a/pandora_console/godmode/massive/massive_edit_modules.php b/pandora_console/godmode/massive/massive_edit_modules.php index a03e278957..2aa4fe00e0 100755 --- a/pandora_console/godmode/massive/massive_edit_modules.php +++ b/pandora_console/godmode/massive/massive_edit_modules.php @@ -1265,7 +1265,7 @@ $table->data['edit1'][1] = ''; echo ''; html_print_table($table); - attachActionButton('update', 'update', $table->width); + attachActionButton('update', 'update', $table->width, false, $SelectAction); echo ''; diff --git a/pandora_console/godmode/massive/massive_edit_plugins.php b/pandora_console/godmode/massive/massive_edit_plugins.php index 2e91eafaf8..192c893f00 100644 --- a/pandora_console/godmode/massive/massive_edit_plugins.php +++ b/pandora_console/godmode/massive/massive_edit_plugins.php @@ -391,7 +391,7 @@ echo 'width); +attachActionButton('update', 'update', $table->width, false, $SelectAction); echo ''; diff --git a/pandora_console/godmode/massive/massive_edit_users.php b/pandora_console/godmode/massive/massive_edit_users.php index ddbd45c440..928b761694 100644 --- a/pandora_console/godmode/massive/massive_edit_users.php +++ b/pandora_console/godmode/massive/massive_edit_users.php @@ -556,7 +556,7 @@ echo sprintf( ); echo ''; -attachActionButton('edit_users', 'update', '100%'); +attachActionButton('edit_users', 'update', '100%', false, $SelectAction); echo ''; diff --git a/pandora_console/godmode/massive/massive_operations.php b/pandora_console/godmode/massive/massive_operations.php index 864382bd78..fb2331a5dd 100755 --- a/pandora_console/godmode/massive/massive_operations.php +++ b/pandora_console/godmode/massive/massive_operations.php @@ -443,29 +443,26 @@ if (is_management_allowed() === false) { ); } -echo '
'; -echo ''; -echo '
'; -echo __('Action'); -echo ''; -html_print_select( +$tip = ''; +if ($option === 'edit_agents' || $option === 'edit_modules') { + $tip = ui_print_help_tip(__('The blank fields will not be updated'), true); +} + +$SelectAction = ''; +$SelectAction .= ''._('Action').''; +$SelectAction .= html_print_select( $options, 'option', $option, 'this.form.submit()', '', 0, - false, + true, false, false -); -if ($option === 'edit_agents' || $option === 'edit_modules') { - ui_print_help_tip(__('The blank fields will not be updated')); -} +).$tip; -echo '
'; -echo ''; -echo '
'; +$SelectAction .= ''; switch ($option) { case 'delete_alerts': diff --git a/pandora_console/godmode/setup/gis_step_2.php b/pandora_console/godmode/setup/gis_step_2.php index 486ec90265..26d5c16f68 100644 --- a/pandora_console/godmode/setup/gis_step_2.php +++ b/pandora_console/godmode/setup/gis_step_2.php @@ -50,13 +50,23 @@ echo '