backport fix sur la recherche avancee
authorx2001corpet <x2001corpet@839d8a87-29fc-0310-9880-83ba4fa771e5>
Fri, 30 Jun 2006 13:13:49 +0000 (13:13 +0000)
committerx2001corpet <x2001corpet@839d8a87-29fc-0310-9880-83ba4fa771e5>
Fri, 30 Jun 2006 13:13:49 +0000 (13:13 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@350 839d8a87-29fc-0310-9880-83ba4fa771e5

include/search/classes.inc.php

index 8a6c364..c164852 100644 (file)
@@ -447,14 +447,15 @@ class MapSField extends RefSField
        
     function MapSField($_fieldFormName, $_fieldDbName='', $_refTable, $_refAlias, $_refCondition, $_mapId=false)
     {
-       if ($_mapId === false)
-               $this->mapId = Env::get($_fieldFormName);
-                       else
-                               $this->mapId = $_mapId;
-       $this->RefSField($_fieldFormName, $_fieldDbName, $_refTable, $_refAlias, $_refCondition, true, false);
+        if ($_mapId === false)
+            $this->mapId = Env::get($_fieldFormName, '');
+        else
+            $this->mapId = $_mapId;
+        $this->RefSField($_fieldFormName, $_fieldDbName, $_refTable, $_refAlias, $_refCondition, true, false);
     }
     function get_select_statement()
     {
+        if ($this->mapId === '') return false;
         $res = implode(' OR ', array_filter(array_map(array($this, 'get_single_match_statement'), $this->fieldDbName)));
         foreach ($this->refTable as $i => $refT)
             $last = $i;
@@ -465,7 +466,7 @@ class MapSField extends RefSField
     }
     function get_request()
     {
-       $this->value = $this->mapId;
+        $this->value = $this->mapId;
     }
 }