public function returnAction()
    {
        if (! $this->_initToken()) {
            // In all other cases: the action that generates meaningfull warnings and is reachable for everyone
            $this->_forward('forward');
            return;
        }

        if ($url = $this->token->getReturnUrl()) {
            // Check for completed tokens
            $this->tracker->processCompletedTokens(
                    $this->token->getRespondentId(),
                    $this->token->getChangedBy(),
                    $this->token->getOrganizationId()
                    );

            // Redirect at once, might be another site url
            header('Location: ' . $url);
            exit();
        }

        // No return? Check for old style user based return
        if (! $this->currentUser->isActive()) {
            $this->_forward('forward');
            return;
        }

        // Check for completed tokens
        $this->tracker->processCompletedTokens($this->token->getRespondentId(), $this->currentUser->getUserId());

        // Get return route parameters
        $parameters = $this->currentUser->getSurveyReturn();
        if (! $parameters) {
            // Default fallback for the fallback
            $request = $this->getRequest();
            $parameters[$request->getControllerKey()] = 'respondent';
            $parameters[$request->getActionKey()]     = 'show';
            $parameters[\MUtil_Model::REQUEST_ID]      = $this->token->getPatientNumber();
        }

        $this->_reroute($parameters, true);
    }
public function returnAction()
    {
        if (! $this->_initToken()) {
            // In all other cases: the action that generates meaningfull warnings and is reachable for everyone
            $this->_forward('forward');
            return;
        }

        if ($url = $this->token->getReturnUrl()) {
            // Check for completed tokens
            $this->tracker->processCompletedTokens(
                    $this->token->getRespondentId(),
                    $this->token->getChangedBy(),
                    $this->token->getOrganizationId()
                    );

            // Redirect at once, might be another site url
            header('Location: ' . $url);
            exit();
        }

        // No return? Check for old style user based return
        if (! $this->currentUser->isActive()) {
            $this->_forward('forward');
            return;
        }

        // Check for completed tokens
        $this->tracker->processCompletedTokens($this->token->getRespondentId(), $this->currentUser->getUserId());

        // Get return route parameters
        $parameters = $this->currentUser->getSurveyReturn();
        if (! $parameters) {
            // Default fallback for the fallback
            $request = $this->getRequest();
            $parameters[$request->getControllerKey()] = 'respondent';
            $parameters[$request->getActionKey()]     = 'show';
            $parameters[\MUtil_Model::REQUEST_ID]      = $this->token->getPatientNumber();
        }

        $this->_reroute($parameters, true);
    }
public function returnAction ( ) { if ( ! $ this -> _initToken ( ) ) { // In all other cases: the action that generates meaningfull warnings and is reachable for everyone $ this -> _forward ( 'forward' ) ; return ; } if ( $ url = $ this -> token -> getReturnUrl ( ) ) { // Check for completed tokens $ this -> tracker -> processCompletedTokens ( $ this -> token -> getRespondentId ( ) , $ this -> token -> getChangedBy ( ) , $ this -> token -> getOrganizationId ( ) ) ; // Redirect at once, might be another site url header ( 'Location: ' . $ url ) ; exit ( ) ; } // No return? Check for old style user based return if ( ! $ this -> currentUser -> isActive ( ) ) { $ this -> _forward ( 'forward' ) ; return ; } // Check for completed tokens $ this -> tracker -> processCompletedTokens ( $ this -> token -> getRespondentId ( ) , $ this -> currentUser -> getUserId ( ) ) ; // Get return route parameters $ parameters = $ this -> currentUser -> getSurveyReturn ( ) ; if ( ! $ parameters ) { // Default fallback for the fallback $ request = $ this -> getRequest ( ) ; $ parameters [ $ request -> getControllerKey ( ) ] = 'respondent' ; $ parameters [ $ request -> getActionKey ( ) ] = 'show' ; $ parameters [ \ MUtil_Model :: REQUEST_ID ] = $ this -> token -> getPatientNumber ( ) ; } $ this -> _reroute ( $ parameters , true ) ; }
The action where survey sources should return to after survey completion
The action where survey sources should return to after survey completion