From 1e25daff32ad7613e9fc89d92b59b2fbaa5e2e60 Mon Sep 17 00:00:00 2001
From: zarzuelo <noreply@pandorafms.org>
Date: Fri, 20 Apr 2012 12:10:10 +0000
Subject: [PATCH] 2012-04-20  Sergio Martin <sergio.martin@artica.es>

	* lib/PandoraFMS/Core.pm: Setted last_reference to current utimestamp
	in the alert table when create it



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6068 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
---
 pandora_server/ChangeLog              | 5 +++++
 pandora_server/lib/PandoraFMS/Core.pm | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog
index 00bde7d06b..8cd56f7f7c 100644
--- a/pandora_server/ChangeLog
+++ b/pandora_server/ChangeLog
@@ -1,3 +1,8 @@
+2012-04-20  Sergio Martin <sergio.martin@artica.es>
+
+	* lib/PandoraFMS/Core.pm: Setted last_reference to current utimestamp
+	in the alert table when create it
+
 2012-04-20  Koichiro Kikuchi  <koichiro@rworks.jp>
 
 	* conf/pandora_server.conf.windows,
diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm
index 6b96684e9f..fa999e9018 100644
--- a/pandora_server/lib/PandoraFMS/Core.pm
+++ b/pandora_server/lib/PandoraFMS/Core.pm
@@ -1203,7 +1203,7 @@ sub pandora_create_template_module ($$$$;$$$) {
 	$standby = 0 unless defined $standby;
 	
 	my $module_name = get_module_name($dbh, $id_agent_module);
-	return db_insert ($dbh, 'id', "INSERT INTO talert_template_modules (`id_agent_module`, `id_alert_template`, `id_policy_alerts`, `disabled`, `standby`) VALUES (?, ?, ?, ?, ?)", $id_agent_module, $id_alert_template, $id_policy_alerts, $disabled, $standby);
+	return db_insert ($dbh, 'id', "INSERT INTO talert_template_modules (`id_agent_module`, `id_alert_template`, `id_policy_alerts`, `disabled`, `standby`, `last_reference`) VALUES (?, ?, ?, ?, ?, ?)", $id_agent_module, $id_alert_template, $id_policy_alerts, $disabled, $standby, time);
 }
 
 ##########################################################################