Sfoglia il codice sorgente

Ticket #1694 - Related changes in Extended Search.

AntonLV 7 anni fa
parent
commit
6b41a4f258

+ 5 - 2
inc/classes/BxDolSearchExtendedQuery.php

@@ -55,17 +55,20 @@ class BxDolSearchExtendedQuery extends BxDolDb
                 if ($sSearchType == 'datepicker_range_age' || $sSearchType == 'datepicker_range'){
                     $sSearchValue =  BxDolService::getSerializedService($aObject['module'], 'get_search_options', array($sField, $aField['type'], $sSearchType));
                 }
-                $bResult = (int)$oDb->query("INSERT INTO `sys_search_extended_fields`(`object`, `name`, `type`, `caption`, `info`, `values`, `pass`, `search_type`, `search_value`, `search_operator`, `active`, `order`) VALUES(:object, :name, :type, :caption, :info, :values, :pass, :search_type, :search_value, :search_operator, '1', :order)", array(
+                $iActive = isset($aField['active']) ? (int)$aField['active'] : 1;
+
+                $bResult = (int)$oDb->query("INSERT INTO `sys_search_extended_fields`(`object`, `name`, `type`, `caption`, `info`, `values`, `pass`, `search_type`, `search_value`, `search_operator`, `active`, `order`) VALUES(:object, :name, :type, :caption, :info, :values, :pass, :search_type, :search_value, :search_operator, :active, :order)", array(
                     'object' => $aObject['object'], 
                     'name' => $sField,
                     'type' => $aField['type'],
                     'caption' => $sCaptionKey,
-                	'info' => $sInfoKey,
+                    'info' => $sInfoKey,
                     'values' => $aField['values'],
                     'pass' => $aField['pass'],
                     'search_type' => $sSearchType,
                     'search_value' => $sSearchValue, 
                     'search_operator' => isset($aField['search_operator']) ? $aField['search_operator'] : reset(BxDolSearchExtended::$TYPE_TO_OPERATOR[$aField['type']]),
+                    'active' => $iActive,
                     'order' => $iOrder++
                 )) > 0;
 

+ 6 - 0
modules/base/profile/classes/BxBaseModProfileModule.php

@@ -23,6 +23,12 @@ class BxBaseModProfileModule extends BxBaseModGeneralModule implements iBxDolCon
     function __construct(&$aModule)
     {
         parent::__construct($aModule);
+
+        $CNF = &$this->_oConfig->CNF;
+
+        if(!empty($CNF['FIELD_ALLOW_POST_TO']))
+            $this->_aSearchableNamesExcept[] = $CNF['FIELD_ALLOW_POST_TO'];
+
         $this->_iAccountId = getLoggedId();
     }