Several fixes in carnet notification selection.
[platal.git] / modules / marketing.php
index eecab75..5068fd4 100644 (file)
@@ -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,8 +123,8 @@ 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')
-                  WHERE  uid={?}
+              LEFT JOIN  aliases            AS a ON (r.sender = a.uid AND a.type = 'a_vie')
+                  WHERE  r.uid = {?}
                ORDER BY  date", $user->id());
         $page->assign('addr', $res);
 
@@ -210,8 +209,8 @@ 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())),
+        $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);