X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fcarnet.php;h=ba5e1df2c64dc991ef18ecc22668c031379299b5;hb=d101a069d4d197e27fafac9f773e623eee140849;hp=f5f4cb37ba2454a5058639aa46778a3c98c827fd;hpb=4ae396ecda11a090106a65cb58135067adefcf8b;p=platal.git diff --git a/modules/carnet.php b/modules/carnet.php index f5f4cb3..ba5e1df 100644 --- a/modules/carnet.php +++ b/modules/carnet.php @@ -292,9 +292,10 @@ class CarnetModule extends PLModule case 'ajouter': if (($contact = User::get(Env::v('user')))) { - if (XDB::execute("REPLACE INTO contacts (uid, contact) - VALUES ({?}, {?})", - $uid, $contact->id())) { + XDB::execute('INSERT IGNORE INTO contacts (uid, contact) + VALUES ({?}, {?})', + $uid, $contact->id()); + if (XDB::affectedRows() > 0) { Platal::session()->updateNbNotifs(); $page->trigSuccess('Contact ajouté !'); } else { @@ -315,7 +316,7 @@ class CarnetModule extends PLModule } if ($search && trim(Env::v('quick'))) { $base = 'carnet/contacts/search'; - $view = new SearchSet(true, false, new UFC_Contact($user)); + $view = new QuickSearchSet(new UFC_Contact($user)); } else { $base = 'carnet/contacts'; $view = new ProfileSet(new UFC_Contact($user));