diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 35f05102a8..30abc0a4e8 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,11 @@ +2011-06-06 Juan Manuel Ramon + + * include/functions_modules.php: Some mofications over update_tag + function. + * include/functions_alerts.php: Added new function + alerts_get_alerts_module_name() to retrieve alerts of a module + in html select tag format. + 2011-06-06 Juan Manuel Ramon * include/functions_tags.php: Added new parameters to function diff --git a/pandora_console/include/functions_alerts.php b/pandora_console/include/functions_alerts.php index 92c6caa1e6..fa227af747 100644 --- a/pandora_console/include/functions_alerts.php +++ b/pandora_console/include/functions_alerts.php @@ -934,6 +934,26 @@ function alerts_get_alerts_agent_module ($id_agent_module, $disabled = false, $f $filter, $fields); } +/** + * Get alert associated to a module (only id and name fields). + * + * @param int Id of an alert template. + * @param bool Disabled or not. + * + * @return mixed Affected rows or false if something goes wrong. + */ +function alerts_get_alerts_module_name ($id_agent_module, $disabled = false) { + $id_alert_agent_module = safe_int ($id_agent_module, 0); + + $sql = sprintf ('SELECT a.id, b.name + FROM talert_template_modules as a, talert_templates as b + WHERE a.id=b.id AND a.id_agent_module = %d AND a.disabled = %d', + $id_agent_module, (int)$disabled); + + return db_process_sql($sql); +} + + /** * Get disabled field of talert_template_modules table. * diff --git a/pandora_console/include/functions_modules.php b/pandora_console/include/functions_modules.php index a53f594ed5..6e3bfa8e56 100644 --- a/pandora_console/include/functions_modules.php +++ b/pandora_console/include/functions_modules.php @@ -185,11 +185,12 @@ function modules_update_agent_module ($id, $values, $onlyNoDeletePending = false if (isset ($values['nombre']) && empty ($values['nombre'])) return false; - $return_tag = tags_update_module_tag ($id, $tags); + if ($tags !== false) + $return_tag = tags_update_module_tag ($id, $tags); - if ($return_tag === false){ - return false; - } +// if ($return_tag === false){ +// return false; +// } if ($onlyNoDeletePending) { return (@db_process_sql_update ('tagente_modulo', $values,