protected function preFilter($filterChain) { /** @var CHttpSession */ self::$session = Yii::app()->session; if (self::$session->get('appointmentBuilder')) { self::$current = self::$session->get('appointmentBuilder'); } return parent::preFilter($filterChain); }
public function actionInstructionSelected($instructionId) { $builder = AppointmentBuilder::getCurrent(); $builder->setInstructionId($instructionId); if ($builder->getType() == AppointmentBuilder::TYPE_VALUATION) { $query = http_build_query(['stage' => 'appointment', 'pro_id' => $builder->getPropertyId(), 'cli_id' => $builder->getClientId(), 'dea_id' => $builder->getInstructionId(), 'dea_status' => 'Valuation', 'dea_type' => '', 'date' => $builder->getDate()]); $this->redirect('/v3.0/live/admin/valuation_add.php?' . $query); } else { $query = http_build_query(['stage' => 'appointment', 'pro_id' => $builder->getPropertyId(), 'cli_id' => $builder->getClientId(), 'dea_id' => $builder->getInstructionId(), 'date' => $builder->getDate()]); $this->redirect('/v3.0/live/admin/viewing_add.php?' . $query); } }
?> <fieldset> <div class="block-header">Search</div> <div class="content"> <label> Address <?php echo $form->textField($model, 'fullAddressString', array('size' => 30)); ?> </label> <label> Postcode <?php echo $form->textField($model, 'pro_postcode', array('size' => 10)); ?> </label> </div> </fieldset> <?php $this->endWidget(); ?> </div> <?php $buttonColumn = array('header' => '', 'type' => 'raw', 'value' => function (Property $data) { $html = ''; $html .= CHtml::link(CHtml::image(Icon::USE_ICON, 'Use property'), ['propertySelected', 'propertyId' => $data->pro_id]); $html .= CHtml::link(CHtml::image(Icon::EDIT_ICON, 'Edit property'), ['property/update', 'id' => $data->pro_id, 'clientId' => AppointmentBuilder::getCurrent()->getClientId(), 'nextStep' => 'AppointmentBuilder_propertySelected']); return $html; }, 'htmlOptions' => ['class' => 'centered-text']); $this->widget('AdminGridView', array('id' => 'property-list', 'dataProvider' => $model->search(), 'title' => 'Select property', 'actions' => array('add' => array($this->createUrl("Property/Create", array('owner' => AppointmentBuilder::getCurrent()->getClientId(), 'nextStep' => 'AppointmentBuilder_propertySelected')), 'Add New Property', array('rel' => 'client-list-add-button'))), 'columns' => array($buttonColumn, array('name' => 'address.fullAddressString', 'header' => 'Address', 'value' => function (Property $data) { return $data->address ? $data->address->getFullAddressString(', ') : ''; }), array('name' => 'address.postcode', 'header' => 'Postcode'), $buttonColumn)));