pending commit, finished during MQ/S download ...
[platal.git] / include / search / classes.inc.php
index ce6fad3..5359e59 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2004 Polytechnique.org                              *
+ *  Copyright (C) 2003-2006 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -37,7 +37,7 @@ $globals->search->result_fields = '
                 es.label AS secteur, ef.fonction_fr AS fonction,
                 IF(n.nat=\'\',n.pays,n.nat) AS nat, n.a2 AS iso3166,';
 // hide private information if not logged
-if (logged()) 
+if (S::logged()) 
        $globals->search->result_fields .='
                q.profile_web AS web,
                q.profile_mobile AS mobile,
@@ -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;
     }
 }