Merge branch 'platal-0.10.0'
authorVincent Zanotti <vincent.zanotti@m4x.org>
Tue, 12 May 2009 00:13:42 +0000 (02:13 +0200)
committerVincent Zanotti <vincent.zanotti@m4x.org>
Tue, 12 May 2009 00:13:42 +0000 (02:13 +0200)
Signed-off-by: Vincent Zanotti <vincent.zanotti@m4x.org>
core
include/validations/paiements.inc.php
modules/admin.php
modules/axletter.php

diff --git a/core b/core
index e8ddc3f..b39f2e6 160000 (submodule)
--- a/core
+++ b/core
@@ -1 +1 @@
-Subproject commit e8ddc3f28701273de2b5c0f822146ab2a39dea91
+Subproject commit b39f2e65166eb3d1b6ce180c85b9b809dd689839
index bb3afe4..2612f3b 100644 (file)
@@ -201,7 +201,12 @@ Si le télépaiement n'est pas lié à un groupe ou supérieur à 51 euros, lais
                     $mailer->assign('payment', $id);
                     $mailer->assign('prenom', $u['prenom']);
                     $mailer->assign('topay', $topay);
-                    $mailer->assign('to', $u['email']);
+
+                    if (strpos($u['email'], '@') === false) {
+                        $mailer->assign('to', $u['email'] . '@' . $globals->mail->domain);
+                    } else {
+                        $mailer->assign('to', $u['email']);
+                    }
                     $mailer->send();
                 }
             }
index 458d5d6..da2bce9 100644 (file)
@@ -694,17 +694,19 @@ class AdminModule extends PLModule
         $page->assign('bans', $bans);
     }
 
-    function getHruid($line, $partial_result, $key)
+    function getHruid($line, $key, $relation)
     {
-        if (!isset($partial_result['nom']) ||
-            !isset($partial_result['prenom']) ||
-            !isset($partial_result['promo'])) {
-            return null;
+        $prenom = CSVImporter::getValue($line, 'prenom', $relation['prenom']);
+        $nom = CSVImporter::getValue($line, 'nom', $relation['nom']);
+        $promo = CSVImporter::getValue($line, 'promo', $relation['promo']);
+
+        if ($prenom != 'NULL' && $nom != 'NULL' && $promo != 'NULL') {
+            return make_forlife($prenom, $nom, $promo);
         }
-        return make_forlife($partial_result['prenom'], $partial_result['nom'], $partial_result['promo']);
+        return null;
     }
 
-    function getMatricule($line, $key)
+    function getMatricule($line, $key, $relation)
     {
         $mat = $line['matricule'];
         $year = intval(substr($mat, 0, 3));
@@ -742,11 +744,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');
index 466dcc2..96fb5fa 100644 (file)
@@ -324,7 +324,7 @@ class AXLetterModule extends PLModule
         $importer->apply($page, "admin/axletter", array('user_id', 'email', 'prenom', 'nom', 'promo', 'flag', 'hash'));
     }
 
-    function idFromMail($line, $key)
+    function idFromMail($line, $key, $relation = null)
     {
         static $field;
         global $globals;
@@ -369,7 +369,7 @@ class AXLetterModule extends PLModule
         return $id ? $id : '0';
     }
 
-    function createHash($line, $partial_result, $key)
+    function createHash($line, $key, $relation)
     {
         $hash = implode(time(), $line) . rand();
         $hash = md5($hash);