public function getHtmlOutput(\Zend_View_Abstract $view)
 {
     parent::getHtmlOutput($view);
     $respondentModel = $this->model;
     $respondentData = $this->data;
     $respondentId = $this->respondentId;
     $html = $this->getHtmlSequence();
     if (empty($this->data)) {
         $html->p()->b(sprintf($this->_('Unknown respondent %s'), $respondentId));
         return $html;
     }
     $bridge = $respondentModel->getBridgeFor('itemTable', array('class' => 'browser table'));
     $bridge->setRepeater(\MUtil_Lazy::repeat(array($respondentData)));
     $bridge->th($this->_('Respondent information'), array('colspan' => 4));
     $bridge->setColumnCount(2);
     foreach ($respondentModel->getItemsOrdered() as $name) {
         if ($label = $respondentModel->get($name, 'label')) {
             $bridge->addItem($name, $label);
         }
     }
     $tableContainer = \MUtil_Html::create()->div(array('class' => 'table-container'));
     $tableContainer[] = $bridge->getTable();
     $html->h2($this->_('Respondent information') . ': ' . $respondentId);
     $html[] = $tableContainer;
     $html->hr();
     return $html;
 }
 /**
  * Should be called after answering the request to allow the Target
  * to check if all required registry values have been set correctly.
  *
  * @return boolean False if required are missing.
  */
 public function checkRegistryRequestsAnswers()
 {
     if ($this->token instanceof \Gems_Tracker_Token) {
         $this->wasAnswered = $this->token->isCompleted();
         return $this->request instanceof \Zend_Controller_Request_Abstract && $this->view instanceof \Zend_View && parent::checkRegistryRequestsAnswers();
     } else {
         return false;
     }
 }
 /**
  * The place to check if the data set in the snippet is valid
  * to generate the snippet.
  *
  * When invalid data should result in an error, you can throw it
  * here but you can also perform the check in the
  * checkRegistryRequestsAnswers() function from the
  * {@see \MUtil_Registry_TargetInterface}.
  *
  * @return boolean
  */
 public function hasHtmlOutput()
 {
     if ($this->request->getParam($this->confirmParameter)) {
         $this->performAction();
         $redirectRoute = $this->getRedirectRoute();
         return empty($redirectRoute);
     } else {
         return parent::hasHtmlOutput();
     }
 }
 /**
  * Called after the check that all required registry values
  * have been set correctly has run.
  *
  * @return void
  */
 public function afterRegistry()
 {
     parent::afterRegistry();
     if ($this->showForRespondents && is_bool($this->showForRespondents)) {
         $this->showForRespondents = $this->_('by Respondents');
     }
     if ($this->showForStaff && is_bool($this->showForStaff)) {
         $this->showForStaff = $this->_('by Staff');
     }
     if ($this->showForTracks && is_bool($this->showForTracks)) {
         $this->showForTracks = $this->_('Tracks');
     }
     if ($this->showTitle && is_bool($this->showTitle)) {
         $this->showTitle = $this->_('Add');
     }
 }
 /**
  * Should be called after answering the request to allow the Target
  * to check if all required registry values have been set correctly.
  *
  * @return boolean False if required values are missing.
  */
 public function checkRegistryRequestsAnswers()
 {
     return (bool) $this->loader && $this->request && parent::checkRegistryRequestsAnswers();
 }
 /**
  * The place to check if the data set in the snippet is valid
  * to generate the snippet.
  *
  * When invalid data should result in an error, you can throw it
  * here but you can also perform the check in the
  * checkRegistryRequestsAnswers() function from the
  * {@see \MUtil_Registry_TargetInterface}.
  *
  * @return boolean
  */
 public function hasHtmlOutput()
 {
     if (!$this->multiTracks) {
         return false;
     }
     if (!$this->trackData) {
         if (!$this->trackId) {
             if ($this->trackEngine instanceof \Gems_Tracker_Engine_TrackEngineInterface) {
                 $this->trackId = $this->trackEngine->getTrackId();
             } else {
                 return false;
             }
         }
         $trackModel = new \MUtil_Model_TableModel('gems__tracks');
         $this->trackData = $trackModel->loadFirst(array('gtr_id_track' => $this->trackId));
     } elseif (!$this->trackId) {
         $this->trackId = $this->trackData['gtr_id_track'];
     }
     return parent::hasHtmlOutput();
 }
 /**
  * The place to check if the data set in the snippet is valid
  * to generate the snippet.
  *
  * When invalid data should result in an error, you can throw it
  * here but you can also perform the check in the
  * checkRegistryRequestsAnswers() function from the
  * {@see MUtil_Registry_TargetInterface}.
  *
  * @return boolean
  */
 public function hasHtmlOutput()
 {
     if (parent::hasHtmlOutput()) {
         return $this->processForm();
     }
 }
 /**
  * Called after the check that all required registry values
  * have been set correctly has run.
  *
  * @return void
  */
 public function afterRegistry()
 {
     parent::afterRegistry();
     $this->loadExport();
 }
 public function afterRegistry()
 {
     parent::afterRegistry();
     $orgId = $this->request->getParam(\MUtil_Model::REQUEST_ID2);
     $patientNr = $this->request->getParam(\MUtil_Model::REQUEST_ID1);
     if (!$this->data) {
         $data = $this->loader->getTracker()->getTokenSelect()->andRespondentOrganizations()->andReceptionCodes(array())->andSurveys()->forWhere('gsu_code = ?', $this->survey_code)->forWhere('grc_success = 1')->forWhere('gr2o_id_organization = ?', $orgId)->forWhere('gr2o_patient_nr = ?', $patientNr)->order('gto_completion_time')->fetchAll();
         $this->data = $data;
     }
     if (!empty($this->data)) {
         $firstRow = reset($this->data);
         if (array_key_exists('gto_id_token', $firstRow)) {
             $this->token = $this->loader->getTracker()->getToken($firstRow)->refresh();
         }
     }
 }
 /**
  * Called after the check that all required registry values
  * have been set correctly has run.
  *
  * @return void
  */
 public function afterRegistry()
 {
     parent::afterRegistry();
     if ($this->util && false !== $this->searchData && !$this->requestCache) {
         $this->requestCache = $this->util->getRequestCache();
     }
     if ($this->requestCache) {
         // Do not store searchButtonId
         $this->requestCache->removeParams($this->searchButtonId);
     }
 }