From 77771b13ecd7dbe0411daabf72511f29a940e079 Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Wed, 30 May 2012 16:46:02 +0000 Subject: [PATCH] 2012-05-30 Sergio Martin * include/functions_modules.php: Duplicate the operations too when duplicate a synthetic module for bug Merged from 4.0.x git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6371 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 6 +++++ pandora_console/include/functions_modules.php | 25 +++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index ac3380717c..3ca6253950 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2012-05-30 Sergio Martin + + * include/functions_modules.php: Duplicate the operations + too when duplicate a synthetic module for bug + Merged from 4.0.x + 2012-05-30 Sergio Martin * include/constants.php: Add new error control diff --git a/pandora_console/include/functions_modules.php b/pandora_console/include/functions_modules.php index 3bdd646367..ddff5ac7a4 100644 --- a/pandora_console/include/functions_modules.php +++ b/pandora_console/include/functions_modules.php @@ -137,6 +137,31 @@ function modules_copy_agent_module_to_agent ($id_agent_module, $id_destiny_agent } if ($result !== false) { + // If the module is synthetic we duplicate the operations too + if($module['id_modulo'] == 5) { + $synth_ops = db_get_all_rows_field_filter('tmodule_synth','id_agent_module_target',$module['id_agente_modulo']); + + if($synth_ops === false) { + $synth_ops = array(); + } + + foreach($synth_ops as $synth_op) { + unset($synth_op['id']); + $synth_op['id_agent_module_target'] = $id_new_module; + switch ($config['dbtype']) { + case "mysql": + case "postgresql": + db_process_sql_insert ('tmodule_synth', + $synth_op); + break; + case "oracle": + db_process_sql_insert ('tmodule_synth', + $synth_op, false); + break; + } + } + } + //Added the config data if necesary enterprise_include_once('include/functions_config_agents.php');