public function execute() { $this->getInput(); $view = $this->getGlobalData()->getView(); $action = $this->action; // Show the list of settlements; $view->op_type = $this->operation_type; if ($action == 'firstpage') { $view->viewmode = 'firstpage'; $list = new RealEstateAgency_Object_SettlementList(); $list->setGlobalData($this->getGlobalData()); $list->setAreaId(1); $list->loadBy(); $view->list_of_links = $list->getArray(); } else { if ($action == 'secondpage') { $this->secondPage($view); //$view->settlement_name = $this->getSettlementName(); } else { if ($action == 'submit') { $view->viewmode = 'show'; $obj = new RealEstateAgency_Object_RealEstateObject(); $obj->setGlobalData($this->getGlobalData()); $brokerID = $this->getGlobalData()->getLoginObject()->getLoggedUserID(); $obj->setBrokerID($brokerID); //tools_log_debug($this->getGlobalData(),"validate reo",tools_get_input('op_type')); $obj->readWebForm(); $obj->toWebForm($view); $validation = $obj->validate(); if (count($validation) > 0) { $view->validation = $validation; $this->secondPage($view); //$view->settlement_name = $this->getSettlementName(); } else { // Submit; $view->settlement_name = $this->getSettlementName(); $time = tools_date2database(time()); $obj->setDateOfStart($time); $obj->setDateOfUpdate($time); if (!$this->do_not_save) { $obj->insert(); } } } } } }
private function loadData() { $globalData = $this->getGlobalData(); $view = $globalData->getView(); $filter = $this->filter; $list_3 = new RealEstateAgency_Object_SettlementList(); $list_3->setGlobalData($globalData); $list_3->setAreaId($filter->getAreaId()); $list_3->setDistrictId($filter->getDistrictId()); $list_3->loadBy(); $view->list_of_settlements = $list_3; //return $objectsList; }
private function loadSettlementsList() { $objectsList = new RealEstateAgency_Object_SettlementList(); $objectsList->setGlobalData($this->getGlobalData()); // $objectsList->setAreaList($this->list_of_areas); // $objectsList->setDistrictList($this->list_of_districts); $objectsList->setDistrictId($this->district_id); $objectsList->loadBy(); $this->list_of_settlements = $objectsList; return $objectsList; }