From e1c9a11bfa29cdeac35193ac0727fd58164ac963 Mon Sep 17 00:00:00 2001 From: x2002bobillot Date: Thu, 24 Nov 2005 12:29:28 +0000 Subject: [PATCH] Bug des deces git-svn-id: svn+ssh://murphy/home/svn/platal/branches/platal-0.9.8@170 839d8a87-29fc-0310-9880-83ba4fa771e5 --- htdocs/admin/deces_promo.php | 9 ++++++--- templates/admin/deces_promo.tpl | 4 ++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/deces_promo.php b/htdocs/admin/deces_promo.php index 0f074a3..41d037b 100644 --- a/htdocs/admin/deces_promo.php +++ b/htdocs/admin/deces_promo.php @@ -31,11 +31,13 @@ if (Env::has('add10')) $promo += 10; $page->assign('promo',$promo); if (Env::get('valider') == "Valider") { - $res = $globals->xdb->iterRow("SELECT user_id,matricule,deces FROM auth_user_md5 WHERE promo = {?}", $promo); - while (list($uid,$mat,$deces) = $res->next()) { + $new_deces = array(); + $res = $globals->xdb->iterRow("SELECT user_id,matricule,nom,prenom,deces FROM auth_user_md5 WHERE promo = {?}", $promo); + while (list($uid,$mat,$nom,$prenom,$deces) = $res->next()) { $val = Env::get($mat); - if($val == $deces) continue; + if($val == $deces || empty($val)) continue; $globals->xdb->execute('UPDATE auth_user_md5 SET deces={?} WHERE matricule = {?}', $val, $mat); + $new_deces[] = array('name' => "$prenom $nom", 'date' => "$val"); if($deces=='0000-00-00' or empty($deces)) { require_once('notifs.inc.php'); register_watch_op($uid, WATCH_DEATH, $val); @@ -43,6 +45,7 @@ if (Env::get('valider') == "Valider") { user_clear_all_subs($uid, false); // by default, dead ppl do not loose their email } } + $page->assign('new_deces',$new_deces); } $res = $globals->xdb->iterator('SELECT matricule, nom, prenom, deces FROM auth_user_md5 WHERE promo = {?} ORDER BY nom,prenom', $promo); diff --git a/templates/admin/deces_promo.tpl b/templates/admin/deces_promo.tpl index 240bcd5..4990f7d 100644 --- a/templates/admin/deces_promo.tpl +++ b/templates/admin/deces_promo.tpl @@ -22,6 +22,10 @@ +{foreach from=$new_deces item=i} +

Ajout du décès de {$i.name} le {$i.date}.

+{/foreach} +
-- 2.1.4