closes #89
authorx2000habouzit <x2000habouzit>
Tue, 12 Oct 2004 19:54:35 +0000 (19:54 +0000)
committerx2000habouzit <x2000habouzit>
Tue, 12 Oct 2004 19:54:35 +0000 (19:54 +0000)
htdocs/css/default.css
htdocs/search.php
templates/include/x_inscrit.tpl
templates/search.form.tpl
templates/search.result.private.tpl
templates/search.result.public.tpl
templates/search.tpl

index 57c82b7..aaa9439 100644 (file)
@@ -228,11 +228,6 @@ div.contact div.bits {
     float: left;
 }
 
-div.bits .smaller { display: none; }
-/*
-div.contact:hover div.bits .smaller { display: inline; }
-*/
-
 div.contact div.long {
     width: 100%;
     clear: both;
@@ -582,4 +577,4 @@ div.spacer { clear: both; }
 }
 
 /* vim: set et ts=4 sts=4 sw=4: */
-/* $Id: default.css,v 1.47 2004-10-09 14:04:47 x2000habouzit Exp $ */
+/* $Id: default.css,v 1.48 2004-10-12 19:54:36 x2000habouzit Exp $ */
index 23ccb6c..308a593 100644 (file)
@@ -18,7 +18,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: search.php,v 1.21 2004-10-12 18:18:19 x2000habouzit Exp $
+        $Id: search.php,v 1.22 2004-10-12 19:54:35 x2000habouzit Exp $
  ***************************************************************************/
 
 require("auto.prepend.inc.php");
@@ -59,7 +59,7 @@ if (array_key_exists('rechercher', $_REQUEST)) {
        new ThrowError('Recherche trop générale.');
     }
     $offset = new NumericSField('offset');
-    
+   
     $sql = 'SELECT SQL_CALC_FOUND_ROWS
                        r.matricule,i.matricule_ax,
                        u.nom!="" AS inscrit,
@@ -92,7 +92,8 @@ if (array_key_exists('rechercher', $_REQUEST)) {
            LEFT JOIN  geoloc_pays    AS gp  ON (adr.pays = gp.a2)
            LEFT JOIN  geoloc_region  AS gr  ON (adr.pays = gr.a2 AND adr.region = gr.region)
                 WHERE  '.$fields->get_where_statement().'
-             ORDER BY  '.implode(',',array_filter(array($fields->get_order_statement(),'promo DESC,nom,prenom'))).'
+             ORDER BY  '.(logged() && !empty($_POST['mod_date_sort']) ? 'date DESC,' :'')
+                       .implode(',',array_filter(array($fields->get_order_statement(),'promo DESC,nom,prenom'))).'
                 LIMIT  '.$offset->value.','.$globals->search_results_per_page;
 
     $page->mysql_assign($sql, 'resultats', 'nb_resultats','nb_resultats_total');
index d931142..8a6b1c5 100644 (file)
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: x_inscrit.tpl,v 1.12 2004-10-12 18:20:22 x2000habouzit Exp $
+        $Id: x_inscrit.tpl,v 1.13 2004-10-12 19:54:36 x2000habouzit Exp $
  ***************************************************************************}
 
 
-<div class="contact">
+<div class="contact" title="fiche mise à jour le {$c.date|date_format:"%d %b %Y"}">
   <div class="nom">
     {if $c.epouse}{$c.epouse} {$c.prenom}<br />({$c.nom} {$c.prenom}){else}{$c.nom} {$c.prenom}{/if}
     {if $c.dcd}(décédé){/if}
@@ -50,7 +50,6 @@
     {perms level='admin'}
     <a href="http://www.polytechniciens.com/index.php?page=AX_FICHE_ANCIEN&amp;anc_id={$c.matricule_ax}" onclick="return popup(this)">AX</a>
     {/perms}
-    <span class="smaller"><strong>{$c.date|date_format:"%d-%m-%Y"}</strong></span>
   </div>
   <div class="long">
     <table cellspacing="0" cellpadding="0">
index c27c490..ddab74c 100644 (file)
@@ -17,7 +17,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: search.form.tpl,v 1.17 2004-10-12 06:07:28 x2000bedo Exp $
+        $Id: search.form.tpl,v 1.18 2004-10-12 19:54:36 x2000habouzit Exp $
  ***************************************************************************}
 
 <div class="rubrique">
     </tr>
 {/if}
   </table>
-  <p class="center">
+  <div class="center">
+    <br />
+    {min_auth level='cookie'}
+    <input type='checkbox' name='mod_date_sort' {if $smarty.request.mod_date_sort}checked='checked'{/if} />
+    mettre les fiches modifiées récement en premier <br />
+    {/min_auth}
     <input type="submit" name="rechercher" value="Chercher" />
-  </p>
+    </div>
 </form>
 <p>
   <strong>N.B.</strong> Le caractère joker * peut remplacer une ou plusieurs lettres dans les recherches.
index bbdd49e..5df1d78 100644 (file)
@@ -17,7 +17,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: search.result.private.tpl,v 1.13 2004-10-12 18:20:22 x2000habouzit Exp $
+        $Id: search.result.private.tpl,v 1.14 2004-10-12 19:54:36 x2000habouzit Exp $
  ***************************************************************************}
 
 <div class="bits">
@@ -37,7 +37,6 @@
     AX
   </a>
   {/perms}
-  <span class="smaller"><strong>{$result.date|date_format:"%d-%m-%Y"}</strong></span>
 </div>
 {if $result.inscrit!=1}
 {if $result.decede != 1}
index ac21fab..84566f6 100644 (file)
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: search.result.public.tpl,v 1.5 2004-10-12 17:31:38 x2000habouzit Exp $
+        $Id: search.result.public.tpl,v 1.6 2004-10-12 19:54:36 x2000habouzit Exp $
  ***************************************************************************}
 
 <div class="nom">
   {if $result.epouse}{$result.epouse} {$result.prenom} <br />({$result.nom} {$result.prenom}){else}{$result.nom} {$result.prenom}{/if}
-  {if $result.decede == 1}
-    (décédé)
-  {/if}
+  {if $result.decede == 1}(décédé){/if}
 </div>
 <div class="appli">
   {strip}
index 4f5b1a4..b59ec8c 100644 (file)
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: search.tpl,v 1.13 2004-10-09 18:18:58 x2000habouzit Exp $
+        $Id: search.tpl,v 1.14 2004-10-12 19:54:36 x2000habouzit Exp $
  ***************************************************************************}
 
 {dynamic}
 
-{if $nb_resultats_total >= 600}{assign var='error' value="Recherche trop générale."}{/if}
+{if $nb_resultats_total >= 800}{assign var='error' value="Recherche trop générale."}{/if}
  
 {if $formulaire==0 and !$error}
+  {min_auth level='cookie'}
+  <div class="rubrique">
+    Astuce
+  </div>
+  <p>
+  Si tu survoles une fiche, tu sauras quand elle a été mise à jour la dernière fois !
+  </p>
+  {/min_auth}
   <div class="rubrique">
     Résultats
   </div>
       </td>
       <td class="right titre">
         {if $with_soundex==0}
-        <a href="{$smarty.server.PHP_SELF}?with_soundex=1&amp;rechercher=1&amp;{$url_args}">
-          Recherche par proximité sonore</a>&nbsp;
+        [<a href="{$smarty.server.PHP_SELF}?with_soundex=1&amp;rechercher=1&amp;{$url_args}">
+          Recherche par proximité sonore</a>]&nbsp;
         {/if}
-        <a href="{$smarty.server.PHP_SELF}">Nouvelle recherche</a>
+        [<a href="{$smarty.server.PHP_SELF}">Nouvelle recherche</a>]
       </td>
     </tr>
   </table>
   <div class="contact-list" style="clear:both">
     {section name=resultat loop=$resultats}
-    <div class="contact">
-    <div class="{if $resultats[resultat].inscrit==1}pri3{else}pri1{/if}">
-      {include file="search.result.public.tpl" result=$resultats[resultat]}
-      {min_auth level="cookie"}
-       {include file="search.result.private.tpl" result=$resultats[resultat]}
-      {/min_auth}
-      <div class="long"></div>
-    </div>
+    <div class="contact"
+      {min_auth level='cookie'}title="fiche mise à jour le {$resultats[resultat].date|date_format:"%d %b %Y"}"{/min_auth}>
+      <div class="{if $resultats[resultat].inscrit==1}pri3{else}pri1{/if}">
+        {include file="search.result.public.tpl" result=$resultats[resultat]}
+        {min_auth level="cookie"}
+        {include file="search.result.private.tpl" result=$resultats[resultat]}
+        {/min_auth}
+        <div class="long"></div>
+      </div>
     </div>
     {/section}
   </div>