diff --git a/pandora_console/godmode/massive/massive_copy_modules.php b/pandora_console/godmode/massive/massive_copy_modules.php index 5d069a8e9b..25edb3bb39 100755 --- a/pandora_console/godmode/massive/massive_copy_modules.php +++ b/pandora_console/godmode/massive/massive_copy_modules.php @@ -86,31 +86,39 @@ if ($do_operation) { $groups = users_get_groups(); $table = new stdClass(); -$table->class = 'databox filters'; -$table->width = '100%'; -$table->data = []; -$table->style = []; -$table->style[0] = 'font-weight: bold;'; -$table->style[2] = 'font-weight: bold'; -$table->style[4] = 'font-weight: bold'; -$table->style[6] = 'font-weight: bold'; - -// Source selection $table->id = 'source_table'; -$table->data[0][0] = __('Group'); -$table->data[0][1] = html_print_select_groups( - false, - 'AW', - true, - 'source_id_group', - $source_id_group, - false, - '', - '', - true +$table->class = 'databox filters filter-table-adv'; +$table->width = '100%'; +$table->size[0] = '50%'; +$table->size[1] = '50%'; +$table->data = []; + +// Source selection. +$table->data[0][0] = html_print_label_input_block( + __('Group'), + html_print_select_groups( + false, + 'AW', + true, + 'source_id_group', + $source_id_group, + false, + '', + '', + true, + false, + false, + 'w100p', + false, + 'width:100%' + ) ); -$table->data[0][2] = __('Group recursion'); -$table->data[0][3] = html_print_checkbox('source_recursion', 1, $source_recursion, true, false); + +$table->data[0][1] = html_print_label_input_block( + __('Group recursion'), + html_print_checkbox('source_recursion', 1, $source_recursion, true, false) +); + $status_list = []; $status_list[AGENT_STATUS_NORMAL] = __('Normal'); $status_list[AGENT_STATUS_WARNING] = __('Warning'); @@ -118,37 +126,52 @@ $status_list[AGENT_STATUS_CRITICAL] = __('Critical'); $status_list[AGENT_STATUS_UNKNOWN] = __('Unknown'); $status_list[AGENT_STATUS_NOT_NORMAL] = __('Not normal'); $status_list[AGENT_STATUS_NOT_INIT] = __('Not init'); -$table->data[0][4] = __('Status'); -$table->data[0][5] = html_print_select( - $status_list, - 'status_agents_source', - 'selected', - '', - __('All'), - AGENT_STATUS_ALL, - true + +$table->data[1][0] = html_print_label_input_block( + __('Status'), + html_print_select( + $status_list, + 'status_agents_source', + 'selected', + '', + __('All'), + AGENT_STATUS_ALL, + true, + false, + true, + 'w100p' + ) ); -$table->data[0][6] = __('Agent'); -$table->data[0][6] .= ' '; -// $table->data[0][7] = html_print_select (agents_get_group_agents ($source_id_group, false, "none"), -// 'source_id_agent', $source_id_agent, false, __('Select'), 0, true); + $agents = ( $source_id_group ? agents_get_group_agents($source_id_group, false, 'none') : agents_get_group_agents(array_keys(users_get_groups($config['id_user'], 'AW', false))) ); -$table->data[0][7] = html_print_select($agents, 'source_id_agent', $source_id_agent, false, __('Select'), 0, true); - -echo '
'; +$table->data[1][1] = html_print_label_input_block( + __('Agent').' ', + html_print_select( + $agents, + 'source_id_agent', + $source_id_agent, + false, + __('Select'), + 0, + true + ) +); +echo ''; echo '
'; -echo ''; -echo ''.__('Source'); -echo ''; +echo ''.__('Source').''; html_print_table($table); echo '
'; -// Target selection + +unset($table); +// Target selection. +$table = new stdClass(); $table->id = 'target_table'; -$table->class = 'databox filters'; +$table->class = 'databox filters filter-table-adv'; +$table->width = '100%'; +$table->size[0] = '50%'; +$table->size[1] = '50%'; $table->data = []; $modules = []; @@ -169,66 +192,61 @@ foreach ($agent_alerts as $alert) { } $tags = tags_get_user_tags(); -$table->data['tags'][0] = __('Tags'); -$table->data['tags'][1] = html_print_select( - $tags, - 'tags[]', - $tags_name, - false, - __('Any'), - -1, - true, - true, - true +$table->colspan[0][0] = 2; +$table->data[0][0] = html_print_label_input_block( + __('Tags'), + html_print_select( + $tags, + 'tags[]', + $tags_name, + false, + __('Any'), + -1, + true, + true, + true + ) ); -$table->data['operations'][0] = __('Operations'); -$table->data['operations'][1] = ''; -$table->data['operations'][1] .= html_print_checkbox('copy_modules', 1, true, true); -$table->data['operations'][1] .= html_print_label(__('Copy modules'), 'checkbox-copy_modules', true); -$table->data['operations'][1] .= '
'; - -$table->data['operations'][1] .= ''; -$table->data['operations'][1] .= html_print_checkbox('copy_alerts', 1, true, true); -$table->data['operations'][1] .= html_print_label(__('Copy alerts'), 'checkbox-copy_alerts', true); -$table->data['operations'][1] .= ''; - -$table->data['form_modules_filter'][0] = __('Filter Modules'); -$table->data['form_modules_filter'][1] = html_print_input_text('filter_modules', '', '', 20, 255, true); - -$table->data[1][0] = __('Modules'); -$table->data[1][1] = ''; -$table->data[1][1] .= html_print_select( - $modules, - 'target_modules[]', - 0, - false, - '', - '', - true, - true +$table->data[1][0] = html_print_label_input_block( + __('Operations'), + ''.html_print_checkbox('copy_modules', 1, true, true).html_print_label(__('Copy modules'), 'checkbox-copy_modules', true).''.html_print_checkbox('copy_alerts', 1, true, true).html_print_label(__('Copy alerts'), 'checkbox-copy_alerts', true).'' ); -$table->data[1][1] .= ''; -$table->data[1][1] .= ''; -$table->data[1][1] .= ''.__('No modules for this agent').''; -$table->data[1][1] .= ''; -$table->data[2][0] = __('Alerts'); -$table->data[2][1] = ''; -$table->data[2][1] .= html_print_select( - $alerts, - 'target_alerts[]', - 0, - false, - '', - '', - true, - true +$table->data[1][1] = html_print_label_input_block( + __('Filter Modules'), + html_print_input_text('filter_modules', '', '', 20, 255, true) +); + +$table->colspan[2][0] = 2; +$table->data[2][0] = html_print_label_input_block( + __('Modules'), + ''.html_print_select( + $modules, + 'target_modules[]', + 0, + false, + '', + '', + true, + true + ).''.__('No modules for this agent').'' +); + +$table->colspan[3][0] = 2; +$table->data[3][0] = html_print_label_input_block( + __('Alerts'), + ''.html_print_select( + $alerts, + 'target_alerts[]', + 0, + false, + '', + '', + true, + true + ).''.__('No alerts for this agent').'' ); -$table->data[2][1] .= ''; -$table->data[2][1] .= ''; -$table->data[2][1] .= ''.__('No alerts for this agent').''; -$table->data[2][1] .= ''; echo '