From: Raphaël Barrois Date: Thu, 24 Jun 2010 17:03:23 +0000 (+0200) Subject: Fix death setting (PHP replaces '.' with '_' in POST fields) X-Git-Tag: xorg/1.0.0~39 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=f198bf30acc4efefe6b42175d22f79006dd0e869;p=platal.git Fix death setting (PHP replaces '.' with '_' in POST fields) Still needs a fix (erroneous call to $profile->clear()) Signed-off-by: Raphaël Barrois --- 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}