From: Vincent Zanotti Date: Mon, 20 Apr 2009 20:01:07 +0000 (+0200) Subject: Revert "Fixes the hruid generation when mass-importing a new promotion." X-Git-Tag: xorg/0.10.1~49^2~9 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=d2e13f2961c467a86acfe66338a0685eabb63337;p=platal.git Revert "Fixes the hruid generation when mass-importing a new promotion." This reverts commit 1e865041b513cbdec96cfe155d9072e1546d4144. --- diff --git a/core b/core index 82ccb54..ad33acf 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit 82ccb5452cd953d71c49e0075d9ecbbb2f6b5456 +Subproject commit ad33acfad4176b1f30e116594e281ce602e33b05 diff --git a/modules/admin.php b/modules/admin.php index 3c5b87a..b233c91 100644 --- a/modules/admin.php +++ b/modules/admin.php @@ -691,14 +691,13 @@ class AdminModule extends PLModule $page->assign('bans', $bans); } - function getHruid($line, $partial_result, $key) + function getHruid($line, $key) { - if (!isset($partial_result['nom']) || - !isset($partial_result['prenom']) || - !isset($partial_result['promo'])) { + var_dump($line); + if (!isset($line['nom']) || !isset($line['prenom']) || !isset($line['promo'])) { return null; } - return make_forlife($partial_result['prenom'], $partial_result['nom'], $partial_result['promo']); + return make_forlife($line['prenom'], $line['nom'], $line['promo']); } function getMatricule($line, $key) @@ -739,11 +738,9 @@ class AdminModule extends PLModule $fields = array('hruid', 'nom', 'nom_ini', 'prenom', 'naissance_ini', 'prenom_ini', 'promo', 'promo_sortie', 'flags', 'matricule', 'matricule_ax', 'perms'); + $importer->forceValue('hruid', array($this, 'getHruid')); $importer->forceValue('promo', $promo); $importer->forceValue('promo_sortie', $promo + 3); - // The hruid generation callback is set last, so that it is called once 'promo' - // has already been computed for that line. - $importer->forceValue('hruid', array($this, 'getHruid')); break; case 'ax': $fields = array('matricule', 'matricule_ax'); diff --git a/modules/axletter.php b/modules/axletter.php index 9159b46..9414f8d 100644 --- a/modules/axletter.php +++ b/modules/axletter.php @@ -365,7 +365,7 @@ class AXLetterModule extends PLModule return $id ? $id : '0'; } - function createHash($line, $partial_result, $key) + function createHash($line, $key) { $hash = implode(time(), $line) . rand(); $hash = md5($hash);