/** * Returns the Singleton registration manager instance. * * @return tx_seminars_registrationmanager the Singleton instance */ public function getRegistrationManager() { return tx_seminars_registrationmanager::getInstance(); }
/** * @test */ public function sendAdditionalNotificationForEventWithZeroAttendeesMinDoesNotSendAnyMail() { $this->testingFramework->changeRecord('tx_seminars_seminars', $this->seminarUid, array('attendees_min' => 0, 'attendees_max' => 42)); unset($this->fixture); tx_seminars_registrationmanager::purgeInstance(); $this->fixture = tx_seminars_registrationmanager::getInstance(); $this->fixture->setConfigurationValue('templateFile', 'EXT:seminars/Resources/Private/Templates/Mail/e-mail.html'); $registration = $this->createRegistration(); $this->fixture->sendAdditionalNotification($registration); self::assertNull($this->mailer->getFirstSentEmail()); }
/** * Checks whether it is possible at all to register for this seminar, * ie. it needs registration at all, * has not been canceled, * has either a date set (registration for events without a date is allowed), * has not begun yet, * the registration deadline is not over yet * and there are still vacancies, * and returns a localized error message if registration is not possible. * * @return string empty string if everything is OK, else a localized * error message */ public function canSomebodyRegisterMessage() { $message = ''; $registrationManager = tx_seminars_registrationmanager::getInstance(); if (!$this->needsRegistration()) { $message = $this->translate('message_noRegistrationNecessary'); } elseif ($this->isCanceled()) { $message = $this->translate('message_seminarCancelled'); } elseif (!$this->hasDate() && !$this->getConfValueBoolean('allowRegistrationForEventsWithoutDate')) { $message = $this->translate('message_noDate'); } elseif ($this->hasDate() && $this->isRegistrationDeadlineOver()) { $message = $this->translate('message_seminarRegistrationIsClosed'); } elseif (!$registrationManager->allowsRegistrationBySeats($this)) { $message = $this->translate('message_noVacancies'); } elseif (!$registrationManager->registrationHasStarted($this)) { $message = sprintf($this->translate('message_registrationOpensOn'), $this->getRegistrationBegin()); } return $message; }
/** * Returns the requirements which should be displayed. * * @return tx_seminars_Bag_Event the requirements still to be displayed, * might be empty */ private function getRequirements() { if ($this->limitRequirementsToMissing) { $result = tx_seminars_registrationmanager::getInstance()->getMissingRequiredTopics($this->event); } else { $result = $this->event->getRequirements(); } return $result; }