From a973eec62949c2206c2120a21e3b55d2ec93db5b Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Wed, 5 Dec 2012 17:02:47 +0000 Subject: [PATCH] 2012-12-05 Sergio Martin * godmode/agentes/module_manager_editor_common.php godmode/agentes/configurar_agente.php godmode/agentes/module_manager_editor.php godmode/menu.php godmode/category godmode/category/category.php godmode/category/edit_category.php: Add categories editor and the category combo in the modules editor git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7231 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 11 ++ .../godmode/agentes/configurar_agente.php | 5 +- .../godmode/agentes/module_manager_editor.php | 4 + .../agentes/module_manager_editor_common.php | 6 + pandora_console/godmode/category/category.php | 128 ++++++++++++++++ .../godmode/category/edit_category.php | 140 ++++++++++++++++++ pandora_console/godmode/menu.php | 4 + 7 files changed, 297 insertions(+), 1 deletion(-) create mode 100755 pandora_console/godmode/category/category.php create mode 100755 pandora_console/godmode/category/edit_category.php diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 380db16b79..4bfa51c6f4 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,14 @@ +2012-12-05 Sergio Martin + + * godmode/agentes/module_manager_editor_common.php + godmode/agentes/configurar_agente.php + godmode/agentes/module_manager_editor.php + godmode/menu.php + godmode/category + godmode/category/category.php + godmode/category/edit_category.php: Add categories editor + and the category combo in the modules editor + 2012-12-05 Miguel de Dios * extensions/update_manager/lib/libupdate_manager_client.php, diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index 922742d65c..54b9192bff 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -790,6 +790,8 @@ if ($update_module || $create_module) { $critical_inverse = (int) get_parameter('critical_inverse'); $warning_inverse = (int) get_parameter('warning_inverse'); + $id_category = (int) get_parameter('id_category'); + $hour = get_parameter('hour'); $minute = get_parameter('minute'); $mday = get_parameter('mday'); @@ -863,7 +865,8 @@ if ($update_module) { 'unknown_instructions' => $unknown_instructions, 'critical_inverse' => $critical_inverse, 'warning_inverse' => $warning_inverse, - 'cron_interval' => $cron_interval); + 'cron_interval' => $cron_interval, + 'id_category' => $id_category); if ($prediction_module == 3 && $serialize_ops == '') { $result = false; diff --git a/pandora_console/godmode/agentes/module_manager_editor.php b/pandora_console/godmode/agentes/module_manager_editor.php index 6139c1a5ec..db938de7d2 100644 --- a/pandora_console/godmode/agentes/module_manager_editor.php +++ b/pandora_console/godmode/agentes/module_manager_editor.php @@ -210,6 +210,8 @@ if ($id_agent_module) { $critical_inverse = $module['critical_inverse']; $warning_inverse = $module['warning_inverse']; + $id_category = $module['id_category']; + $cron_interval = explode (" ", $module['cron_interval']); if (isset ($cron_interval[4])) { $minute = $cron_interval[0]; @@ -285,6 +287,8 @@ else { $critical_inverse = ''; $warning_inverse = ''; + $id_category = 0; + $cron_interval = '* * * * *'; $hour = '*'; $minute = '*'; diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php index c6a8e53591..50dcadc2c9 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_common.php +++ b/pandora_console/godmode/agentes/module_manager_editor_common.php @@ -15,6 +15,7 @@ // GNU General Public License for more details. include_once("include/functions_modules.php"); +include_once("include/functions_categories.php"); function prepend_table_simple ($row, $id = false) { global $table_simple; @@ -379,6 +380,11 @@ $table_advanced->data[12][2] = ''; $table_advanced->data[12][3] = __('Retries'); $table_advanced->data[12][4] = html_print_input_text ('max_retries', $max_retries, '', 5, 10, true); +if (check_acl ($config['id_user'], 0, "PM")) { + $table_advanced->data[13][0] = __('Category'); + $table_advanced->data[13][1] = html_print_select(categories_get_all_categories('forselect'), 'id_category', $id_category, '', __('None'), 0, true); + $table_advanced->colspan[13][1] = 4; +} ?>