2009-11-30 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_alerts.php: fix deletion of compound alerts in the function "delete_alert_agent_module". Fixes: 2902618 * godmode/agentes/configurar_agente.php: use the "delete_alert_agent_module" instead the sql method. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2145 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
4533b0357f
commit
958aea710b
|
@ -1,3 +1,11 @@
|
|||
2009-11-30 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* include/functions_alerts.php: fix deletion of compound alerts in the
|
||||
function "delete_alert_agent_module".
|
||||
Fixes: 2902618
|
||||
* godmode/agentes/configurar_agente.php: use the "delete_alert_agent_module"
|
||||
instead the sql method.
|
||||
|
||||
2009-11-30 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* godmode/agentes/configurar_agente.php: delete the simple alerts
|
||||
|
|
|
@ -34,6 +34,7 @@ if (! give_acl ($config["id_user"], $group, "AW")) {
|
|||
}
|
||||
|
||||
require_once ('include/functions_modules.php');
|
||||
require_once ('include/functions_alerts.php');
|
||||
|
||||
// Get passed variables
|
||||
$tab = get_parameter ('tab', 'main');
|
||||
|
@ -593,7 +594,7 @@ if (isset ($_GET["delete_module"])){ // DELETE agent module !
|
|||
if (process_sql ("DELETE FROM tagente_datos_inc WHERE id_agente_modulo = ".$id_borrar_modulo) === false)
|
||||
$error++;
|
||||
|
||||
if (process_sql ("DELETE FROM talert_template_modules WHERE id_agent_module = ".$id_borrar_modulo) === false)
|
||||
if (delete_alert_agent_module($id_borrar_modulo) === false)
|
||||
$error++;
|
||||
|
||||
|
||||
|
|
|
@ -410,6 +410,15 @@ function delete_alert_agent_module ($id_alert_agent_module, $filter = false) {
|
|||
if ($id_alert_agent_module)
|
||||
$filter['id'] = $id_alert_agent_module;
|
||||
|
||||
$idAlertCompunds = get_db_all_rows_sql('SELECT id_alert_compound
|
||||
FROM talert_compound_elements
|
||||
WHERE id_alert_template_module = ' . $id_alert_agent_module);
|
||||
|
||||
if ($idAlertCompunds !== false) {
|
||||
foreach($idAlertCompunds as $id)
|
||||
delete_alert_compound($id);
|
||||
}
|
||||
|
||||
return (@process_sql_delete ('talert_template_modules',
|
||||
$filter)) !== false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue