initActionCreate() protected method

Initialise the controller prior to a create action.
protected initActionCreate ( )
Ejemplo n.º 1
0
 /**
  * Call edit init and set attribute for alerting which side the latest injection management
  * implies should be injected.
  *
  * @see BaseEventTypeController::createInit()
  */
 protected function initActionCreate()
 {
     parent::initActionCreate();
     $this->editInit();
     // set up the injection side if provided by the injection management in examination
     $exam_api = Yii::app()->moduleAPI->get('OphCiExamination');
     // We only want to show the injection mananagement side highlighting from injection management that has
     // been created on the day of this injection
     $since = new DateTime();
     $since->setTime(0, 0, 0);
     if ($this->episode && $exam_api && ($imc = $exam_api->getLatestInjectionManagementComplex($this->episode, $since))) {
         if ($side = $imc->getInjectionSide()) {
             $this->side_to_inject = $side;
         } else {
             $this->side_to_inject = 0;
         }
     }
 }
Ejemplo n.º 2
0
 /**
  * need to ensure we load the required js.
  */
 public function initActionCreate()
 {
     parent::initActionCreate();
     $this->_jsCreate();
 }
Ejemplo n.º 3
0
 protected function initActionCreate()
 {
     parent::initActionCreate();
     $this->registerEditScripts();
 }
Ejemplo n.º 4
0
 /**
  * Call editInit to set up jsVars.
  */
 public function initActionCreate()
 {
     parent::initActionCreate();
     $this->initEdit();
 }
Ejemplo n.º 5
0
 /**
  * Process the booking event value setting.
  *
  * @throws Exception
  */
 protected function initActionCreate()
 {
     parent::initActionCreate();
     if (isset($_GET['booking_event_id'])) {
         if (!($api = Yii::app()->moduleAPI->get('OphTrOperationbooking'))) {
             throw new Exception('invalid request for booking event');
         }
         if (!($this->booking_event = Event::model()->findByPk($_GET['booking_event_id'])) || !($this->booking_operation = $api->getOperationForEvent($_GET['booking_event_id']))) {
             throw new Exception('booking event not found');
         }
     } elseif (isset($_GET['unbooked'])) {
         $this->unbooked = true;
     }
 }
Ejemplo n.º 6
0
 /**
  * Some additional initialisation for create.
  */
 protected function initActionCreate()
 {
     parent::initActionCreate();
     $this->initEdit();
 }
Ejemplo n.º 7
0
 /**
  * ensure js vars are set before carrying out standard functionality.
  */
 public function initActionCreate()
 {
     $this->addEditJSVars();
     parent::initActionCreate();
 }