original_string: public function forwardAction()
      {
          /**************
           * Find token *
           **************/
  
          if (! $this->_initToken()) {
              if ($this->tokenId) {
                  // There is a token but is incorrect
                  $this->addMessage(sprintf(
                          $this->_('The token %s does not exist (any more).'),
                          strtoupper($this->tokenId)
                          ));
              }
              $this->_forward('index');
              return;
          }
  
          if ($this->util->getMaintenanceLock()->isLocked()) {
              $this->addSnippet($this->maintenanceModeSnippets, ['token' => $this->token]);
              return;
          }
  
          /****************************
           * Update open tokens first *
           ****************************/
          $this->tracker->processCompletedTokens(
                  $this->token->getRespondentId(),
                  $this->token->getChangedBy(),
                  $this->token->getOrganizationId()
                  );
  
          $screen = $this->token->getOrganization()->getTokenAskScreen();
          if ($screen) {
              $params   = $screen->getParameters($this->token);
              $snippets = $screen->getSnippets($this->token);
              if (false !== $snippets) {
                  $this->forwardSnippets = $snippets;
              }
          }
          $params['token'] = $this->token;
  
          // Display token when possible
          if ($this->html->snippet($this->forwardSnippets, $params)) {
              return;
          }
  
          // Snippet had nothing to display, because of an answer
          if ($this->getRequest()->getActionName() == 'return') {
              $this->addMessage(sprintf(
                      $this->_('Thank you for answering. At the moment we have no further surveys for you to take.'),
                      strtoupper($this->tokenId)
                      ));
          } else {
              $this->addMessage(sprintf(
                      $this->_('The survey for token %s has been answered and no further surveys are open.'),
                      strtoupper($this->tokenId)
                      ));
          }
  
          // Do not enter a loop!! Reroute!
          $this->_reroute(array('controller' => 'ask', 'action' => 'index'), true);
      }
code: public function forwardAction()
      {
          /**************
           * Find token *
           **************/
  
          if (! $this->_initToken()) {
              if ($this->tokenId) {
                  // There is a token but is incorrect
                  $this->addMessage(sprintf(
                          $this->_('The token %s does not exist (any more).'),
                          strtoupper($this->tokenId)
                          ));
              }
              $this->_forward('index');
              return;
          }
  
          if ($this->util->getMaintenanceLock()->isLocked()) {
              $this->addSnippet($this->maintenanceModeSnippets, ['token' => $this->token]);
              return;
          }
  
          /****************************
           * Update open tokens first *
           ****************************/
          $this->tracker->processCompletedTokens(
                  $this->token->getRespondentId(),
                  $this->token->getChangedBy(),
                  $this->token->getOrganizationId()
                  );
  
          $screen = $this->token->getOrganization()->getTokenAskScreen();
          if ($screen) {
              $params   = $screen->getParameters($this->token);
              $snippets = $screen->getSnippets($this->token);
              if (false !== $snippets) {
                  $this->forwardSnippets = $snippets;
              }
          }
          $params['token'] = $this->token;
  
          // Display token when possible
          if ($this->html->snippet($this->forwardSnippets, $params)) {
              return;
          }
  
          // Snippet had nothing to display, because of an answer
          if ($this->getRequest()->getActionName() == 'return') {
              $this->addMessage(sprintf(
                      $this->_('Thank you for answering. At the moment we have no further surveys for you to take.'),
                      strtoupper($this->tokenId)
                      ));
          } else {
              $this->addMessage(sprintf(
                      $this->_('The survey for token %s has been answered and no further surveys are open.'),
                      strtoupper($this->tokenId)
                      ));
          }
  
          // Do not enter a loop!! Reroute!
          $this->_reroute(array('controller' => 'ask', 'action' => 'index'), true);
      }
code_tokens: public function forwardAction ( ) { /**************
           * Find token *
           **************/ if ( ! $ this -> _initToken ( ) ) { if ( $ this -> tokenId ) { // There is a token but is incorrect $ this -> addMessage ( sprintf ( $ this -> _ ( 'The token %s does not exist (any more).' ) , strtoupper ( $ this -> tokenId ) ) ) ; } $ this -> _forward ( 'index' ) ; return ; } if ( $ this -> util -> getMaintenanceLock ( ) -> isLocked ( ) ) { $ this -> addSnippet ( $ this -> maintenanceModeSnippets , [ 'token' => $ this -> token ] ) ; return ; } /****************************
           * Update open tokens first *
           ****************************/ $ this -> tracker -> processCompletedTokens ( $ this -> token -> getRespondentId ( ) , $ this -> token -> getChangedBy ( ) , $ this -> token -> getOrganizationId ( ) ) ; $ screen = $ this -> token -> getOrganization ( ) -> getTokenAskScreen ( ) ; if ( $ screen ) { $ params = $ screen -> getParameters ( $ this -> token ) ; $ snippets = $ screen -> getSnippets ( $ this -> token ) ; if ( false !== $ snippets ) { $ this -> forwardSnippets = $ snippets ; } } $ params [ 'token' ] = $ this -> token ; // Display token when possible if ( $ this -> html -> snippet ( $ this -> forwardSnippets , $ params ) ) { return ; } // Snippet had nothing to display, because of an answer if ( $ this -> getRequest ( ) -> getActionName ( ) == 'return' ) { $ this -> addMessage ( sprintf ( $ this -> _ ( 'Thank you for answering. At the moment we have no further surveys for you to take.' ) , strtoupper ( $ this -> tokenId ) ) ) ; } else { $ this -> addMessage ( sprintf ( $ this -> _ ( 'The survey for token %s has been answered and no further surveys are open.' ) , strtoupper ( $ this -> tokenId ) ) ) ; } // Do not enter a loop!! Reroute! $ this -> _reroute ( array ( 'controller' => 'ask' , 'action' => 'index' ) , true ) ; }
docstring: Show the user a screen with token information and a button to take at least one survey
  
  @return void
docstring_tokens: Show the user a screen with token information and a button to take at least one survey