public static function getSearchFields() { if (!isset(self::$_cache['fields'])) { self::$_cache['fields'] = array(self::TERM => array('status' => SearchFormModel::STATUS_STANDARD, 'translate' => 'Search by term'), self::SEARCH_AP_TYPE => array('status' => SearchFormModel::STATUS_STANDARD, 'translate' => 'Search in section'), self::SEARCH_OBJ_TYPE => array('status' => SearchFormModel::STATUS_STANDARD, 'translate' => 'Property type'), self::SEARCH_LOCATION => array('status' => SearchFormModel::STATUS_STANDARD, 'translate' => 'Search by location'), self::SEARCH_ROOMS => array('status' => SearchFormModel::STATUS_STANDARD, 'translate' => 'Rooms range'), self::SEARCH_PRICE => array('status' => SearchFormModel::STATUS_STANDARD, 'translate' => 'Price range'), self::SEARCH_SQUARE => array('status' => SearchFormModel::STATUS_STANDARD, 'translate' => 'Square range'), self::SEARCH_FLOOR => array('status' => SearchFormModel::STATUS_STANDARD, 'translate' => 'Floor range'), self::SEARCH_BY_ID => array('status' => SearchFormModel::STATUS_STANDARD, 'translate' => 'Apartment ID'), self::SEARCH_BY_LAND_SQUARE => array('status' => SearchFormModel::STATUS_STANDARD, 'translate' => 'Apartment square to'), self::SEARCH_WITH_PHOTO => array('status' => SearchFormModel::STATUS_STANDARD, 'translate' => 'Only with photo'), self::SEARCH_OWNER_TYPE => array('status' => SearchFormModel::STATUS_STANDARD, 'translate' => 'Listing from'), self::SEARCH_BOOKING => array('status' => SearchFormModel::STATUS_STANDARD, 'translate' => 'Booking')); if (issetModule('formeditor')) { $newFieldsAll = FormDesigner::getNewFields(); foreach ($newFieldsAll as $field) { self::$_cache['fields'][$field->field] = array('status' => SearchFormModel::STATUS_NEW_FIELD, 'translate' => 'Search by ' . $field->field, 'formdesigner_id' => $field->id); } } } return self::$_cache['fields']; }
public static function getSearchFields() { if (!isset(self::$_cache['fields'])) { self::$_cache['fields'] = array(self::SEARCH_AP_TYPE => array('status' => SearchFormModel::STATUS_STANDARD, 'translate' => 'Search in section'), self::SEARCH_OBJ_TYPE => array('status' => SearchFormModel::STATUS_STANDARD, 'translate' => 'Property type'), self::SEARCH_ROOMS => array('status' => SearchFormModel::STATUS_STANDARD, 'translate' => 'Rooms range'), self::SEARCH_PRICE => array('status' => SearchFormModel::STATUS_STANDARD, 'translate' => 'Price range'), self::SEARCH_SQUARE => array('status' => SearchFormModel::STATUS_STANDARD, 'translate' => 'Square range'), self::SEARCH_FLOOR => array('status' => SearchFormModel::STATUS_STANDARD, 'translate' => 'Floor range'), self::SEARCH_BY_ID => array('status' => SearchFormModel::STATUS_STANDARD, 'translate' => 'Apartment ID'), self::SEARCH_BY_LAND_SQUARE => array('status' => SearchFormModel::STATUS_STANDARD, 'translate' => 'Apartment square to')); if (issetModule('formeditor')) { //Yii::import('application.modules.formeditor.models.HFormEditor'); $newFieldsAll = FormDesigner::getNewFields(); foreach ($newFieldsAll as $field) { self::$_cache['fields'][$field->field] = array('status' => SearchFormModel::STATUS_NEW_FIELD, 'translate' => 'Search by ' . $field->field, 'formdesigner_id' => $field->id); } } } return self::$_cache['fields']; }
public function actionLoadForm() { if (!Yii::app()->request->isAjaxRequest) { throw404(); } $this->objType = Yii::app()->request->getParam('obj_type_id'); $isInner = Yii::app()->request->getParam('is_inner'); $roomsMin = Yii::app()->request->getParam('room_min'); $roomsMax = Yii::app()->request->getParam('room_max'); if ($roomsMin || $roomsMax) { $this->roomsCountMin = $roomsMin; $this->roomsCountMax = $roomsMax; } $this->sApId = (int) Yii::app()->request->getParam('sApId'); $floorMin = Yii::app()->request->getParam('floor_min'); $floorMax = Yii::app()->request->getParam('floor_max'); if ($floorMin || $floorMax) { $this->floorCountMin = $floorMin; $this->floorCountMax = $floorMax; } $floor = Yii::app()->request->getParam('floor'); if ($floor) { $this->floorCount = $floor; } if (issetModule('selecttoslider') && param('useSquareSlider') == 1) { $squareMin = Yii::app()->request->getParam('square_min'); $squareMax = Yii::app()->request->getParam('square_max'); if ($squareMin || $squareMax) { $this->squareCountMin = $squareMin; $this->squareCountMax = $squareMax; } } else { $square = Yii::app()->request->getParam('square'); if ($square) { $this->squareCount = $square; } } if (issetModule('location') && param('useLocation', 1)) { $country = Yii::app()->request->getParam('country'); if ($country) { $this->selectedCountry = $country; } $region = Yii::app()->request->getParam('region'); if ($region) { $this->selectedRegion = $region; } $city = Yii::app()->request->getParam('city'); if ($city) { $this->selectedCity = $city; } } else { $city = Yii::app()->request->getParam('city'); if ($city) { $this->selectedCity = $city; } } $this->objType = Yii::app()->request->getParam('objType'); $this->apType = Yii::app()->request->getParam('apType'); /* if(issetModule('selecttoslider') && param('usePriceSlider') == 1) { $priceMin = Yii::app()->request->getParam("price_min"); $priceMax = Yii::app()->request->getParam("price_max"); if($priceMin || $priceMax) { $this->priceSlider["min"] = $priceMin; $this->priceSlider["max"] = $priceMax; } } else { $price = Yii::app()->request->getParam('price'); if(issetModule('currency')){ $priceDefault = ceil(Currency::convertToDefault($price)); } else { $priceDefault = $price; } if($priceDefault) { $this->price = $price; } }*/ if (issetModule('formeditor')) { $newFieldsAll = FormDesigner::getNewFields(); foreach ($newFieldsAll as $field) { $value = CHtml::encode(Yii::app()->request->getParam($field->field)); if (!$value) { continue; } $fieldString = $field->field; $this->newFields[$fieldString] = $value; } } $compact = Yii::app()->request->getParam('compact', 0); HAjax::jsonOk('', array('html' => $this->renderPartial('//site/_search_form', array('isInner' => $isInner, 'compact' => $compact), true), 'sliderRangeFields' => SearchForm::getSliderRangeFields(), 'cityField' => SearchForm::getCityField(), 'countFiled' => SearchForm::getCountFiled(), 'compact' => $compact)); }
public static function getAddedFields() { $addedFields = null; if (issetModule('formdesigner')) { $newFieldsAll = FormDesigner::getNewFields(); if ($newFieldsAll && count($newFieldsAll)) { foreach ($newFieldsAll as $key => $field) { $addedFields[$key]['field'] = $field->field; $addedFields[$key]['type'] = $field->type; $addedFields[$key]['compare_type'] = $field->compare_type; $addedFields[$key]['label'] = $field->getStrByLang('label'); if ($field->type == FormDesigner::TYPE_REFERENCE) { $addedFields[$key]['listData'] = FormDesigner::getListByCategoryID($field->reference_id); } } } } return $addedFields; }
foreach ($ref['values'] as $key => $value) { if ($value) { echo '<li><span>' . CHtml::encode($value) . '</span></li>'; } } } echo '</ul>'; } echo '</td>'; } echo '</tr>'; } } } if (issetModule('formeditor')) { $rows = FormDesigner::getNewFields(); foreach ($rows as $row) { if (!FormDesigner::isShowForAnything($row['field'])) { continue; } echo '<tr>'; echo '<td>'; echo '<strong>' . CHtml::encode($row['label_' . Yii::app()->language]) . ':</strong>'; echo '</td>'; foreach ($apartments as $item) { if ($row->type == FormDesigner::TYPE_REFERENCE) { $sql = "SELECT title_" . Yii::app()->language . " FROM {{apartment_reference_values}} WHERE id=" . $item->{$row}['field']; $value = Yii::app()->db->createCommand($sql)->queryScalar(); } else { $value = CHtml::encode($item->{$row}['field']); }