Closes FS#189
authorx2000bedo <x2000bedo>
Sat, 27 Nov 2004 12:01:54 +0000 (12:01 +0000)
committerx2000bedo <x2000bedo>
Sat, 27 Nov 2004 12:01:54 +0000 (12:01 +0000)
+ correct xhtml problem on "recherche trop générale"

htdocs/advanced_search.php
templates/search.adv.form.tpl

index fa6c0be..56f2658 100644 (file)
@@ -18,7 +18,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: advanced_search.php,v 1.33 2004-11-22 20:04:35 x2000habouzit Exp $
+        $Id: advanced_search.php,v 1.34 2004-11-27 12:01:54 x2000bedo Exp $
  ***************************************************************************/
 
 require_once("xorg.inc.php");
@@ -42,11 +42,18 @@ function form_prepare() {
     $page->mysql_assign($sql,'choix_sections');
     $sql = 'SELECT id,text FROM applis_def ORDER BY text';
     $page->mysql_assign($sql,'choix_schools');
-    $sql = 'DESCRIBE applis_def type';
+    if (empty($_REQUEST['school']))
+        $sql = 'DESCRIBE applis_def type';
+    else
+        $sql = 'SELECT type FROM applis_def WHERE id='.$_REQUEST['school'];
     $result = $globals->db->query($sql);
     $row = mysql_fetch_row($result);
-    $types = explode('(',$row[1]);
-    $types = str_replace("'","",substr($types[1],0,-1));
+    if (empty($_REQUEST['school'])) {
+        $types = explode('(',$row[1]);
+        $types = str_replace("'","",substr($types[1],0,-1));
+    }
+    else
+        $types = $row[0];
     $page->assign('choix_diplomas',explode(',',$types));
     $sql = 'SELECT id,label FROM emploi_secteur ORDER BY label';
     $page->mysql_assign($sql,'choix_secteurs');
@@ -139,6 +146,7 @@ else {
         new ThrowError('il n\'existe personne correspondant à ces critères dans la base !');
     }
     if($page->get_template_vars('nb_resultats_total')>800) {
+        form_prepare();
         new ThrowError('Recherche trop générale');
     }
     
index 4f4180b..bdb9955 100644 (file)
@@ -17,7 +17,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: search.adv.form.tpl,v 1.1 2004-11-04 13:50:45 x2000habouzit Exp $
+        $Id: search.adv.form.tpl,v 1.2 2004-11-27 12:01:57 x2000bedo Exp $
  ***************************************************************************}
 
 <h1>Recherche avancée</h1>
     <tr>
       <td>Formation</td>
       <td>
-        <select name="school">
+        <select name="school" onchange="javascript:document.forms.recherche.submit();">
           <option value="0"></option>
           {section name=school loop=$choix_schools}
           <option value="{$choix_schools[school].id}" {if $smarty.request.school eq