Fix the carnet
authorRaphaël Barrois <raphael.barrois@polytechnique.org>
Fri, 5 Feb 2010 15:34:27 +0000 (16:34 +0100)
committerRaphaël Barrois <raphael.barrois@polytechnique.org>
Sat, 13 Feb 2010 23:34:01 +0000 (00:34 +0100)
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
modules/carnet.php

index 7c656cc..a19a50c 100644 (file)
@@ -284,7 +284,11 @@ class CarnetModule extends PLModule
                 break;
         }
 
-/*        $search = false;
+        $search = false;
+        $user = S::user();
+
+        require_once 'userset.inc.php';
+
         if ($action == 'search') {
             $action = $subaction;
             $subaction = $ssaction;
@@ -294,16 +298,12 @@ class CarnetModule extends PLModule
             $base = 'carnet/contacts/search';
 
             Platal::load('search', 'classes.inc.php');
-            ThrowError::$throwHook = array($this, 'searchErrorHandler');
-            $view = new SearchSet(true, false, "INNER JOIN contacts AS c2 ON (u.user_id = c2.contact)", "c2.uid = $uid");
+            $view = new SearchSet(true, false, new UFC_Contact($user));
         } else {
             $base = 'carnet/contacts';
-            $view = new UserSet("INNER JOIN contacts AS c2 ON (u.user_id = c2.contact)", " c2.uid = $uid ");
-        }*/
+            $view = new ProfileSet(new UFC_Contact($user));
+        }
 
-        require_once 'userset.inc.php';
-        $user = S::user();
-        $view = new UserSet(new UFC_Contact($user));
         $view->addMod('minifiche', 'Mini-fiches', true);
         $view->addMod('trombi', 'Trombinoscope', false, array('with_admin' => false, 'with_promo' => true));
         // TODO: Reactivate when the new map is completed.