Fixes homonyms handling.
[platal.git] / modules / carnet.php
index aee2890..3a126a1 100644 (file)
@@ -280,7 +280,7 @@ class CarnetModule extends PLModule
         }
         switch (Env::v('action')) {
             case 'retirer':
-                if (($contact = User::get(Env::v('user')))) {
+                if (($contact = Profile::get(Env::v('user')))) {
                     if (XDB::execute("DELETE FROM  contacts
                                             WHERE  uid = {?} AND contact = {?}",
                                      $uid, $contact->id())) {
@@ -291,7 +291,7 @@ class CarnetModule extends PLModule
                 break;
 
             case 'ajouter':
-                if (($contact = User::get(Env::v('user')))) {
+                if (($contact = Profile::get(Env::v('user')))) {
                     XDB::execute('INSERT IGNORE INTO  contacts (uid, contact)
                                               VALUES  ({?}, {?})',
                                  $uid, $contact->id());
@@ -324,12 +324,9 @@ class CarnetModule extends PLModule
 
         $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.
-        // $view->addMod('geoloc', 'Planisphère', false, array('with_annu' => 'carnet/contacts/search'));
+        $view->addMod('map', 'Planisphère');
         $view->apply('carnet/contacts', $page, $action, $subaction);
-        //if ($action != 'geoloc' || ($search && !$ssaction) || (!$search && !$subaction)) {
         $page->changeTpl('carnet/mescontacts.tpl');
-        //}
     }
 
     function handler_pdf($page, $arg0 = null, $arg1 = null)