Improve the error messages displayed when doing searches in the directory (too many...
authorOlivier Le Floch <olivier.le-floch@polytechnique.org>
Fri, 8 Feb 2008 17:45:15 +0000 (18:45 +0100)
committerOlivier Le Floch <olivier.le-floch@polytechnique.org>
Fri, 8 Feb 2008 17:45:15 +0000 (18:45 +0100)
include/userset.inc.php
modules/search.php

index 382baa3..6392160 100644 (file)
@@ -88,7 +88,7 @@ class SearchSet extends UserSet
         $qSearch = new QuickSearch('quick');
         $fields  = new SFieldGroup(true, array($qSearch));
         if ($qSearch->isEmpty()) {
-            new ThrowError('Recherche trop générale.');
+            new ThrowError('Aucun critère de recherche n\'est spécifié.');
         }
         $this->score = $qSearch->get_score_statement();
         $pwhere = $fields->get_where_statement();
index 50af49b..f74b4f5 100644 (file)
@@ -143,9 +143,9 @@ class SearchModule extends PLModule
             if (!S::logged() && $nb_tot > $globals->search->public_max) {
                 new ThrowError('Votre recherche a généré trop de résultats pour un affichage public.');
             } elseif ($nb_tot > $globals->search->private_max) {
-                new ThrowError('Recherche trop générale');
+                new ThrowError('Recherche trop générale. Une <a href="search/adv">recherche avancée</a> permet de préciser la recherche.');
             } elseif (empty($nb_tot)) {
-                new ThrowError('il n\'existe personne correspondant à ces critères dans la base !');
+                new ThrowError('Il n\'existe personne correspondant à ces critères dans la base !');
             }
         } else {
             $page->assign('formulaire',1);
@@ -204,7 +204,7 @@ class SearchModule extends PLModule
             $nb_tot = $view->count();
             if ($nb_tot > $globals->search->private_max) {
                 $this->form_prepare();
-                new ThrowError('Recherche trop générale');
+                new ThrowError('Recherche trop générale.');
             }
         }