original_string: protected function loadSurvey()
      {
          if (! $this->surveyList) {
              $this->addMessageInvalid($this->_('Survey insertion impossible: no insertable survey exists!'));
          }
          if (count($this->surveyList) === 1) {
              $model = $this->getModel();
              $model->set('gto_id_survey', 'elementClass', 'Exhibitor');
  
              reset($this->surveyList);
              $this->formData['gto_id_survey'] = key($this->surveyList);
          }
  
          if (isset($this->formData['gto_id_survey'])) {
              $this->survey = $this->tracker->getSurvey($this->formData['gto_id_survey']);
  
              $groupId = $this->survey->getGroupId();
              $groups  = $this->util->getDbLookup()->getGroups();
              if (isset($groups[$groupId])) {
                  $this->formData['ggp_name'] = $groups[$groupId];
              }
  
              $this->formData['gto_valid_until'] = $this->survey->getInsertDateUntil($this->formData['gto_valid_from']);
          }
      }
code: protected function loadSurvey()
      {
          if (! $this->surveyList) {
              $this->addMessageInvalid($this->_('Survey insertion impossible: no insertable survey exists!'));
          }
          if (count($this->surveyList) === 1) {
              $model = $this->getModel();
              $model->set('gto_id_survey', 'elementClass', 'Exhibitor');
  
              reset($this->surveyList);
              $this->formData['gto_id_survey'] = key($this->surveyList);
          }
  
          if (isset($this->formData['gto_id_survey'])) {
              $this->survey = $this->tracker->getSurvey($this->formData['gto_id_survey']);
  
              $groupId = $this->survey->getGroupId();
              $groups  = $this->util->getDbLookup()->getGroups();
              if (isset($groups[$groupId])) {
                  $this->formData['ggp_name'] = $groups[$groupId];
              }
  
              $this->formData['gto_valid_until'] = $this->survey->getInsertDateUntil($this->formData['gto_valid_from']);
          }
      }
code_tokens: protected function loadSurvey ( ) { if ( ! $ this -> surveyList ) { $ this -> addMessageInvalid ( $ this -> _ ( 'Survey insertion impossible: no insertable survey exists!' ) ) ; } if ( count ( $ this -> surveyList ) === 1 ) { $ model = $ this -> getModel ( ) ; $ model -> set ( 'gto_id_survey' , 'elementClass' , 'Exhibitor' ) ; reset ( $ this -> surveyList ) ; $ this -> formData [ 'gto_id_survey' ] = key ( $ this -> surveyList ) ; } if ( isset ( $ this -> formData [ 'gto_id_survey' ] ) ) { $ this -> survey = $ this -> tracker -> getSurvey ( $ this -> formData [ 'gto_id_survey' ] ) ; $ groupId = $ this -> survey -> getGroupId ( ) ; $ groups = $ this -> util -> getDbLookup ( ) -> getGroups ( ) ; if ( isset ( $ groups [ $ groupId ] ) ) { $ this -> formData [ 'ggp_name' ] = $ groups [ $ groupId ] ; } $ this -> formData [ 'gto_valid_until' ] = $ this -> survey -> getInsertDateUntil ( $ this -> formData [ 'gto_valid_from' ] ) ; } }
docstring: Load the survey object and use it
docstring_tokens: Load the survey object and use it