From 3859e2fdf84da10f736416c041de40e2ef2cb109 Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Thu, 24 Oct 2013 15:53:07 +0000 Subject: [PATCH] 2013-10-24 Sergio Martin * godmode/agentes/module_manager_editor_common.php: Store the interval factor in modules edition when is policy form and other improvements. Incident #303 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8955 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 6 ++++++ .../agentes/module_manager_editor_common.php | 14 +++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index c5f8324ff9..11bff9741a 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2013-10-24 Sergio Martin + + * godmode/agentes/module_manager_editor_common.php: Store the + interval factor in modules edition when is policy form and other + improvements. Incident #303 + 2013-10-23 Miguel de Dios * include/functions_api.php: fixed the get events filtered by the diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php index b08dbe9624..35de8b94d8 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_common.php +++ b/pandora_console/godmode/agentes/module_manager_editor_common.php @@ -311,8 +311,20 @@ if ($moduletype == MODULE_DATA) { if (isset($id_agente)) { $agent_interval = agents_get_interval ($id_agente); $interval_factor = $interval / $agent_interval; + $table_advanced->data[2][1] = human_time_description_raw($interval) . ' (' . sprintf(__('Agent interval x %s'), $interval_factor) . ') ' . ui_print_help_icon ('module_interval_factor', true); } - $table_advanced->data[2][1] = human_time_description_raw($interval) . ' (' . sprintf(__('Agent interval x %s'), $interval_factor) . ') ' . ui_print_help_icon ('module_interval_factor', true); + else { + $table_advanced->data[2][1] = sprintf(__('Agent interval x %s'), $interval_factor) . ui_print_help_icon ('module_interval_factor', true); + } + + if ($__code_from == 'policies') { + // If is the policy form, module_interval will store the factor (not the seconds). + // So server will transform it to interval in seconds + $table_advanced->data[2][1] .= html_print_input_hidden('module_interval', $interval_factor, true); + } + + // If it is a non policy form, the module_interval will not provided and will + // be taken the agent interval (this code is at configurar_agente.php) } else { $table_advanced->data[2][0] = __('Interval') . ui_print_help_icon ('module_interval', true);