/**
  * Creates the salutation for the given user.
  *
  * The salutation is localized and gender-specific and contains the name of
  * the user.
  *
  * @param tx_seminars_Model_FrontEndUser $user
  *        the user to create the salutation for
  *
  * @return string the localized, gender-specific salutation with a trailing comma, will not be empty
  */
 public function getSalutation(tx_seminars_Model_FrontEndUser $user)
 {
     $salutationParts = array();
     $salutationMode = Tx_Oelib_ConfigurationRegistry::get('plugin.tx_seminars')->getAsString('salutation');
     switch ($salutationMode) {
         case 'informal':
             $salutationParts['dear'] = $this->translator->translate('email_hello_informal');
             $salutationParts['name'] = $user->getFirstOrFullName();
             break;
         default:
             $gender = $user->getGender();
             $salutationParts['dear'] = $this->translator->translate('email_hello_formal_' . $gender);
             $salutationParts['title'] = $this->translator->translate('email_salutation_title_' . $gender);
             $salutationParts['name'] = $user->getLastOrFullName();
     }
     foreach ($this->getHooks() as $hook) {
         if (method_exists($hook, 'modifySalutation')) {
             $hook->modifySalutation($salutationParts);
         }
     }
     return implode(' ', $salutationParts) . ',';
 }
示例#2
0
 /**
  * Limits the bag to registrations to the front-end user $user.
  *
  * These registration will either be those for which $user has signed up
  * himself, or for which they have been entered as "additional registered
  * persons".
  *
  * @param tx_seminars_Model_FrontEndUser $user
  *        the front-end user to limit the bag for, set to NULL to remove the
  *        limitation
  *
  * @return void
  */
 public function limitToAttendee(tx_seminars_Model_FrontEndUser $user = NULL)
 {
     if ($user === NULL) {
         unset($this->whereClauseParts['attendee']);
         return;
     }
     $whereClause = 'tx_seminars_attendances.user = '******' OR tx_seminars_attendances.uid = ' . $user->getRegistration()->getUid();
     }
     $this->whereClauseParts['attendee'] = $whereClause;
 }
 /**
  * Sets our owner.
  *
  * @param tx_seminars_Model_FrontEndUser $frontEndUser the owner of this model to set
  *
  * @return void
  */
 public function setOwner(tx_seminars_Model_FrontEndUser $frontEndUser)
 {
     $this->setRecordPropertyInteger('owner', $frontEndUser->getUid());
 }