Adapts advanced search on addresses to our new geocoding engine (gmaps v3).
[platal.git] / modules / search.php
index c43a295..b9ae916 100644 (file)
@@ -24,15 +24,15 @@ class SearchModule extends PLModule
     function handlers()
     {
         return array(
-            'search'              => $this->make_hook('quick',          AUTH_PUBLIC),
-            'search/adv'          => $this->make_hook('advanced',       AUTH_COOKIE, 'directory_ax'),
-            'advanced_search.php' => $this->make_hook('redir_advanced', AUTH_PUBLIC),
-            'search/autocomplete' => $this->make_hook('autocomplete',   AUTH_COOKIE, 'directory_ax', NO_AUTH),
-            'search/list'         => $this->make_hook('list',           AUTH_COOKIE, 'directory_ax', NO_AUTH),
-            'jobs'                => $this->make_hook('referent',       AUTH_COOKIE),
-            'emploi'              => $this->make_hook('referent',       AUTH_COOKIE),
-            'referent/search'     => $this->make_hook('referent',       AUTH_COOKIE),
-            'search/referent/countries' => $this->make_hook('referent_countries',     AUTH_COOKIE),
+            'search'                    => $this->make_hook('quick',              AUTH_PUBLIC),
+            'search/adv'                => $this->make_hook('advanced',           AUTH_COOKIE, 'directory_ax'),
+            'advanced_search.php'       => $this->make_hook('redir_advanced',     AUTH_PUBLIC),
+            'search/autocomplete'       => $this->make_hook('autocomplete',       AUTH_COOKIE, 'directory_ax', NO_AUTH),
+            'search/list'               => $this->make_hook('list',               AUTH_COOKIE, 'directory_ax', NO_AUTH),
+            'jobs'                      => $this->make_hook('referent',           AUTH_COOKIE),
+            'emploi'                    => $this->make_hook('referent',           AUTH_COOKIE),
+            'referent/search'           => $this->make_hook('referent',           AUTH_COOKIE),
+            'search/referent/countries' => $this->make_hook('referent_countries', AUTH_COOKIE),
         );
     }
 
@@ -96,8 +96,7 @@ class SearchModule extends PLModule
                 if ($user) {
                     pl_redirect($base . $user->login());
                 }
-                $_REQUEST['quick'] = $login;
-                $_GET['quick'] = $login;
+                Get::set('quick', $login);
             } elseif (strpos($quick, 'doc:') === 0) {
                 $url = 'Docs/Recherche?';
                 $url .= 'action=search&q=' . urlencode(substr($quick, 4));
@@ -157,6 +156,18 @@ class SearchModule extends PLModule
         $networks[0] = '-';
         ksort($networks);
         $page->assign('networking_types', $networks);
+        $origin_corps_list = DirEnum::getOptions(DirEnum::CURRENTCORPS);
+        $current_corps_list = DirEnum::getOptions(DirEnum::ORIGINCORPS);
+        $corps_rank_list = DirEnum::getOptions(DirEnum::CORPSRANKS);
+        $origin_corps_list[0] = '-';
+        $current_corps_list[0] = '-';
+        $corps_rank_list[0] = '-';
+        ksort($origin_corps_list);
+        ksort($current_corps_list);
+        ksort($corps_rank_list);
+        $page->assign('origin_corps_list', $origin_corps_list);
+        $page->assign('current_corps_list', $current_corps_list);
+        $page->assign('corps_rank_list', $corps_rank_list);
 
         if (!Env::has('rechercher') && $model != 'geoloc') {
             $this->form_prepare();