diff --git a/pandora_console/extensions/agents_modules.php b/pandora_console/extensions/agents_modules.php index 44d4bc64b6..d3467b846c 100644 --- a/pandora_console/extensions/agents_modules.php +++ b/pandora_console/extensions/agents_modules.php @@ -377,17 +377,17 @@ function mainAgentsModules() $fullscreen['text'] = ''.html_print_image('images/full_screen.png', true, ['title' => __('Full screen mode'), 'class' => 'invert_filter']).''; + &full_agents_id='.$full_agents.'&selection_agent_module='.$selection_a_m.'">'.html_print_image('images/fullscreen@svg.svg', true, ['title' => __('Full screen mode'), 'class' => 'invert_filter']).''; } else if ($full_modules_selected[0] && $full_agents_id[0]) { $full_modules = urlencode(implode(';', $full_modules_selected)); $full_agents = urlencode(implode(';', $full_agents_id)); $fullscreen['text'] = ''.html_print_image('images/full_screen.png', true, ['title' => __('Full screen mode'), 'class' => 'invert_filter']).''; + &full_agents_id='.$full_agents.'&selection_agent_module='.$selection_a_m.'">'.html_print_image('images/fullscreen@svg.svg', true, ['title' => __('Full screen mode'), 'class' => 'invert_filter']).''; } else { $fullscreen['text'] = ''.html_print_image('images/full_screen.png', true, ['title' => __('Full screen mode'), 'class' => 'invert_filter']).''; + offset='.$offset.'&group_id='.$group_id.'&modulegroup='.$modulegroup.'&refresh='.$refr.'&show_type='.$show_type.'">'.html_print_image('images/fullscreen@svg.svg', true, ['title' => __('Full screen mode'), 'class' => 'invert_filter']).''; } } @@ -597,11 +597,11 @@ function mainAgentsModules() echo '
  • '; echo ''; echo html_print_image( - 'images/normal_screen.png', + 'images/exit_fullscreen@svg.svg', true, [ 'title' => __('Back to normal mode'), - 'class' => 'invert_filter', + 'class' => 'main_menu_icon invert_filter', ] ); echo ''; diff --git a/pandora_console/extensions/users_connected.php b/pandora_console/extensions/users_connected.php index 40b17f4903..ad6282c598 100644 --- a/pandora_console/extensions/users_connected.php +++ b/pandora_console/extensions/users_connected.php @@ -1,16 +1,33 @@ '', + 'label' => __('Workspace'), + ], + [ + 'link' => '', + 'label' => __('Users connected'), + ], + ] + ); $check_profile = db_get_row('tusuario_perfil', 'id_usuario', $config['id_user'], 'id_up'); if ($check_profile === false && !users_is_admin()) { diff --git a/pandora_console/godmode/agentes/module_manager_editor.php b/pandora_console/godmode/agentes/module_manager_editor.php index 66d75c98a7..c3d7563ef5 100644 --- a/pandora_console/godmode/agentes/module_manager_editor.php +++ b/pandora_console/godmode/agentes/module_manager_editor.php @@ -802,7 +802,7 @@ if ($id_agent_module) { __('Delete'), 'deleteModule', false, - 'window.location.assign(\'index.php?sec=gagente&tab=module&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'&delete_module='.$id_agent_module.')', + 'window.location.assign("index.php?sec=gagente&tab=module&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'&delete_module='.$id_agent_module.'")', [ 'icon' => 'delete', 'mode' => 'secondary', diff --git a/pandora_console/godmode/agentes/module_manager_editor_network.php b/pandora_console/godmode/agentes/module_manager_editor_network.php index 6e0af65f83..be63ddfeef 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_network.php +++ b/pandora_console/godmode/agentes/module_manager_editor_network.php @@ -524,7 +524,7 @@ $data[0] .= html_print_button( __('Manage credentials'), 'manage_credentials_button', false, - 'window.location.assign(\'index.php?sec=gmodules&sec2=godmode/groups/group_list&tab=credbox\')', + 'window.location.assign("index.php?sec=gmodules&sec2=godmode/groups/group_list&tab=credbox")', [ 'mode' => 'link' ], true ); diff --git a/pandora_console/godmode/alerts/alert_commands.php b/pandora_console/godmode/alerts/alert_commands.php index 610c503cdc..5369864105 100644 --- a/pandora_console/godmode/alerts/alert_commands.php +++ b/pandora_console/godmode/alerts/alert_commands.php @@ -171,7 +171,7 @@ if (is_ajax()) { $ffield = $editor_type_chkbx; $ffield .= html_print_textarea( 'field'.$i.'_value', - 1, + 5, 1, '', 'class="fields"', @@ -208,7 +208,7 @@ if (is_ajax()) { $rfield = $editor_type_chkbx; $rfield .= html_print_textarea( 'field'.$i.'_recovery_value', - 1, + 5, 1, '', 'class="fields_recovery"', @@ -329,7 +329,7 @@ if (is_ajax()) { $ffield .= html_print_textarea( 'field'.$i.'_value[]', - 1, + 5, 1, '', 'style="min-height:40px; '.$style.'" class="fields"', @@ -341,7 +341,7 @@ if (is_ajax()) { $rfield .= html_print_textarea( 'field'.$i.'_recovery_value[]', - 1, + 5, 1, '', 'style="min-height:40px; '.$style.'" class="fields_recovery', @@ -484,7 +484,7 @@ if (is_ajax()) { } else { $ffield = html_print_textarea( 'field'.$i.'_value', - 1, + 5, 1, $fv[0], 'style="'.$style.'" class="fields min-height-40px"', @@ -494,7 +494,7 @@ if (is_ajax()) { ); $rfield = html_print_textarea( 'field'.$i.'_recovery_value', - 1, + 5, 1, $fv[0], 'style="'.$style.'" class="fields_recovery min-height-40px', @@ -507,7 +507,7 @@ if (is_ajax()) { } else { $ffield = html_print_textarea( 'field'.$i.'_value', - 1, + 5, 1, '', 'style="'.$style.'" class="fields min-height-40px"', @@ -517,7 +517,7 @@ if (is_ajax()) { ); $rfield = html_print_textarea( 'field'.$i.'_recovery_value', - 1, + 5, 1, '', 'style="'.$style.'" class="fields_recovery min-height-40px"', @@ -533,7 +533,7 @@ if (is_ajax()) { $fields_rows[$i] = ''; } else { $fields_rows[$i] = ''; - $fields_rows[$i] .= ''.$fdesc.''; + $fields_rows[$i] .= ''.$fdesc.''; $fields_rows[$i] .= ''.$ffield.''; if ($get_recovery_fields) { $fields_rows[$i] .= ''.$rfield.''; @@ -575,12 +575,19 @@ if ($update_command) { if (defined('METACONSOLE')) { alerts_meta_print_header(); } else { - ui_print_page_header( - __('Alerts').' » '.__('Alert commands'), + ui_print_standard_header( + __('Alerts'), 'images/gm_alerts.png', false, '', - true + true, + [], + [ + [ + 'link' => '', + 'label' => __('Alert commands'), + ], + ] ); } @@ -811,10 +818,9 @@ foreach ($commands as $command) { array_push($table->data, $data); } -ui_pagination($total_commands, $url); if (isset($data) === true && count($table->data) > 0) { html_print_table($table); - ui_pagination($total_commands, $url, 0, 0, false, 'offset', true, 'pagination-bottom'); + $pagination = ui_pagination($total_commands, $url, 0, 0, true, 'offset', false, ''); } else { ui_print_info_message( [ @@ -826,12 +832,17 @@ if (isset($data) === true && count($table->data) > 0) { // Commands can only be created by the super administrator. if (users_is_admin() === true) { - echo '
    '; echo '
    '; - html_print_submit_button(__('Create'), 'create', false, 'class="sub next"'); + $buttonSubmit = html_print_submit_button( + __('Create'), + 'create', + false, + ['icon' => 'wand'], + true + ); html_print_input_hidden('create_alert', 1); + html_print_action_buttons($buttonSubmit, ['right_content' => $pagination]); echo '
    '; - echo '
    '; } ?> diff --git a/pandora_console/godmode/alerts/configure_alert_action.php b/pandora_console/godmode/alerts/configure_alert_action.php index eb1d6d32ee..de5d93a082 100644 --- a/pandora_console/godmode/alerts/configure_alert_action.php +++ b/pandora_console/godmode/alerts/configure_alert_action.php @@ -68,12 +68,19 @@ if ($al_action !== false) { if (defined('METACONSOLE')) { alerts_meta_print_header(); } else { - ui_print_page_header( - __('Alerts').' » '.__('Configure alert action'), + ui_print_standard_header( + __('Alerts'), 'images/gm_alerts.png', false, - 'alert_config', - true + '', + true, + [], + [ + [ + 'link' => '', + 'label' => __('Configure alert action'), + ], + ] ); } } else { @@ -81,12 +88,19 @@ if ($al_action !== false) { if (defined('METACONSOLE')) { alerts_meta_print_header(); } else { - ui_print_page_header( - __('Alerts').' » '.__('Configure alert action'), + ui_print_standard_header( + __('Alerts'), 'images/gm_alerts.png', false, - 'alert_config', - true + '', + true, + [], + [ + [ + 'link' => '', + 'label' => __('Configure alert action'), + ], + ] ); } @@ -290,73 +304,99 @@ $table->data[1][1] = html_print_label_input_block( ) ); -$table->data[2][0] = html_print_label_input_block( +$table_macros = new stdClass(); +$table_macros->id = 'table_macros'; +$table_macros->width = '100%'; +$table_macros->class = 'databox filters filter-table-adv'; +$table_macros->style = []; +$table_macros->size = []; +$table_macros->size[0] = '20%'; +$table_macros->size[1] = '40%'; +$table_macros->size[2] = '40%'; +$table_macros->data = []; + +$table_macros->data[0][0] = ''; +$table_macros->data[0][1] = html_print_label_input_block( + __('Triggering'), + '' +); + +$table_macros->data[0][2] = html_print_label_input_block( __('Recovery'), '' ); -$table->data[2][1] = html_print_label_input_block( - __('Recovery'), +$table_macros->data[1][0] = html_print_label_input_block( + __('Command preview'), '' ); -$table->data[5][0] = __('Command preview'); -$table->data[5][1] = html_print_textarea( - 'command_preview', - 5, - 30, +$table_macros->data[1][1] = html_print_label_input_block( '', - 'disabled="disabled"', - true + html_print_textarea( + 'command_preview', + 5, + 30, + '', + 'disabled="disabled"', + true + ) ); -$table->data[5][2] = html_print_textarea( - 'command_recovery_preview', - 5, - 30, + +$table_macros->data[1][2] = html_print_label_input_block( '', - 'disabled="disabled"', - true + html_print_textarea( + 'command_recovery_preview', + 5, + 30, + '', + 'disabled="disabled"', + true + ) ); // 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[$integriaIdName][1] = html_print_checkbox_switch_extended( - 'create_wu_integria', - 1, - $create_wu_integria, - false, - '', - $disabled_attr, - true +$table_macros->colspan[$integriaIdName][0] = 3; +$table_macros->data[$integriaIdName][0] = html_print_label_input_block( + __('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 + ), + 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( + $table_macros->data['field'.$i][0] = html_print_image( 'images/spinner.gif', true ); - $table->data['field'.$i][1] = html_print_image( + $table_macros->data['field'.$i][1] = html_print_image( 'images/spinner.gif', true ); - $table->data['field'.$i][2] = html_print_image( + $table_macros->data['field'.$i][2] = html_print_image( 'images/spinner.gif', true ); // Store the value in a hidden to keep it on first execution - $table->data['field'.$i][1] .= html_print_input_hidden( + $table_macros->data['field'.$i][1] .= html_print_input_hidden( 'field'.$i.'_value', (!empty($action['field'.$i]) || $action['field'.$i] == 0) ? $action['field'.$i] : '', true, '', $disabled_attr ); - $table->data['field'.$i][2] .= html_print_input_hidden( + $table_macros->data['field'.$i][2] .= html_print_input_hidden( 'field'.$i.'_recovery_value', (!empty($action['field'.$i.'_recovery']) || $action['field'.$i] == 0) ? $action['field'.$i.'_recovery'] : '', true, @@ -369,10 +409,12 @@ $offset = (int) get_parameter('offset', 0); echo '
    '; $table_html = html_print_table($table, true); +$table_html_macros = html_print_table($table_macros, true); $backButton = ''; $submitButton = ''; echo $table_html; +echo $table_html_macros; if ($is_management_allowed === true) { if ($id) { html_print_input_hidden('id', $id); diff --git a/pandora_console/godmode/alerts/configure_alert_command.php b/pandora_console/godmode/alerts/configure_alert_command.php index 4316f4a881..1631f2f24e 100644 --- a/pandora_console/godmode/alerts/configure_alert_command.php +++ b/pandora_console/godmode/alerts/configure_alert_command.php @@ -54,12 +54,19 @@ $alert = []; if (is_metaconsole() === true) { alerts_meta_print_header(); } else { - ui_print_page_header( - __('Alerts').' » '.__('Configure alert command'), + ui_print_standard_header( + __('Alerts'), 'images/gm_alerts.png', false, '', - true + true, + [], + [ + [ + 'link' => '', + 'label' => __('Configure alert command'), + ], + ] ); } @@ -199,112 +206,23 @@ if ($is_management_allowed === false) { $table = new stdClass(); $table->width = '100%'; -$table->class = 'databox filters'; - -if (is_metaconsole() === true) { - $table->head[0] = ($id) ? __('Update Command') : __('Create Command'); - $table->head_colspan[0] = 4; - $table->headstyle[0] = 'text-align: center'; -} +$table->class = 'databox filters filter-table-adv'; $table->style = []; -if (is_metaconsole() === false) { - $table->style[0] = 'font-weight: bold'; - $table->style[2] = 'font-weight: bold'; - $table->style[4] = 'font-weight: bold'; -} $table->size = []; -$table->size[0] = '20%'; +$table->size[0] = '45%'; +$table->size[1] = '45%'; +$table->size[2] = '10%'; $table->data = []; -$table->colspan['name'][1] = 3; -$table->data['name'][0] = __('Name'); -$table->data['name'][2] = html_print_input_text( - 'name', - $name, - '', - 35, - 255, - true, - false, - false, - '', - '', - '', - '', - false, - '', - '', - '', - !$is_management_allowed -); - -$table->colspan['command'][1] = 3; -$table->data['command'][0] = __('Command'); -$table->data['command'][1] = html_print_textarea( - 'command', - 8, - 30, - $command, - '', - true, - '', - !$is_management_allowed -); - -$return_all_group = false; - -if (users_can_manage_group_all('LM') === true) { - $return_all_group = true; -} - -$table->colspan['group'][1] = 3; -$table->data['group'][0] = __('Group'); -$table->data['group'][1] = '
    '.html_print_select_groups( - false, - 'LM', - $return_all_group, - 'id_group', - $id_group, - false, - '', - 0, - true, - false, - true, - '', - !$is_management_allowed -).'
    '; - -$table->colspan['description'][1] = 3; -$table->data['description'][0] = __('Description'); -$table->data['description'][1] = html_print_textarea( - 'description', - 10, - 30, - $description, - '', - true, - '', - !$is_management_allowed -); - - -for ($i = 1; $i <= $config['max_macro_fields']; $i++) { - $table->data['field'.$i][0] = sprintf(__('Field %s description'), $i); - - if (empty($fields_descriptions) === false) { - $field_description = $fields_descriptions[($i - 1)]; - } else { - $field_description = ''; - } - - $table->data['field'.$i][1] = html_print_input_text( - 'field'.$i.'_description', - $field_description, +$table->data[0][0] = html_print_label_input_block( + __('Name'), + html_print_input_text( + 'name', + $name, '', - 30, + 35, 255, true, false, @@ -318,12 +236,91 @@ for ($i = 1; $i <= $config['max_macro_fields']; $i++) { '', '', !$is_management_allowed - ); + ) +); - $table->data['field'.$i][2] = sprintf(__('Field %s values'), $i); - $table->data['field'.$i][2] .= ui_print_help_tip( - __('value1,tag1;value2,tag2;value3,tag3'), - true +if (users_can_manage_group_all('LM') === true) { + $return_all_group = true; +} + +$table->data[0][1] = html_print_label_input_block( + __('Group'), + html_print_select_groups( + false, + 'LM', + $return_all_group, + 'id_group', + $id_group, + false, + '', + 0, + true, + false, + true, + '', + !$is_management_allowed + ) +); + +$table->data[1][0] = html_print_label_input_block( + __('Command'), + html_print_textarea( + 'command', + 8, + 30, + $command, + '', + true, + '', + !$is_management_allowed + ) +); + +$return_all_group = false; + + +$table->data[1][1] = html_print_label_input_block( + __('Description'), + html_print_textarea( + 'description', + 8, + 30, + $description, + '', + true, + '', + !$is_management_allowed + ) +); + +for ($i = 1; $i <= $config['max_macro_fields']; $i++) { + if (empty($fields_descriptions) === false) { + $field_description = $fields_descriptions[($i - 1)]; + } else { + $field_description = ''; + } + + $table->data['field'.$i][0] = html_print_label_input_block( + sprintf(__('Field %s description'), $i), + html_print_input_text( + 'field'.$i.'_description', + $field_description, + '', + 30, + 255, + true, + false, + false, + '', + '', + '', + '', + false, + '', + '', + '', + !$is_management_allowed + ) ); if (empty($fields_values) === false) { @@ -338,54 +335,72 @@ for ($i = 1; $i <= $config['max_macro_fields']; $i++) { $selected = false; } - $table->data['field'.$i][3] = html_print_input_text( - 'field'.$i.'_values', - $field_values, - '', - 55, - 1000, - true, - false, - false, - '', - 'field_value', - '', - '', - false, - '', - '', - '', - !$is_management_allowed + $table->data['field'.$i][1] = html_print_label_input_block( + sprintf(__('Field %s values'), $i).ui_print_help_tip( + __('value1,tag1;value2,tag2;value3,tag3'), + true + ), + html_print_input_text( + 'field'.$i.'_values', + $field_values, + '', + 55, + 1000, + true, + false, + false, + '', + 'field_value', + '', + '', + false, + '', + '', + '', + !$is_management_allowed + ) ); - $table->data['field'.$i][4] = __('Hide'); - - $table->data['field'.$i][5] = html_print_checkbox_extended( - 'field'.$i.'_hide', - 1, - $selected, - !$is_management_allowed, - 'cursor: \'pointer\'', - 'class="hide_inputs"', - true + $table->data['field'.$i][2] = html_print_label_input_block( + __('Hide'), + html_print_checkbox_extended( + 'field'.$i.'_hide', + 1, + $selected, + !$is_management_allowed, + 'cursor: \'pointer\'', + 'class="hide_inputs"', + true + ) ); } -echo ''; +echo ''; html_print_table($table); if ($is_management_allowed === true) { - echo '
    '; if ($id) { html_print_input_hidden('id', $id); html_print_input_hidden('update_command', 1); - html_print_submit_button(__('Update'), 'create', false, 'class="sub upd"'); + $buttonSubmit = html_print_submit_button( + __('Update'), + 'create', + false, + ['icon' => 'wand'], + true + ); } else { html_print_input_hidden('create_command', 1); - html_print_submit_button(__('Create'), 'create', false, 'class="sub wand"'); + $buttonSubmit = html_print_submit_button( + __('Create'), + 'create', + false, + ['icon' => 'wand'], + true + ); } - echo '
    '; + html_print_action_buttons($buttonSubmit); } echo '
    '; diff --git a/pandora_console/godmode/groups/group_list.php b/pandora_console/godmode/groups/group_list.php index d598e294c0..95785a0edd 100644 --- a/pandora_console/godmode/groups/group_list.php +++ b/pandora_console/godmode/groups/group_list.php @@ -738,14 +738,7 @@ if ($tab == 'tree') { * Group tree view. */ - echo html_print_image( - 'images/spinner.gif', - true, - [ - 'class' => 'loading_tree', - 'style' => 'display: none;', - ] - ); + ui_print_spinner(__('Loading')); echo "
    "; } else { /* @@ -1042,7 +1035,7 @@ $tab = 'group_edition'; if (typeof treeController.recipient != 'undefined' && treeController.recipient.length > 0) treeController.recipient.empty(); - $(".loading_tree").show(); + showSpinner(); var parameters = {}; parameters['page'] = "include/ajax/tree.ajax"; @@ -1066,7 +1059,7 @@ $tab = 'group_edition'; data: parameters, success: function(data) { if (data.success) { - $(".loading_tree").hide(); + hideSpinner(); treeController.init({ recipient: $("div#tree-controller-recipient"), diff --git a/pandora_console/godmode/modules/manage_inventory_modules.php b/pandora_console/godmode/modules/manage_inventory_modules.php index 5422ae451b..a8faa13a66 100644 --- a/pandora_console/godmode/modules/manage_inventory_modules.php +++ b/pandora_console/godmode/modules/manage_inventory_modules.php @@ -332,14 +332,16 @@ if ($result === false) { if ($management_allowed === true) { // Update module. - $data[4] = ''; - $data[4] .= html_print_image('images/config.png', true, ['border' => '0', 'title' => __('Update'), 'class' => 'invert_filter']).''; + $data[4] = '
    '; + $data[4] .= ''; + $data[4] .= html_print_image('images/edit.svg', true, ['border' => '0', 'title' => __('Update'), 'class' => 'main_menu_icon invert_filter']).''; // Delete module. $data[4] .= ''; - $data[4] .= html_print_image('images/cross.png', true, ['border' => '0', 'title' => __('Delete'), 'class' => 'invert_filter']); + $data[4] .= html_print_image('images/delete.svg', true, ['border' => '0', 'title' => __('Delete'), 'class' => 'main_menu_icon invert_filter']); $data[4] .= '  '; $data[4] .= html_print_checkbox_extended('delete_multiple[]', $row['id_module_inventory'], false, false, '', 'class="check_delete"', true); + $data[4] .= '
    '; } array_push($table->data, $data); @@ -349,22 +351,50 @@ if ($result === false) { html_print_input_hidden('multiple_delete', 1); html_print_table($table); echo ''; - $tablePagination = ui_pagination($total_modules, 'index.php?sec='.$sec.'&sec2=godmode/modules/manage_inventory_modules', $offset, 0, true, 'offset', false); - $actionButtons = []; + echo '
    '; + echo html_print_input_hidden('create_module_inventory', 1); + echo ''; + + $tablePagination = ui_pagination( + $total_modules, + 'index.php?sec='.$sec.'&sec2=godmode/modules/manage_inventory_modules', + $offset, + 0, + true, + 'offset', + false + ); + + $actionButtons = ''; if ($management_allowed === true) { - $actionButtons[] = html_print_submit_button(__('Delete'), 'delete_btn', false, ['icon' => 'delete', 'mode' => 'secondary', 'form' => 'form_delete'], true); - $actionButtons[] = html_print_submit_button(__('Create'), 'crt', false, ['icon' => 'wand', 'form' => 'form_create'], true); + $actionButtons .= html_print_submit_button( + __('Create'), + 'crt', + false, + [ + 'icon' => 'wand', + 'form' => 'form_create', + ], + true + ); - $actionButtons[] = ''; - $actionButtons[] = html_print_input_hidden('create_module_inventory', 1, true); - $actionButtons[] = ''; + $actionButtons .= html_print_submit_button( + __('Delete'), + 'delete_btn', + false, + [ + 'icon' => 'delete', + 'mode' => 'secondary', + 'form' => 'form_delete', + ], + true + ); } - html_print_action_buttons( - implode('', $actionButtons), + $actionButtons, [ 'type' => 'form_action', 'right_content' => $tablePagination, diff --git a/pandora_console/godmode/modules/manage_inventory_modules_form.php b/pandora_console/godmode/modules/manage_inventory_modules_form.php index 65597d7af1..32424b7f39 100644 --- a/pandora_console/godmode/modules/manage_inventory_modules_form.php +++ b/pandora_console/godmode/modules/manage_inventory_modules_form.php @@ -26,22 +26,32 @@ if (! check_acl($config['id_user'], 0, 'PM') && ! check_acl($config['id_user'], // Header -if (defined('METACONSOLE')) { +if (is_metaconsole() === true) { $sec = 'advanced'; enterprise_include_once('meta/include/functions_components_meta.php'); components_meta_print_header(); } else { $sec = 'gmodules'; - ui_print_page_header( - __('Module management').' ยป '.__('Inventory modules'), + ui_print_standard_header( + __('Module management'), 'images/op_inventory.png', false, '', - true + true, + [], + [ + [ + 'link' => '', + 'label' => __('Configuration'), + ], + [ + 'link' => '', + 'label' => __('Inventory modules'), + ], + ] ); } -// Header $is_windows = strtoupper(substr(PHP_OS, 0, 3)) == 'WIN'; if ($is_windows) { ui_print_error_message(__('Not supported in Windows systems')); @@ -95,82 +105,166 @@ if ($id_os == null) { $table = new stdClass(); $table->width = '100%'; -$table->class = 'databox filters'; +$table->class = 'databox filter-table-adv'; $table->style = []; -$table->style[0] = 'font-weight: bold'; +$table->style[0] = 'width: 50%'; +$table->style[1] = 'width: 50%'; $table->data = []; -$table->data[0][0] = ''.__('Name').''; -$table->data[0][1] = html_print_input_text('name', $name, '', 45, 100, true, $disabled); -$table->data[1][0] = ''.__('Description').''; -$table->data[1][1] = html_print_input_text('description', $description, '', 60, 500, true); -$table->data[2][0] = ''.__('OS').''; -$table->data[2][1] = html_print_select_from_sql( - 'SELECT id_os, name FROM tconfig_os ORDER BY name', - 'id_os', - $id_os, - '', - '', - '', - $return = true + +$table->data[0][] = html_print_label_input_block( + __('Name'), + html_print_input_text( + 'name', + $name, + '', + 45, + 100, + true, + $disabled + ) ); -$table->data[3][0] = ''.__('Interpreter').''; -$table->data[3][1] = html_print_input_text('interpreter', $interpreter, '', 25, 100, true); -$table->data[3][1] .= ui_print_help_tip(__('Left blank for the LOCAL inventory modules'), true); +$table->data[0][] = html_print_label_input_block( + __('Description'), + html_print_input_text( + 'description', + $description, + '', + 60, + 500, + true + ) +); -$table->data['block_mode'][0] = ''.__('Block Mode').''; -$table->data['block_mode'][1] = html_print_checkbox('block_mode', 1, $block_mode, true); +$table->data[1][] = html_print_label_input_block( + __('OS'), + html_print_select_from_sql( + 'SELECT id_os, name FROM tconfig_os ORDER BY name', + 'id_os', + $id_os, + '', + '', + '', + $return = true + ) +); -$table->data[4][0] = ''.__('Format').''; -$table->data[4][0] .= ui_print_help_tip(__('separate fields with ').SEPARATOR_COLUMN, true); -$table->data[4][1] = html_print_input_text('format', $data_format, '', 50, 100, true); +$table->data[1][] = html_print_label_input_block( + __('Interpreter'), + html_print_input_text( + 'interpreter', + $interpreter, + '', + 25, + 100, + true + ).ui_print_input_placeholder( + __('Left blank for the LOCAL inventory modules'), + true + ) +); -$table->data[5][0] = ''.__('Script mode').''; -$table->data[5][0] .= ui_print_help_tip(__(''), true); -$table->data[5][1] = __('Use script'); -$table->data[5][1] .= html_print_radio_button( - 'script_mode', - 1, - '', - $script_mode, - true -).'  '; -$table->data[5][1] .= '    '.__('Use inline code'); -$table->data[5][1] .= html_print_radio_button( - 'script_mode', - 2, - '', - $script_mode, - true -).'  '; +$table->data[2][] = html_print_label_input_block( + __('Format'), + html_print_input_text( + 'format', + $data_format, + '', + 50, + 100, + true + ).ui_print_input_placeholder( + __('separate fields with ').SEPARATOR_COLUMN, + true + ) +); -$table->data[6][0] = ''.__('Script path').''; -$table->data[6][1] = html_print_input_text('script_path', $script_path, '', 50, 1000, true); +$table->data[2][] = html_print_label_input_block( + __('Block Mode'), + html_print_checkbox_switch( + 'block_mode', + 1, + $block_mode, + true + ) +); -$table->data[7][0] = ''.__('Code').''; -$table->data[7][0] .= ui_print_help_tip(__("Here is placed the script for the REMOTE inventory modules Local inventory modules don't use this field").SEPARATOR_COLUMN, true); +$radioButtons = []; +$radioButtons[] = html_print_radio_button('script_mode', 1, __('Script mode'), $script_mode, true); +$radioButtons[] = html_print_radio_button('script_mode', 2, __('Use inline code'), $script_mode, true); -$table->data[7][1] = html_print_textarea('code', 25, 80, base64_decode($code), '', true); +$table->data[3][] = html_print_label_input_block( + __('Script mode'), + html_print_div( + [ + 'class' => 'switch_radio_button', + 'content' => implode('', $radioButtons), + ], + true + ) +); -echo 'colspan[4][0] = 2; + +$table->data[4][0] = html_print_label_input_block( + __('Script path'), + html_print_input_text( + 'script_path', + $script_path, + '', + 50, + 1000, + true + ), + ['div_class' => 'script_path_inventory_modules'] +); + +$table->data[4][0] .= html_print_label_input_block( + __('Code'), + html_print_textarea( + 'code', + 25, + 80, + base64_decode($code), + '', + true + ).ui_print_input_placeholder( + __("Here is placed the script for the REMOTE inventory modules Local inventory modules don't use this field").SEPARATOR_COLUMN, + true + ), + ['div_class' => 'code_inventory_modules'] +); + +echo ''; html_print_table($table); if ($id_module_inventory) { html_print_input_hidden('update_module_inventory', 1); html_print_input_hidden('id_module_inventory', $id_module_inventory); + $buttonCaption = __('Update'); + $buttonIcon = 'update'; } else { html_print_input_hidden('create_module_inventory', 1); + $buttonCaption = __('Create'); + $buttonIcon = 'wand'; } -echo '
    '; -if ($id_module_inventory) { - html_print_submit_button(__('Update'), 'submit', false, 'class="sub next"'); -} else { - html_print_submit_button(__('Create'), 'submit', false, 'class="sub upd"'); -} +$actionButtons = ''; +$actionButtons = html_print_submit_button( + $buttonCaption, + 'submit', + false, + ['icon' => $buttonIcon], + true +); +$actionButtons .= html_print_go_back_button( + 'index.php?sec=gmodules&sec2=godmode/modules/manage_inventory_modules', + ['button_class' => ''], + true +); -echo '
    '; +html_print_action_buttons($actionButtons); echo '
    '; ?> @@ -180,21 +274,21 @@ echo ''; var mode = ; if (mode == 1) { - $('#table1-6').show(); - $('#table1-7').hide(); + $('.script_path_inventory_modules').show(); + $('.code_inventory_modules').hide(); } else { - $('#table1-7').show(); - $('#table1-6').hide(); + $('.code_inventory_modules').show(); + $('.script_path_inventory_modules').hide(); } $('input[type=radio][name=script_mode]').change(function() { if (this.value == 1) { - $('#table1-6').show(); - $('#table1-7').hide(); + $('.script_path_inventory_modules').show(); + $('.code_inventory_modules').hide(); } else if (this.value == 2) { - $('#table1-7').show(); - $('#table1-6').hide(); + $('.code_inventory_modules').show(); + $('.script_path_inventory_modules').hide(); } }); }); diff --git a/pandora_console/godmode/modules/manage_network_components.php b/pandora_console/godmode/modules/manage_network_components.php index 44d35d3f06..7ef20ca385 100644 --- a/pandora_console/godmode/modules/manage_network_components.php +++ b/pandora_console/godmode/modules/manage_network_components.php @@ -615,18 +615,6 @@ $url = ui_get_url_refresh( true, false ); -$name_url = 'index.php?sec=templates&sec2=godmode/modules/manage_network_components'; -$table = new stdClass(); -$table->width = '100%'; -$table->class = 'databox filters'; - -$table->style = []; -$table->style[0] = 'font-weight: bold'; -$table->style[2] = 'font-weight: bold'; - -$table->data = []; - -$table->data[0][0] = __('Group'); $component_groups = network_components_get_groups(); @@ -656,54 +644,81 @@ foreach ($component_groups as $component_group_key => $component_group_val) { } } -$table->data[0][1] = html_print_select( - $component_groups, - 'search_id_group', - $search_id_group, +$name_url = 'index.php?sec=templates&sec2=godmode/modules/manage_network_components'; +$table = new stdClass(); +$table->width = '100%'; +$table->class = 'filter-table-adv'; + +$table->style = []; +$table->style[0] = 'font-weight: bold'; +$table->style[2] = 'font-weight: bold'; + +$table->data = []; + +$table->data[0][] = html_print_label_input_block( + __('Group'), + html_print_select( + $component_groups, + 'search_id_group', + $search_id_group, + '', + __('All'), + 0, + true, + false, + false, + '', + false, + 'width: 100%' + ) +); + +$table->data[0][] = html_print_label_input_block( + __('Free Search'), + html_print_input_text( + 'search_string', + $search_string, + '', + 25, + 255, + true + ).ui_print_input_placeholder( + __('Search by name, description, tcp send or tcp rcv, list matches.'), + true + ) +); + +$toggleFilters = '
    '; +$toggleFilters .= html_print_table($table, true); +$toggleFilters .= html_print_div( + [ + 'class' => 'action-buttons-right-forced', + 'content' => html_print_submit_button( + __('Filter'), + 'search', + false, + [ + 'icon' => 'search', + 'mode' => 'mini', + ], + true + ), + ], + true +); +$toggleFilters .= '
    '; + +ui_toggle( + $toggleFilters, + ''.__('Filters').'', + 'filter_form', '', - __('All'), - 0, true, false, - false -); -$table->data[0][2] = __('Free Search').ui_print_help_tip( - __('Search by name, description, tcp send or tcp rcv, list matches.'), - true -); -$table->data[0][3] = html_print_input_text( - 'search_string', - $search_string, '', - 25, - 255, - true + 'white-box-content', + 'box-flat white_table_graph fixed_filter_bar' ); -if (is_metaconsole() === true) { - $table->data[0][4] = '
    '; -} else { - $table->data[0][4] = '
    '; -} - -$table->data[0][4] .= html_print_submit_button( - __('Search'), - 'search', - false, - 'class="sub search"', - true -); -$table->data[0][4] .= '
    '; - -if (is_metaconsole() === true) { - $filter = '
    '; - $filter .= html_print_table($table, true); - $filter .= '
    '; - ui_toggle($filter, __('Show Options')); -} else { - echo '
    '; - html_print_table($table); - echo '
    '; -} $filter = []; if ($search_id_group) { @@ -721,7 +736,6 @@ $total_components = network_components_get_network_components( ); $total_components = $total_components[0]['total']; $offset_delete = ($offset >= ($total_components - 1)) ? ($offset - $config['block_size']) : $offset; -ui_pagination($total_components, $name_url); $filter['offset'] = (int) get_parameter('offset'); $filter['limit'] = (int) $config['block_size']; $components = network_components_get_network_components( @@ -935,30 +949,20 @@ html_print_action_buttons( ?>