original_string: public function emailAction()
      {
          $model   = $this->getModel();
  
          $model->setFilter($this->getSearchFilter(false));
  
          $sort = array(
              'gr2o_email'          => SORT_ASC,
              'grs_first_name'     => SORT_ASC,
              'grs_surname_prefix' => SORT_ASC,
              'grs_last_name'      => SORT_ASC,
              'gto_valid_from'     => SORT_ASC,
              'gto_round_order'    => SORT_ASC,
              'gsu_survey_name'    => SORT_ASC,
          );
  
          if ($tokensData = $model->load(true, $sort)) {
              $params['mailTarget']           = 'token';
              $params['menu']                 = $this->menu;
              $params['model']                = $model;
              $params['identifier']           = $this->_getIdParam();
              $params['view']                 = $this->view;
              $params['routeAction']          = 'index';
              $params['formTitle']            = sprintf($this->_('Send mail to: %s'), $this->getTopic());
              $params['templateOnly']         = ! $this->currentUser->hasPrivilege('pr.token.mail.freetext');
              $params['multipleTokenData']    = $tokensData;
  
              $this->addSnippet('Mail_TokenBulkMailFormSnippet', $params);
          } else {
              $this->addMessage($this->_('No tokens found.'));
          }
      }
code: public function emailAction()
      {
          $model   = $this->getModel();
  
          $model->setFilter($this->getSearchFilter(false));
  
          $sort = array(
              'gr2o_email'          => SORT_ASC,
              'grs_first_name'     => SORT_ASC,
              'grs_surname_prefix' => SORT_ASC,
              'grs_last_name'      => SORT_ASC,
              'gto_valid_from'     => SORT_ASC,
              'gto_round_order'    => SORT_ASC,
              'gsu_survey_name'    => SORT_ASC,
          );
  
          if ($tokensData = $model->load(true, $sort)) {
              $params['mailTarget']           = 'token';
              $params['menu']                 = $this->menu;
              $params['model']                = $model;
              $params['identifier']           = $this->_getIdParam();
              $params['view']                 = $this->view;
              $params['routeAction']          = 'index';
              $params['formTitle']            = sprintf($this->_('Send mail to: %s'), $this->getTopic());
              $params['templateOnly']         = ! $this->currentUser->hasPrivilege('pr.token.mail.freetext');
              $params['multipleTokenData']    = $tokensData;
  
              $this->addSnippet('Mail_TokenBulkMailFormSnippet', $params);
          } else {
              $this->addMessage($this->_('No tokens found.'));
          }
      }
code_tokens: public function emailAction ( ) { $ model = $ this -> getModel ( ) ; $ model -> setFilter ( $ this -> getSearchFilter ( false ) ) ; $ sort = array ( 'gr2o_email' => SORT_ASC , 'grs_first_name' => SORT_ASC , 'grs_surname_prefix' => SORT_ASC , 'grs_last_name' => SORT_ASC , 'gto_valid_from' => SORT_ASC , 'gto_round_order' => SORT_ASC , 'gsu_survey_name' => SORT_ASC , ) ; if ( $ tokensData = $ model -> load ( true , $ sort ) ) { $ params [ 'mailTarget' ] = 'token' ; $ params [ 'menu' ] = $ this -> menu ; $ params [ 'model' ] = $ model ; $ params [ 'identifier' ] = $ this -> _getIdParam ( ) ; $ params [ 'view' ] = $ this -> view ; $ params [ 'routeAction' ] = 'index' ; $ params [ 'formTitle' ] = sprintf ( $ this -> _ ( 'Send mail to: %s' ) , $ this -> getTopic ( ) ) ; $ params [ 'templateOnly' ] = ! $ this -> currentUser -> hasPrivilege ( 'pr.token.mail.freetext' ) ; $ params [ 'multipleTokenData' ] = $ tokensData ; $ this -> addSnippet ( 'Mail_TokenBulkMailFormSnippet' , $ params ) ; } else { $ this -> addMessage ( $ this -> _ ( 'No tokens found.' ) ) ; } }
docstring: Bulk email action
docstring_tokens: Bulk email action