From 06815860a57c28ec92881bd95f45bd1ddc465f10 Mon Sep 17 00:00:00 2001 From: Esteban Sanchez Date: Mon, 20 Apr 2009 14:00:27 +0000 Subject: [PATCH] 2009-04-20 Esteban Sanchez * godmode/agentes/module_manager_editor.php, godmode/agentes/module_manager_editor_common.php, godmode/agentes/module_manager_editor_data.php, godmode/agentes/module_manager_editor_network.php, godmode/agentes/module_manager_editor_plugin.php, godmode/agentes/module_manager_editor_prediction.php, godmode/agentes/module_manager_editor_wmi.php, godmode/agentes/module_manager.php: Some fixes to allow form reutilization. * include/javascript/jquery.pandora.controls.js: Fixed a typo. Added pandoraSelectGroup control. * include/javascript/jquery.pandora.js: Separate between auto executed code and document ready function. * include/javascript/pandora_modules.js: Added to repository. Functions to use on module editors. * include/functions_agents.php: Added get_agents(). * include/functions_db.php: Added get_user_first_group(). Changed user_access_to_agent() parameters order. * include/functions_reporting.php: Style corrections. * include/functions_ui.php: Added doc to print_status_image(). Added print_ui_agents_list() to print a list of agents with a search form and a lot of configuration options easily. * include/functions_ui_renders.php: Added to repository. New API for renders on UI components. * operation/agentes/estado_agente.php: Make table wider. * godmode/reporting/reporting_builder.php: Replaced exit with return. Use pandoraSelectGroup control. * godmode/servers/manage_recontask_form.php: Style corrections to fit Pandora styles. * godmode/servers/modificar_server.php: Removed a notice from a typo. * godmode/setup/setup.php: Fixed table data indexes. Removed javascript code from visual setup. * godmode/setup/setup_visuals.php: Some strings changed. Style correction. * godmode/menu.php: Added policies enterprise menu option. * images/policies.png: Added to repository. * godmode/agentes/modificar_agente.php: Style correction by using pandora functions. * godmode/agentes/massive_operations.php: Fixed tab styles that was showing wrong the . * godmode/agentes/manage_config_remote.php: Changes in user_access_to_agent() * general/ui/agents_list.php: Added to repository. Reusable render for an agent list. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1632 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 27 +++ pandora_console/general/ui/agents_list.php | 217 ++++++++++++++++++ .../godmode/agentes/configurar_agente.php | 1 + .../godmode/agentes/manage_config_remote.php | 4 +- .../godmode/agentes/massive_operations.php | 10 +- .../godmode/agentes/modificar_agente.php | 6 +- .../godmode/agentes/module_manager.php | 14 +- .../godmode/agentes/module_manager_editor.php | 197 +--------------- .../agentes/module_manager_editor_common.php | 4 - .../agentes/module_manager_editor_data.php | 5 - .../agentes/module_manager_editor_network.php | 6 - .../agentes/module_manager_editor_plugin.php | 6 - .../module_manager_editor_prediction.php | 5 - .../agentes/module_manager_editor_wmi.php | 5 - pandora_console/godmode/menu.php | 3 + .../godmode/reporting/reporting_builder.php | 53 ++--- .../godmode/servers/manage_recontask_form.php | 103 ++++----- .../godmode/servers/modificar_server.php | 2 +- pandora_console/godmode/setup/setup.php | 87 +++---- .../godmode/setup/setup_visuals.php | 10 +- pandora_console/images/policies.png | Bin 0 -> 612 bytes pandora_console/include/functions_agents.php | 34 +++ pandora_console/include/functions_db.php | 36 ++- .../include/functions_reporting.php | 8 +- pandora_console/include/functions_ui.php | 93 +++++++- .../include/functions_ui_renders.php | 117 ++++++++++ .../javascript/jquery.pandora.controls.js | 47 +++- .../include/javascript/jquery.pandora.js | 6 +- .../include/javascript/pandora_modules.js | 176 ++++++++++++++ .../operation/agentes/estado_agente.php | 2 +- 30 files changed, 876 insertions(+), 408 deletions(-) create mode 100644 pandora_console/general/ui/agents_list.php create mode 100644 pandora_console/images/policies.png create mode 100644 pandora_console/include/functions_ui_renders.php create mode 100644 pandora_console/include/javascript/pandora_modules.js diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 6cc4d1802e..7954ff4c72 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,30 @@ +2009-04-20 Esteban Sanchez + + * godmode/agentes/module_manager_editor.php, + godmode/agentes/module_manager_editor_common.php, + godmode/agentes/module_manager_editor_data.php, + godmode/agentes/module_manager_editor_network.php, + godmode/agentes/module_manager_editor_plugin.php, + godmode/agentes/module_manager_editor_prediction.php, + godmode/agentes/module_manager_editor_wmi.php, + godmode/agentes/module_manager.php: Some fixes to allow form + reutilization. + + * godmode/reporting/reporting_builder.php: Replaced exit with return. Use + pandoraSelectGroup() control. + + * godmode/agentes/modificar_agente.php: Style correction by using pandora + functions. + + * godmode/agentes/massive_operations.php: Fixed tab styles that was showing + wrong the . + + * godmode/agentes/manage_config_remote.php: Changes in + user_access_to_agent() + + * general/ui/agents_list.php: Added to repository. Reusable render for an + agent list. + 2009-04-20 Jorge Gonzalez * include/languages/es.po, include/languages/es.mo: Updated Spanish diff --git a/pandora_console/general/ui/agents_list.php b/pandora_console/general/ui/agents_list.php new file mode 100644 index 0000000000..63f6d1f94d --- /dev/null +++ b/pandora_console/general/ui/agents_list.php @@ -0,0 +1,217 @@ + $value) { + $value = safe_input ($value); + switch ($field) { + case 'page': + case 'search_agents': + case 'search': + case 'table_renders': + case 'fields': + case 'filter': + case 'access': + continue; + case 'search': + array_push ($filter, '(nombre LIKE "%%'.$value.'%%" OR descripcion LIKE "%%'.$value.'%%")'); + break; + case 'id_group': + if ($value == 1) + $filter['id_grupo'] = array_keys (get_user_groups (false, $value)); + else + $filter['id_grupo'] = $value; + break; + default: + $filter[$field] = $value; + } + } + + $agents = get_agents ($filter, $fields, $access); + $all_data = array (); + if ($agents !== false) { + foreach ($agents as $agent) { + $data = array (); + foreach ($table_renders as $name => $values) { + if (! is_numeric ($name)) { + array_push ($data, render_agent_field (&$agent, $name, $values, true)); + } else { + array_push ($data, render_agent_field (&$agent, $values, false, true)); + } + } + array_push ($all_data, $data); + } + } + + echo json_encode ($all_data); + return; + } + return; +} + +require_once ('include/functions_ui_renders.php'); + +check_login (); + +if ($show_filter_form) { + $table->width = '90%'; + $table->id = 'search_agent_table'; + $table->data = array (); + $table->size = array (); + $table->style = array (); + $table->style[0] = 'font-weight: bold'; + $table->style[2] = 'font-weight: bold'; + + $odd = true; + if ($group_filter) { + if ($odd) + $data = array (); + $data = array (); + $data[] = __('Group'); + $data[] = print_select (get_user_groups (false, $access), + 'id_group', '', '', '', '', true); + if (! $odd) + array_push ($table->data, $data); + $odd = !$odd; + } + + if ($text_filter) { + if ($odd) + $data = array (); + $data[] = __('Search'); + $data[] = print_input_text ('search', '', '', 15, 255, true); + if (! $odd) + array_push ($table->data, $data); + $odd = !$odd; + } + + echo ''; + + require_jquery_file ('form'); +} + +$table->width = '90%'; +$table->id = 'agents_table'; +$table->head = $table_heads; +$table->align = $table_align; +$table->size = $table_size; +$table->data = array (); + +$agents = get_agents ($filter, $fields, $access); + +echo ''; + +echo ''; +?> + diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index 6d3bb92850..6bbee5bba7 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -182,6 +182,7 @@ if ($create_agent) { $img_style = array ("class" => "top", "width" => 16); if ($id_agente) { + echo '