Table editor fills the new entry form with the default values of the fields
[platal.git] / modules / geoloc.php
index e65af0e..f54f57e 100644 (file)
@@ -68,16 +68,17 @@ class GeolocModule extends PLModule
             $page->assign('request_geodesix', 1);
 
         if (!empty($GLOBALS['IS_XNET_SITE'])) {
-            $page->useMenu();
-            $page->setType($globals->asso('cat'));
             $page->assign('no_annu', 1);
+            new_annu_page('geoloc/index.tpl');
+        } else {
+            $page->changeTpl('geoloc/index.tpl');
         }
 
-        require_once 'search.inc.php';
-        $page->changeTpl('geoloc/index.tpl');
+        require_once dirname(__FILE__).'/search/search.inc.php';
+
         $fields = new SFieldGroup(true, advancedSearchFromInput());
         $search = str_replace('&','&',$fields->get_url());
-        if (!Env::has('only_current'))
+        if ((!Env::has('only_current') && !Env::has('rechercher')) || Env::v('only_current') == 'on')
             $search .= '&only_current=on';
         elseif (Env::i('only_current') != 'on')
             $search .= '&only_current=';
@@ -144,8 +145,8 @@ class GeolocModule extends PLModule
 
         $page->changeTpl('geoloc/city.tpl', NO_SKIN);
 
+        require_once dirname(__FILE__).'/search/search.inc.php';
         require_once('geoloc.inc.php');
-        require_once('search.inc.php');
 
         if (empty($GLOBALS['IS_XNET_SITE'])) {
             $usual_fields = advancedSearchFromInput();
@@ -186,8 +187,8 @@ class GeolocModule extends PLModule
             $page->changeTpl('geoloc/country.tpl', NO_SKIN);
         }
 
+        require_once dirname(__FILE__).'/search/search.inc.php';
         require_once 'geoloc.inc.php';
-        require_once 'search.inc.php';
 
         $querystring = $this->_make_qs();
         $page->assign('searchvars', $querystring);