public function afterRegistry()
 {
     $this->user = $this->loader->getUserLoader()->getUserByStaffId($this->staffId);
     parent::afterRegistry();
     $this->user = $this->loader->getUserLoader()->getUserByStaffId($this->staffId);
     $mailFields = $this->user->getMailFields();
     $this->addMailFields($mailFields);
     $this->addTo($this->user->getEmailAddress(), $this->user->getFullName());
     $this->setLanguage($this->user->getLocale());
 }
 public function getHtmlOutput(\Zend_View_Abstract $view)
 {
     $html = $this->getHtmlSequence();
     $html->h1($this->_('Respondent report'));
     $table = $html->table(array('class' => 'browser'));
     $table->th($this->_('Report information'), array('colspan' => 2));
     $table->tr()->th($this->_('Generated by'))->td($this->currentUser->getFullName());
     $table->tr()->th($this->_('Generated on'))->td(new \Zend_Date());
     $table->tr()->th($this->_('Organization'))->td($this->currentOrganization->getName());
     $html->br();
     return $html;
 }
 /**
  * Default logoff action
  */
 public function logoffAction()
 {
     $this->addMessage(sprintf($this->_('Good bye: %s.'), $this->currentUser->getFullName()));
     $this->accesslog->logChange($this->getRequest());
     $this->currentUser->unsetAsCurrentUser();
     \Zend_Session::destroy();
     $this->_reroute(array('action' => 'index'), true);
 }
 /**
  * Create the options for the Select
  */
 protected function createFromSelect($elementName = 'from', $label = '')
 {
     $valid = array();
     $invalid = array();
     $organization = $this->mailer->getOrganization();
     // The organization
     $key = 'organization';
     if ($name = $organization->getContactName()) {
         $extra = $organization->getName();
     } else {
         $name = $organization->getName();
         $extra = null;
     }
     if ($email = $organization->getEmail()) {
         $title = false;
         $valid[] = $key;
     } else {
         $title = $this->_('Organization does not have an e-mail address.');
         $invalid[] = $key;
     }
     $options[$key] = $this->createMultiOption(array(\MUtil_Model::REQUEST_ID => $organization->getId()), $name, $email, $extra, $title, array('controller' => 'organization', 'action' => 'edit'));
     $this->fromOptions[$key] = $email;
     //$name . ' <' . $email . '>';
     // The user
     $key = 'user';
     $name = $this->currentUser->getFullName();
     $extra = null;
     if ($email = $this->currentUser->getEmailAddress()) {
         $title = false;
         $valid[] = $key;
     } else {
         $title = $this->_('You do not have an e-mail address.');
         $invalid[] = $key;
     }
     $options[$key] = $this->createMultiOption(array(), $name, $email, $extra, $title, array('controller' => 'option', 'action' => 'edit'));
     $this->fromOptions[$key] = $email;
     //$name . ' <' . $email . '>';
     // As "the" application
     $key = 'application';
     $user = $this->loader->getCurrentUser();
     if ($user->hasPrivilege('pr.plan.mail-as-application') && isset($this->project->email['site'])) {
         if ($email = $this->project->email['site']) {
             $options['application'] = $this->createMultiOption(array(), $this->project->name, $email);
             $valid[] = 'application';
             $this->fromOptions[$key] = $email;
             //$this->project->name . ' <' . $email . '>';
         }
     }
     $firstSelectable = reset($valid);
     $element = $this->form->createElement('radio', $elementName, array('disable' => $invalid, 'escape' => !$this->view, 'label' => $label, 'multiOptions' => $options, 'required' => true, 'value' => $firstSelectable));
     $element->addValidator('InArray', false, array('haystack' => $valid));
     return $element;
 }