/**
  * Returns a model that can be used to save, edit, etc. the token
  *
  * @return \Gems_Tracker_Model_StandardTokenModel
  */
 public function getTokenModel()
 {
     return $this->tracker->getTokenModel();
 }
 /**
  * Creates the model
  *
  * @return \MUtil_Model_ModelAbstract
  */
 protected function createModel()
 {
     $model = $this->tracker->getTokenModel();
     if ($model instanceof \Gems_Tracker_Model_StandardTokenModel) {
         $model->addEditTracking();
         if ($this->createData) {
             $model->applyInsertionFormatting();
         }
     }
     // Valid from can not be calculated for inserted rounds, and should always be manual
     $model->set('gto_valid_from_manual', 'elementClass', 'Hidden', 'default', '1');
     $trackData = $this->util->getTrackData();
     $this->surveyList = $trackData->getInsertableSurveys();
     $model->set('gto_id_survey', 'label', $this->_('Suvey to insert'), 'multiOptions', $this->surveyList, 'onchange', 'this.form.submit();');
     $model->set('gto_id_track', 'label', $this->_('Existing track'), 'elementClass', 'Select', 'onchange', 'this.form.submit();');
     $model->set('gto_round_order', 'label', $this->_('In round'), 'elementClass', 'Select', 'required', true);
     $model->set('gto_valid_from', 'required', true);
     return $model;
 }
Exemplo n.º 3
0
 /**
  * Returns a model that can be used to save, edit, etc. the token
  *
  * @return \Gems_Tracker_Model_StandardTokenModel
  */
 public function getModel()
 {
     if ($this->exists) {
         return $this->getTrackEngine()->getTokenModel();
     } else {
         return $this->tracker->getTokenModel();
     }
 }