From f198bf30acc4efefe6b42175d22f79006dd0e869 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Barrois?= Date: Thu, 24 Jun 2010 19:03:23 +0200 Subject: [PATCH] Fix death setting (PHP replaces '.' with '_' in POST fields) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Still needs a fix (erroneous call to $profile->clear()) Signed-off-by: Raphaël Barrois --- modules/admin.php | 12 ++++++------ templates/admin/deces_promo.tpl | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/admin.php b/modules/admin.php index ca8a9da..e01a23a 100644 --- a/modules/admin.php +++ b/modules/admin.php @@ -904,29 +904,29 @@ class AdminModule extends PLModule if ($validate) { S::assert_xsrf_token(); - $res = XDB::iterRow('SELECT p.hrpid, pd.directory_name, p.deathdate + $res = XDB::iterRow('SELECT p.pid, pd.directory_name, p.deathdate FROM profiles AS p INNER JOIN profile_display AS pd ON (p.pid = pd.pid) WHERE pd.promo = {?}', $promo); while (list($pid, $name, $death) = $res->next()) { - $val = Env::v($pid); - if($val == $deces || empty($val)) { + $val = Env::v('death_' . $pid); + if($val == $death || empty($val)) { continue; } XDB::execute('UPDATE profiles SET deathdate = {?}, deathdate_rec = NOW() - WHERE hrpid = {?}', $val, $pid); + WHERE pid = {?}', $val, $pid); $page->trigSuccess('Ajout du décès de ' . $name . ' le ' . $val . '.'); if($death == '0000-00-00' || empty($death)) { - $profile = Profile::get($pid); + $profile = Profile::getPID($pid); $profile->clear(); $profile->owner()->clear(false); } } } - $res = XDB::iterator('SELECT p.hrpid, pd.directory_name, p.deathdate + $res = XDB::iterator('SELECT p.pid, pd.directory_name, p.deathdate FROM profiles AS p INNER JOIN profile_display AS pd ON (p.pid = pd.pid) WHERE pd.promo = {?} diff --git a/templates/admin/deces_promo.tpl b/templates/admin/deces_promo.tpl index 4136f19..cf5a6c1 100644 --- a/templates/admin/deces_promo.tpl +++ b/templates/admin/deces_promo.tpl @@ -44,7 +44,7 @@ {$x.directory_name} - + {/iterate} -- 2.1.4