aliases.id => aliases.uid
[platal.git] / modules / marketing.php
index 3d63d6d..ae7fc5d 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2009 Polytechnique.org                              *
+ *  Copyright (C) 2003-2010 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -64,8 +64,7 @@ class MarketingModule extends PLModule
         }
         $matricule = $user->profile()->xorg_id;
 
-        require_once('user.func.inc.php');
-        $matricule_X = get_X_mat($matricule);
+        $matricule_X = Profile::getSchoolId($matricule);
 
         $page->assign('full_name', $user->fullName());
         $page->assign('promo', $user->promo());
@@ -124,7 +123,7 @@ class MarketingModule extends PLModule
         $res = XDB::iterator(
                 "SELECT  r.*, a.alias
                    FROM  register_marketing AS r
-              LEFT JOIN  aliases            AS a ON (r.sender=a.id AND a.type = 'a_vie')
+              LEFT JOIN  aliases            AS a ON (r.sender=a.uid AND a.type = 'a_vie')
                   WHERE  uid={?}
                ORDER BY  date", $user->id());
         $page->assign('addr', $res);
@@ -210,9 +209,9 @@ class MarketingModule extends PLModule
         }
         $page->assign('promo', $promo);
 
-        $uf = new UserFilter(new UFC_And(new UFC_Promo('=', UserFilter::DISPLAY, $promo),
-                                            new UFC_Not(new UFC_Registered())),
-                                array(new UFO_Name(UserFilter::LASTNAME), new UFO_Name(UserFilter::FIRSTNAME)));
+        $uf = new UserFilter(new PFC_And(new UFC_Promo('=', UserFilter::DISPLAY, $promo),
+                                            new PFC_Not(new UFC_Registered())),
+                                array(new UFO_Name(Profile::LASTNAME), new UFO_Name(Profile::FIRSTNAME)));
         $users = $uf->getUsers();
         $page->assign('nonins', $users);
     }