migrate search module.
authorx2000habouzit <x2000habouzit@839d8a87-29fc-0310-9880-83ba4fa771e5>
Tue, 4 Jul 2006 19:15:00 +0000 (19:15 +0000)
committerx2000habouzit <x2000habouzit@839d8a87-29fc-0310-9880-83ba4fa771e5>
Tue, 4 Jul 2006 19:15:00 +0000 (19:15 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@364 839d8a87-29fc-0310-9880-83ba4fa771e5

18 files changed:
ChangeLog
hooks/search.inc.php
htdocs/advanced_search.php [deleted file]
htdocs/search.php [deleted file]
install.d/search.files
modules/search.php [new file with mode: 0644]
templates/carnet/notifs.tpl
templates/docs/services.tpl
templates/geoloc/index.tpl
templates/index.tpl
templates/marketing/index.tpl
templates/search/adv.form.tpl [moved from templates/search.adv.form.tpl with 99% similarity]
templates/search/adv.links.tpl [moved from templates/search.adv.links.tpl with 97% similarity]
templates/search/index.tpl [moved from templates/search.tpl with 92% similarity]
templates/search/quick.form.tpl [moved from templates/search.quick.form.tpl with 94% similarity]
templates/search/quick.tpl [moved from templates/search.quick.tpl with 98% similarity]
templates/skin/common.header.tpl
templates/skin/common.title.header.tpl

index 56dbca4..90e7d3c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,7 +7,11 @@ New:
         - Work hard to add nice URI's into Platal.                          -MC
 
     * Emails:
-        - Switch to the new URI scheme, into email module.                  -MC
+        - Switch to the new URI scheme.                                     -MC
+
+    * Search:
+        - Switch to the new URI scheme.                                     -MC
+
 
 ================================================================================
 VERSION 0.9.10                                                      29 Juin 2006
index 0559161..f102adb 100644 (file)
@@ -52,8 +52,8 @@ function search_subscribe($forlife, $uid, $promo, $pass)
 function search_menu()
 {
     global $globals;
-    $globals->menu->addPrivateEntry(XOM_GROUPS, 00, 'Annuaire',         'search.php');
-    $globals->menu->addPublicEntry(XOM_EXT,     00, 'Annuaire de l\'X', 'search.php');
+    $globals->menu->addPrivateEntry(XOM_GROUPS, 00, 'Annuaire',         'search');
+    $globals->menu->addPublicEntry(XOM_EXT,     00, 'Annuaire de l\'X', 'search');
 }
 
 // }}}
diff --git a/htdocs/advanced_search.php b/htdocs/advanced_search.php
deleted file mode 100644 (file)
index 802a693..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-<?php
-/***************************************************************************
- *  Copyright (C) 2003-2006 Polytechnique.org                              *
- *  http://opensource.polytechnique.org/                                   *
- *                                                                         *
- *  This program is free software; you can redistribute it and/or modify   *
- *  it under the terms of the GNU General Public License as published by   *
- *  the Free Software Foundation; either version 2 of the License, or      *
- *  (at your option) any later version.                                    *
- *                                                                         *
- *  This program is distributed in the hope that it will be useful,        *
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
- *  GNU General Public License for more details.                           *
- *                                                                         *
- *  You should have received a copy of the GNU General Public License      *
- *  along with this program; if not, write to the Free Software            *
- *  Foundation, Inc.,                                                      *
- *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
- ***************************************************************************/
-
-require_once("xorg.inc.php");
-require_once('search.inc.php');
-if (Env::get('display')!='mini')
-    new_skinned_page('search.tpl', AUTH_COOKIE);
-else
-    new_simple_page('search.tpl', AUTH_COOKIE);
-$page->assign('advanced',1);
-$page->assign('public_directory',0);
-$page->assign('use_map', $globals->geoloc->use_map());
-require_once("applis.func.inc.php");
-require_once("geoloc.inc.php");
-
-// {{{ function form_prepare()
-
-function form_prepare()
-{
-    global $page,$globals;
-    $page->assign('formulaire',1);
-    $page->assign('choix_nats',     $globals->xdb->iterator('SELECT a2 AS id,IF(nat=\'\',pays,nat) AS text FROM geoloc_pays ORDER BY text'));
-    $page->assign('choix_postes',   $globals->xdb->iterator('SELECT id,fonction_fr FROM fonctions_def ORDER BY fonction_fr'));
-    $page->assign('choix_binets',   $globals->xdb->iterator('SELECT id,text FROM binets_def ORDER BY text'));
-    $page->assign('choix_groupesx', $globals->xdb->iterator('SELECT id,text FROM groupesx_def ORDER BY text'));
-    $page->assign('choix_sections', $globals->xdb->iterator('SELECT id,text FROM sections ORDER BY text'));
-    $page->assign('choix_schools',  $globals->xdb->iterator('SELECT id,text FROM applis_def ORDER BY text'));
-    $page->assign('choix_secteurs', $globals->xdb->iterator('SELECT id,label FROM emploi_secteur ORDER BY label'));
-
-    if (Env::has('school')) {
-        $sql = 'SELECT type FROM applis_def WHERE id='.Env::getInt('school');
-    } else {
-        $sql = 'DESCRIBE applis_def type';
-    }
-    $res = $globals->xdb->query($sql);
-    $row = $res->fetchOneRow();
-    if (Env::has('school')) {
-        $types = $row[0];
-    } else {
-        $types = explode('(',$row[1]);
-        $types = str_replace("'","",substr($types[1],0,-1));
-    }
-    $page->assign('choix_diplomas', explode(',',$types));
-}
-
-// }}}
-
-if (!Env::has('rechercher')) {
-    form_prepare();
-} else {
-
-// {{{ function get_list()
-
-    function get_list($offset, $limit, $order) {
-        $fields = new SFieldGroup(true, advancedSearchFromInput());
-        if ($fields->too_large()) {
-            form_prepare();
-            new ThrowError('Recherche trop générale.');
-        }
-        global $globals, $page;
-  
-                       $page->assign('search_vars', $fields->get_url());
-                       
-        $where = $fields->get_where_statement();
-        if ($where) {
-            $where = "WHERE  $where";
-        }
-        $sql = 'SELECT SQL_CALC_FOUND_ROWS DISTINCT
-                           u.nom, u.prenom,
-                           '.$globals->search->result_fields.'
-                           c.uid AS contact,
-                           w.ni_id AS watch
-                     FROM  auth_user_md5   AS u 
-               LEFT JOIN  auth_user_quick AS q USING(user_id)
-                '.$fields->get_select_statement().'
-                '.(Env::has('only_referent') ? ' INNER JOIN mentor AS m ON (m.uid = u.user_id)' : '').'
-                LEFT JOIN  aliases        AS a ON (u.user_id = a.id AND a.type="a_vie")
-                LEFT JOIN  contacts       AS c ON (c.uid='.Session::getInt('uid').' AND c.contact=u.user_id)
-                LEFT JOIN  watch_nonins   AS w ON (w.ni_id=u.user_id AND w.uid='.Session::getInt('uid').')
-                '.$globals->search->result_where_statement."
-                    $where
-                 ORDER BY  ".($order?($order.', '):'')
-                       .implode(',',array_filter(array($fields->get_order_statement(), 'promo DESC, NomSortKey, prenom'))).'
-                    LIMIT  '.($offset * $limit).','.$limit;
-        $liste   = $globals->xdb->iterator($sql);
-        $res     = $globals->xdb->query("SELECT  FOUND_ROWS()");
-        $nb_tot  = $res->fetchOneCell();
-        return Array($liste, $nb_tot);
-    }
-
-// }}}
-
-    $search = new XOrgSearch('get_list');
-    $search->setNbLines($globals->search->per_page);
-            
-    $page->assign('url_search_form', $search->make_url(Array('rechercher'=>0)));
-    $page->assign('with_soundex', Env::has('with_soundex')?"":($search->make_url(Array())."&with_soundex=1"));
-    
-    $nb_tot = $search->show();
-    
-    if ($nb_tot > $globals->search->private_max) {
-        form_prepare();
-        new ThrowError('Recherche trop générale');
-    }
-    
-}
-
-$page->register_modifier('display_lines', 'display_lines');
-$page->run();
-
-// vim:set et sws=4 sw=4 sts=4:
-?>
diff --git a/htdocs/search.php b/htdocs/search.php
deleted file mode 100644 (file)
index 25ac38e..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-<?php
-/***************************************************************************
- *  Copyright (C) 2003-2006 Polytechnique.org                              *
- *  http://opensource.polytechnique.org/                                   *
- *                                                                         *
- *  This program is free software; you can redistribute it and/or modify   *
- *  it under the terms of the GNU General Public License as published by   *
- *  the Free Software Foundation; either version 2 of the License, or      *
- *  (at your option) any later version.                                    *
- *                                                                         *
- *  This program is distributed in the hope that it will be useful,        *
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
- *  GNU General Public License for more details.                           *
- *                                                                         *
- *  You should have received a copy of the GNU General Public License      *
- *  along with this program; if not, write to the Free Software            *
- *  Foundation, Inc.,                                                      *
- *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
- ***************************************************************************/
-
-require_once("xorg.inc.php");
-require_once("search.inc.php");
-
-new_skinned_page('search.tpl', AUTH_PUBLIC);
-if (logged()) {
-    new_skinned_page('search.tpl', AUTH_COOKIE);
-}
-
-$page->assign('xorg_title','Polytechnique.org - Annuaire');
-require_once("applis.func.inc.php");
-require_once("geoloc.inc.php");
-
-$page->assign('baseurl', $globals->baseurl);
-
-if (Env::has('quick')) {
-    $page->assign('formulaire', 0);
-
-    // {{{ get_list
-    function get_list($offset, $limit, $order) {
-        global $globals;
-        $qSearch = new QuickSearch('quick');
-        $fields  = new SFieldGroup(true, array($qSearch));
-
-        if ($qSearch->isempty()) {
-            new ThrowError('Recherche trop générale.');
-        }
-       
-        $sql = 'SELECT SQL_CALC_FOUND_ROWS
-                           UPPER(IF(u.nom!="",u.nom,u.nom_ini)) AS nom,
-                           IF(u.prenom!="",u.prenom,u.prenom_ini) AS prenom,
-                           '.$globals->search->result_fields.'
-                           c.uid AS contact,
-                           w.ni_id AS watch,
-                           '.$qSearch->get_score_statement().'
-                     FROM  auth_user_md5  AS u
-                '.$fields->get_select_statement().'
-                LEFT JOIN  auth_user_quick AS q  ON (u.user_id = q.user_id)
-                LEFT JOIN  aliases        AS a   ON (u.user_id = a.id AND a.type="a_vie")
-                LEFT JOIN  contacts       AS c   ON (c.uid='.Session::getInt('uid').' AND c.contact=u.user_id)
-                LEFT JOIN  watch_nonins   AS w   ON (w.ni_id=u.user_id AND w.uid='.Session::getInt('uid').')
-                '.$globals->search->result_where_statement.'
-                    WHERE  '.$fields->get_where_statement().(logged() && Env::has('nonins') ? ' AND u.perms="pending" AND u.deces=0' : '').'
-                 GROUP BY  u.user_id
-                 ORDER BY '.($order?($order.', '):'')
-                            .implode(',',array_filter(array($fields->get_order_statement(), 'u.promo DESC, NomSortKey, prenom'))).'
-                    LIMIT  '.$offset * $globals->search->per_page.','.$globals->search->per_page;
-        $list    = $globals->xdb->iterator($sql);
-        $res     = $globals->xdb->query("SELECT  FOUND_ROWS()");
-        $nb_tot  = $res->fetchOneCell();
-        return array($list, $nb_tot);
-    }
-
-    // }}}
-
-    $search = new XOrgSearch(get_list);
-    $search->setNbLines($globals->search->per_page);
-    $search->addOrder('score', 'score', false, 'pertinence', AUTH_PUBLIC, true);
-    
-    $nb_tot = $search->show();
-
-    if (!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');
-    } elseif (empty($nb_tot)) {
-        new ThrowError('il n\'existe personne correspondant à ces critères dans la base !');
-    }
-
-} else {
-    $page->assign('formulaire',1);
-}
-
-$page->register_modifier('display_lines', 'display_lines');
-$page->run();
-
-// vim:set et sws=4 sw=4 sts=4:
-?>
index 9f333ce..3f345bb 100644 (file)
@@ -1,5 +1,3 @@
-htdocs/advanced_search.php
-htdocs/search.php
 include/search.inc.php
 bin/cron/recherche.php
 templates/search.adv.form.tpl
diff --git a/modules/search.php b/modules/search.php
new file mode 100644 (file)
index 0000000..3400caf
--- /dev/null
@@ -0,0 +1,237 @@
+<?php
+/***************************************************************************
+ *  Copyright (C) 2003-2006 Polytechnique.org                              *
+ *  http://opensource.polytechnique.org/                                   *
+ *                                                                         *
+ *  This program is free software; you can redistribute it and/or modify   *
+ *  it under the terms of the GNU General Public License as published by   *
+ *  the Free Software Foundation; either version 2 of the License, or      *
+ *  (at your option) any later version.                                    *
+ *                                                                         *
+ *  This program is distributed in the hope that it will be useful,        *
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
+ *  GNU General Public License for more details.                           *
+ *                                                                         *
+ *  You should have received a copy of the GNU General Public License      *
+ *  along with this program; if not, write to the Free Software            *
+ *  Foundation, Inc.,                                                      *
+ *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
+ ***************************************************************************/
+
+class SearchModule extends PLModule
+{
+    function handlers()
+    {
+        return array(
+            'search'     => $this->make_hook('quick', AUTH_PUBLIC),
+            'search/adv' => $this->make_hook('advanced', AUTH_COOKIE),
+        );
+    }
+
+    function get_quick($offset, $limit, $order)
+    {
+        global $globals;
+        $qSearch = new QuickSearch('quick');
+        $fields  = new SFieldGroup(true, array($qSearch));
+
+        if ($qSearch->isempty()) {
+            new ThrowError('Recherche trop générale.');
+        }
+
+        $sql = 'SELECT SQL_CALC_FOUND_ROWS
+            UPPER(IF(u.nom!="",u.nom,u.nom_ini)) AS nom,
+            IF(u.prenom!="",u.prenom,u.prenom_ini) AS prenom,
+            '.$globals->search->result_fields.'
+            c.uid AS contact, w.ni_id AS watch,
+            '.$qSearch->get_score_statement().'
+                FROM  auth_user_md5  AS u
+                '.$fields->get_select_statement().'
+                LEFT JOIN  auth_user_quick AS q  ON (u.user_id = q.user_id)
+                LEFT JOIN  aliases         AS a  ON (u.user_id = a.id AND a.type="a_vie")
+                LEFT JOIN  contacts        AS c  ON (c.uid='.Session::getInt('uid').'
+                                                     AND c.contact=u.user_id)
+                LEFT JOIN  watch_nonins    AS w  ON (w.ni_id=u.user_id
+                                                     AND w.uid='.Session::getInt('uid').')
+                '.$globals->search->result_where_statement.'
+                    WHERE  '.$fields->get_where_statement()
+                    .(logged() && Env::has('nonins') ? ' AND u.perms="pending" AND u.deces=0' : '')
+                .'
+                 GROUP BY  u.user_id
+                 ORDER BY  '.($order?($order.', '):'')
+                .implode(',',array_filter(array($fields->get_order_statement(),
+                                                'u.promo DESC, NomSortKey, prenom'))).'
+                    LIMIT  '.$offset * $globals->search->per_page.','
+                .$globals->search->per_page;
+        $list    = $globals->xdb->iterator($sql);
+        $res     = $globals->xdb->query("SELECT  FOUND_ROWS()");
+        $nb_tot  = $res->fetchOneCell();
+        return array($list, $nb_tot);
+    }
+
+    function form_prepare()
+    {
+        global $page,$globals;
+
+        $page->assign('formulaire',1);
+        $page->assign('choix_nats',
+                      $globals->xdb->iterator('SELECT a2 AS id,IF(nat=\'\',pays,nat) AS text
+                                                 FROM geoloc_pays ORDER BY text'));
+        $page->assign('choix_postes',
+                      $globals->xdb->iterator('SELECT id,fonction_fr FROM fonctions_def
+                                             ORDER BY fonction_fr'));
+        $page->assign('choix_binets',
+                      $globals->xdb->iterator('SELECT id,text FROM binets_def ORDER BY text'));
+        $page->assign('choix_groupesx',
+                      $globals->xdb->iterator('SELECT id,text FROM groupesx_def ORDER BY text'));
+        $page->assign('choix_sections',
+                      $globals->xdb->iterator('SELECT id,text FROM sections ORDER BY text'));
+        $page->assign('choix_schools',
+                      $globals->xdb->iterator('SELECT id,text FROM applis_def ORDER BY text'));
+        $page->assign('choix_secteurs',
+                      $globals->xdb->iterator('SELECT id,label FROM emploi_secteur ORDER BY label'));
+
+        if (Env::has('school')) {
+            $sql = 'SELECT type FROM applis_def WHERE id='.Env::getInt('school');
+        } else {
+            $sql = 'DESCRIBE applis_def type';
+        }
+
+        $res = $globals->xdb->query($sql);
+        $row = $res->fetchOneRow();
+        if (Env::has('school')) {
+            $types = $row[0];
+        } else {
+            $types = explode('(',$row[1]);
+            $types = str_replace("'","",substr($types[1],0,-1));
+        }
+        $page->assign('choix_diplomas', explode(',',$types));
+    }
+
+    function get_advanced($offset, $limit, $order)
+    {
+        $fields = new SFieldGroup(true, advancedSearchFromInput());
+        if ($fields->too_large()) {
+            $this->form_prepare();
+            new ThrowError('Recherche trop générale.');
+        }
+        global $globals, $page;
+
+                       $page->assign('search_vars', $fields->get_url());
+
+        $where = $fields->get_where_statement();
+        if ($where) {
+            $where = "WHERE  $where";
+        }
+        $sql = 'SELECT SQL_CALC_FOUND_ROWS DISTINCT
+                           u.nom, u.prenom,
+                           '.$globals->search->result_fields.'
+                           c.uid AS contact,
+                           w.ni_id AS watch
+                     FROM  auth_user_md5   AS u
+               LEFT JOIN  auth_user_quick AS q USING(user_id)
+                '.$fields->get_select_statement().'
+                '.(Env::has('only_referent') ? ' INNER JOIN mentor AS m ON (m.uid = u.user_id)' : '').'
+                LEFT JOIN  aliases        AS a ON (u.user_id = a.id AND a.type="a_vie")
+                LEFT JOIN  contacts       AS c ON (c.uid='.Session::getInt('uid').'
+                                                   AND c.contact=u.user_id)
+                LEFT JOIN  watch_nonins   AS w ON (w.ni_id=u.user_id
+                                                   AND w.uid='.Session::getInt('uid').')
+                '.$globals->search->result_where_statement."
+                    $where
+                 ORDER BY  ".($order?($order.', '):'')
+                .implode(',',array_filter(array($fields->get_order_statement(),
+                                                'promo DESC, NomSortKey, prenom'))).'
+                    LIMIT  '.($offset * $limit).','.$limit;
+        $liste   = $globals->xdb->iterator($sql);
+        $res     = $globals->xdb->query("SELECT  FOUND_ROWS()");
+        $nb_tot  = $res->fetchOneCell();
+        return Array($liste, $nb_tot);
+    }
+
+    function handler_quick(&$page)
+    {
+        global $globals;
+
+        require_once 'search.inc.php';
+
+        $page->changeTpl('search/index.tpl');
+
+        $page->assign('xorg_title','Polytechnique.org - Annuaire');
+        require_once("applis.func.inc.php");
+        require_once("geoloc.inc.php");
+
+        $page->assign('baseurl', $globals->baseurl);
+
+        if (Env::has('quick')) {
+            $page->assign('formulaire', 0);
+
+            $search = new XOrgSearch(array($this, 'get_quick'));
+            $search->setNbLines($globals->search->per_page);
+            $search->addOrder('score', 'score', false, 'pertinence', AUTH_PUBLIC, true);
+
+            $nb_tot = $search->show();
+
+            if (!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');
+            } elseif (empty($nb_tot)) {
+                new ThrowError('il n\'existe personne correspondant à ces critères dans la base !');
+            }
+        } else {
+            $page->assign('formulaire',1);
+        }
+
+        $page->register_modifier('display_lines', 'display_lines');
+
+        return PL_OK;
+    }
+
+    function handler_advanced(&$page, $mode = null)
+    {
+        global $globals;
+
+        require_once 'search.inc.php' ;
+        require_once 'applis.func.inc.php';
+        require_once 'geoloc.inc.php';
+
+
+        $page->changeTpl('search/index.tpl');
+
+        if ($mode == 'mini') {
+            $page->assign('simple', true);
+        }
+
+        $page->assign('advanced',1);
+        $page->assign('public_directory',0);
+        $page->assign('use_map', $globals->geoloc->use_map());
+
+        if (!Env::has('rechercher')) {
+            $this->form_prepare();
+        } else {
+
+            $search = new XOrgSearch('get_list');
+            $search->setNbLines($globals->search->per_page);
+
+            $page->assign('url_search_form', $search->make_url(Array('rechercher'=>0)));
+            if (Env::has('with_soundex')) {
+                $page->assign('with_soundex', $search->make_url(Array())."&with_soundex=1");
+            }
+
+            $nb_tot = $search->show();
+
+            if ($nb_tot > $globals->search->private_max) {
+                $this->form_prepare();
+                new ThrowError('Recherche trop générale');
+            }
+
+        }
+
+        $page->register_modifier('display_lines', 'display_lines');
+
+        return PL_OK;
+    }
+}
+
+?>
index 7d954a5..878e199 100644 (file)
@@ -99,7 +99,7 @@ Si un non-inscrit que tu surveilles s'inscrit, il sera automatiquement ajout
 </p>
 
 <p>
-Pour surveiller des membres non-inscrits, il faut passer par la <a href="{"search.php"|url}" class='popup'>recherche</a>
+Pour surveiller des membres non-inscrits, il faut passer par la <a href="{rel}/search" class='popup'>recherche</a>
 et cliquer sur les icones <img src="{"images/ajouter.gif"|url}" alt="Ajouter" /> pour les ajouter à cette liste
 </p>
 
index 68b1ad2..c414d83 100644 (file)
@@ -41,7 +41,7 @@ antispam</a>.
 </p>
 
 <p>
-Le site héberge également un <a href="{"search.php"|url}">annuaire complet</a> que
+Le site héberge également un <a href="{rel}/search">annuaire complet</a> que
 tu peux consulter pour obtenir des renseignements sur un camarade, sur tes
 cocons. Il te permet aussi <a href="{"profil.php"|url}">d'enrichir et de compléter</a>
 ta fiche personnelle. Cet annuaire a une vocation professionnelle puisque
index 00a10c4..122cace 100644 (file)
@@ -74,7 +74,7 @@ function searchMapId(f)
   </p>
   <p class="smaller">Carte fournie gracieusement par <a href="http://www.geodesix.com/">Geodesix</a>.</p>
   {if !$no_annu}
-    <form id="search_form" action="{#globals.baseurl#}/advanced_search.php?{$dynamap_vars|default:"only_current=on"}&amp;rechercher=1" method="post">
+    <form id="search_form" action="{rel}/search/adv/?{$dynamap_vars|default:"only_current=on"}&amp;rechercher=1" method="post">
     <p>
        <input type="button" value="Lister les camarades de la carte ci-dessus" onclick="searchMapId(this.form)"/>
     </p>
index b7af15e..5d2d697 100644 (file)
@@ -46,7 +46,7 @@
    <br />
   <strong>Dans tous les cas,</strong> vous pouvez :
   <ul>
-   <li class="spaced"><strong><a href="search.php">rechercher un ancien élève ou un élève</a></strong> dans l'annuaire en ligne,</li>
+   <li class="spaced"><strong><a href="{rel}/search">rechercher un ancien élève ou un élève</a></strong> dans l'annuaire en ligne,</li>
    <li class="spaced"><strong><a href="http://asso.polytechnique.org/">accéder à la liste des sites en rapport avec l'École</a></strong> - les sites officiels de l'École sont <a href="http://www.polytechnique.fr">polytechnique.fr</a> et <a href="http://www.polytechnique.edu">polytechnique.edu</a>, le portail des X sur le web est <a href="http://www.polytechnique.org/">polytechnique.org</a>, et le site de l'amicale des Anciens Eleves (AX) est <a href="http://www.polytechniciens.com/">polytechniciens.com</a>.</li>
   </ul>
  
index 18e6004..c7ba536 100644 (file)
@@ -32,7 +32,7 @@
   </tr>
   <tr class="impair">
     <td>
-      <a href="{rel}/search.php?nonins=1">Chercher un non inscrit</a>
+      <a href="{rel}/search?nonins=1">Chercher un non inscrit</a>
       &nbsp;&nbsp;|&nbsp;&nbsp;
       <a href="promo.php">Marketing promo</a>
       &nbsp;&nbsp;|&nbsp;&nbsp;
similarity index 99%
rename from templates/search.adv.form.tpl
rename to templates/search/adv.form.tpl
index 5d65c14..6da13d9 100644 (file)
@@ -22,7 +22,7 @@
 
 <h1>Recherche avancée</h1>
 
-<p>[<a href="search.php">Recherche simple</a>]</p>
+<p>[<a href="{rel}/search">Recherche simple</a>]</p>
 
 <form id="recherche" action="{$smarty.server.PHP_SELF}" method="get">
   <table class="bicol" cellpadding="3" summary="Recherche">
similarity index 97%
rename from templates/search.adv.links.tpl
rename to templates/search/adv.links.tpl
index 6a61cd9..6abf952 100644 (file)
@@ -40,7 +40,7 @@
   </li>
   
   <li>Effectuer une nouvelle <strong>
-    <a href="{"search.php"|url}">recherche simple</a>
+    <a href="{rel}/search">recherche simple</a>
   </strong>
   </li>
 </ul>
similarity index 92%
rename from templates/search.tpl
rename to templates/search/index.tpl
index 61cee13..823ca34 100644 (file)
@@ -24,9 +24,9 @@
 {if $formulaire==0 and !$xorg_errors|count}
   {if !$simple}
     {if !$advanced}
-    {include file='search.quick.form.tpl' show_js=1}
+    {include file=search/quick.form.tpl show_js=1}
     {else}
-    {include file=search.adv.links.tpl do_title=1 with_soundex=$with_soundex}
+    {include file=search/adv.links.tpl do_title=1 with_soundex=$with_soundex}
     {/if}
   {/if}
 
@@ -86,9 +86,9 @@
   <br />
   {if $smarty.capture.list|smarty:nodefaults|display_lines > 20}
   {if $advanced}
-  {include file=search.adv.links.tpl do_title=1}
+  {include file=search/adv.links.tpl do_title=1}
   {else}
-  {include file='search.quick.form.tpl'}
+  {include file=search/quick.form.tpl}
   {/if}
   {/if}
   
@@ -98,9 +98,9 @@
   {/min_auth}
 {else}
   {if $advanced}
-  {include file="search.adv.form.tpl"}
+  {include file=search/adv.form.tpl}
   {else}
-  {include file="search.quick.tpl"}
+  {include file=search/quick.tpl}
   {/if}
 {/if}
 
similarity index 94%
rename from templates/search.quick.form.tpl
rename to templates/search/quick.form.tpl
index 6019153..466faf4 100644 (file)
@@ -22,7 +22,7 @@
 
 <h1>Recherche simple dans l'annuaire</h1>
 
-<form action="{"search.php"|url}" method="get"{if $show_js} id="quick_form"{/if}>
+<form action="{rel}/search" method="get"{if $show_js} id="quick_form"{/if}>
   <table class="bicol" cellspacing="0" cellpadding="4">
     <tr>
       <td style="width: 78%">
@@ -38,7 +38,7 @@
       <td>
         <input type="submit" value="Chercher" />
         {min_auth level="cookie"}
-        <br /><a class='smaller' href="advanced_search.php">Recherche&nbsp;avancée</a>
+        <br /><a class='smaller' href="{rel}/search/adv">Recherche&nbsp;avancée</a>
         {/min_auth}
       </td>
     </tr>
similarity index 98%
rename from templates/search.quick.tpl
rename to templates/search/quick.tpl
index 8e37381..09bd0c8 100644 (file)
@@ -20,7 +20,7 @@
 {*                                                                        *}
 {**************************************************************************}
 
-{include file="search.quick.form.tpl" show_js=1}
+{include file=search/quick.form.tpl show_js=1}
 <h1>Comment faire une recherche ?</h1>
 
 <h2>Nom, Prenom, Promo ...</h2>
index 41b1f06..9f516e7 100644 (file)
@@ -28,7 +28,7 @@
     
     <link rel="index" href="{rel}/index.php" />
     <link rel="author" href="{rel}/Docs/FAQ" />
-    <link rel="search" href="{rel}/search.php" />
+    <link rel="search" href="{rel}/search" />
     <link rel="help" href="{rel}/Docs/FAQ" />
     <link rel="bookmark" href="http://www.polytechnique.fr/"        title="| École polytechnique" />
     <link rel="bookmark" href="http://www.polytechnique.edu/"       title="| Institutionnal site" />
index 4edc86f..1ad7fda 100644 (file)
@@ -30,7 +30,7 @@
               </td>\r
               <td class="inscrits">\r
                 {insert name="getNbIns"} polytechniciens sur le web\r
-                <form action="{rel}/search.php" method="get">\r
+                <form action="{rel}/search" method="get">\r
                     <div>\r
                         <input type="text" size="30" name="quick" id="quick_search" value="{$smarty.request.quick|default:"recherche dans l'annuaire"}" onfocus="if (this.value == '{$smarty.request.quick|default:"recherche dans l'annuaire"|escape:javascript}') this.value=''" onblur="if (this.value == '') this.value='{$smarty.request.quick|default:"recherche dans l'annuaire"|escape:javascript}'"/>                        \r
                     </div>\r