From 383bcdecf7044edcef34b313df5301cc94102ac8 Mon Sep 17 00:00:00 2001 From: x2003bruneau Date: Mon, 14 May 2007 16:11:37 +0000 Subject: [PATCH] New shortcut in quick search to open user profile: admin:login -> open admin page ax:login -> open ax profile profile:login -> open user profile mentor:login -> open mentoring profile With some aliases: adm = admin, fiche = profile = fch = prf, ref = referent = mentor ChangeLog | 5 +++++ modules/search.php | 25 +++++++++++++++++++++++++ templates/search/quick.tpl | 20 ++++++++++++++++---- 3 files changed, 46 insertions(+), 4 deletions(-) git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1822 839d8a87-29fc-0310-9880-83ba4fa771e5 --- ChangeLog | 5 +++++ modules/search.php | 25 +++++++++++++++++++++++++ templates/search/quick.tpl | 20 ++++++++++++++++---- 3 files changed, 46 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 68a2bb7..1cc5b83 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,11 @@ ================================================================================ VERSION 0.9.15 XX XX 2007 +New: + + * Search: + - Shortcuts to open user profile directly from search -FRU + Bug/Wish: * Profile: diff --git a/modules/search.php b/modules/search.php index e7a2a9d..850c446 100644 --- a/modules/search.php +++ b/modules/search.php @@ -88,6 +88,31 @@ class SearchModule extends PLModule $page->assign('promo_max', $max); if (Env::has('quick') || $action == 'geoloc') { + $quick = trim(Env::v('quick')); + $list = 'profile|prf|fiche|fic|referent|ref|mentor'; + if (S::has_perms()) { + $list .= '|admin|adm|ax'; + } + if (preg_match('/^(' . $list . '):([-a-z]+(\.[-a-z]+(\.\d{2,4})?)?)$/', + $quick, $matches)) { + $forlife = $matches[2]; + switch($matches[1]) { + case 'admin': case 'adm': + $base = 'admin/user/'; + break; + case 'ax': + $base = 'profile/ax/'; + break; + case 'profile': case 'prf': case 'fiche': case 'fic': + $base = 'profile/'; + break; + case 'referent': case 'ref': case 'mentor': + $base = 'referent/'; + break; + } + pl_redirect($base . $forlife); + } + $page->assign('formulaire', 0); require_once 'userset.inc.php'; diff --git a/templates/search/quick.tpl b/templates/search/quick.tpl index 019dbd4..b4ade8a 100644 --- a/templates/search/quick.tpl +++ b/templates/search/quick.tpl @@ -77,7 +77,7 @@ Ainsi, rechercher tous les "Dupont" sur les promotions 1980 à 1990 et sur la pr Dupont 1980-1990 2000

-

Astuce pour les noms ...

+

Astuce pour les noms...

Parfois on ne sait plus si le nom qu'on recherche s'écrit « Lenormand », « Le Normand » ou « Le-Normand » ...

@@ -91,8 +91,19 @@ Il est conseillé d'omettre les particules car il est possible que celles-ci ne notre base de données.

+

Raccourcis...

+

+ En tapant fiche:prenom.nom.promo tu accèdes directement à la fiche du camarade correspondant. + De même ref:prenom.nom.promo t'emmène sur la fiche référent du camarade. +

+

+ Ces raccourcis fonctionnement également depuis le lien de recherche rapide disponible sur toutes les pages + du site et depuis la barre de recherche de ton navigateur si tu installes le module + ci-dessous. +

+ {if $smarty.session.perms->hasFlag('user')} -