From: x2003bruneau Date: Wed, 4 Apr 2007 14:25:45 +0000 (+0000) Subject: More 'plat/al-like' makeJs_hook for banana X-Git-Tag: xorg/0.9.14~125 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=51e102295715f6eebf08aa194208e99b514eb71d;p=platal.git More 'plat/al-like' makeJs_hook for banana Use REPLACE instead of INSERT for adding new contacts. I don't know why, but the INSERT causes slave duplication errors git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1662 839d8a87-29fc-0310-9880-83ba4fa771e5 --- diff --git a/include/banana/hooks.inc.php b/include/banana/hooks.inc.php index 68a51f4..82b3d66 100644 --- a/include/banana/hooks.inc.php +++ b/include/banana/hooks.inc.php @@ -168,6 +168,13 @@ function hook_makeLink($params) } } +function hook_makeJs($src) +{ + global $page; + $page->addJsLink("$src.js"); + return ' '; +} + function get_banana_params(array &$get, $group = null, $action = null, $artid = null) { if (!is_null($group)) { diff --git a/modules/carnet.php b/modules/carnet.php index c970213..1363f5c 100644 --- a/modules/carnet.php +++ b/modules/carnet.php @@ -216,10 +216,10 @@ class CarnetModule extends PLModule require_once('user.func.inc.php'); if (($login = get_user_login($user)) !== false) { if (XDB::execute( - 'INSERT INTO contacts (uid, contact) - SELECT {?}, id - FROM aliases - WHERE alias = {?}', $uid, $login)) + 'REPLACE INTO contacts (uid, contact) + SELECT {?}, id + FROM aliases + WHERE alias = {?}', $uid, $login)) { $page->trig('Contact ajouté !'); } else {