/**
  * Returns the price, formatted as configured in TS.
  *
  * @param string $value the price
  *
  * @return string the price, formatted as in configured in TS
  */
 public function formatPrice($value)
 {
     /** @var tx_oelib_ViewHelper_Price $priceViewHelper */
     $priceViewHelper = t3lib_div::makeInstance('tx_oelib_ViewHelper_Price');
     $priceViewHelper->setCurrencyFromIsoAlpha3Code(tx_oelib_ConfigurationRegistry::get('plugin.tx_seminars')->getAsString('currency'));
     $priceViewHelper->setValue((double) $value);
     return $priceViewHelper->render();
 }
 /**
  * @test
  */
 public function createIntroductionForNoSalutationModeContainsNoRawLabelKeys()
 {
     $salutation = '';
     tx_oelib_ConfigurationRegistry::get('plugin.tx_seminars')->setAsString('salutation', $salutation);
     $dateFormatYMD = '%d.%m.%Y';
     $eventUid = $this->testingFramework->createRecord('tx_seminars_seminars', array('begin_date' => $GLOBALS['SIM_EXEC_TIME']));
     $event = new tx_seminars_seminarchild($eventUid, array('dateFormatYMD' => $dateFormatYMD, 'salutation' => $salutation));
     $introduction = $this->subject->createIntroduction('%s', $event);
     $this->assertNotContainsRawLabelKey($introduction);
 }
Example #3
0
 /**
  * @test
  */
 public function getSalutationForInformalSalutationReturnsUsersName()
 {
     $user = $this->createFrontEndUser();
     tx_oelib_ConfigurationRegistry::get('plugin.tx_seminars')->setAsString('salutation', 'informal');
     self::assertContains($user->getLastOrFullName(), $this->fixture->getSalutation($user));
 }
Example #4
0
 /**
  * @test
  */
 public function populateListOrganizersForSetStoragePageAndAuxiliaryRecordsConfigurationPidReturnsRecordWithAuxiliaryPid()
 {
     $pageUid = $this->testingFramework->createFrontEndPage(0, array('storage_pid' => 42));
     $this->testingFramework->createFakeFrontEnd($pageUid);
     $this->createLoginAndAddFrontEndUserToEventEditorFrontEndGroup();
     tx_oelib_ConfigurationRegistry::get('plugin.tx_seminars_pi1')->set('createAuxiliaryRecordsPID', 21);
     $organizerUid = $this->testingFramework->createRecord('tx_seminars_organizers', array('pid' => 21));
     self::assertTrue(in_array(array('caption' => '', 'value' => $organizerUid), $this->fixture->populateListOrganizers(array())));
 }
Example #5
0
 /**
  * Checks whether this extension's static template is included on the
  * current page.
  *
  * @return bool TRUE if the static template has been included, FALSE otherwise
  */
 private function hasStaticTemplate()
 {
     return tx_oelib_ConfigurationRegistry::get('plugin.tx_seminars')->getAsBoolean('isStaticTemplateLoaded');
 }
Example #6
0
 /**
  * @test
  */
 public function getFeUserDataWithKeyCountryAndNoCountrySetReturnsDefaultCountrySetViaTypoScriptSetup()
 {
     $this->testingFramework->createAndLoginFrontEndUser();
     tx_oelib_ConfigurationRegistry::get('plugin.tx_staticinfotables_pi1')->setAsString('countryCode', 'DEU');
     self::assertEquals('Deutschland', $this->fixture->getFeUserData(NULL, array('key' => 'country')));
 }
 /**
  * @test
  */
 public function notifyAttendeeForFormalSalutationAndGenderFemaleNotContainsRawTemplateMarkers()
 {
     if (!Tx_Oelib_Model_FrontEndUser::hasGenderField()) {
         self::markTestSkipped('This test is only applicable if there is a FrontEndUser.gender field.');
     }
     $this->fixture->setConfigurationValue('sendConfirmation', TRUE);
     tx_oelib_ConfigurationRegistry::get('plugin.tx_seminars')->setAsString('salutation', 'formal');
     $registration = $this->createRegistration();
     $this->testingFramework->changeRecord('fe_users', $registration->getFrontEndUser()->getUid(), array('email' => '*****@*****.**', 'gender' => 1));
     $pi1 = new tx_seminars_FrontEnd_DefaultController();
     $pi1->init();
     $this->fixture->notifyAttendee($registration, $pi1);
     $this->assertNotContainsRawLabelKey($this->mailer->getFirstSentEmail()->getBody());
 }
Example #8
0
 /**
  * Gets the Configuration for plugin.tx_seminars_pi1.
  *
  * @return Tx_Oelib_Configuration
  */
 protected static function getSeminarsConfiguration()
 {
     return tx_oelib_ConfigurationRegistry::get('plugin.tx_seminars_pi1');
 }
 /**
  * Retrieves the single view page UID from the flexforms/TS Setup
  * configuration.
  *
  * @return int
  *         the single view page UID from the configuration, will be 0 if no
  *         page UID has been set
  */
 protected function getSingleViewPageFromConfiguration()
 {
     if ($this->plugin !== NULL) {
         $result = $this->getPlugin()->getConfValueInteger('detailPID');
     } else {
         $result = tx_oelib_ConfigurationRegistry::get('plugin.tx_seminars_pi1')->getAsInteger('detailPID');
     }
     return $result;
 }
Example #10
0
 /**
  * @test
  */
 public function setTotalPriceWithTotalPriceSetsTotalPrice()
 {
     tx_oelib_ConfigurationRegistry::get('plugin.tx_seminars')->setAsString('currency', 'EUR');
     $this->fixture->setTotalPrice('42.42');
     self::assertSame('€ 42,42', $this->fixture->getTotalPrice());
 }
 /**
  * Checks whether the CSV file should be added to the e-mail.
  *
  * @param tx_seminars_seminar $event the event to send the e-mail for
  *
  * @return bool TRUE if the CSV file should be added, FALSE otherwise
  */
 private function shouldCsvFileBeAdded(tx_seminars_seminar $event)
 {
     return tx_oelib_ConfigurationRegistry::get('plugin.tx_seminars')->getAsBoolean('addRegistrationCsvToOrganizerReminderMail') && $event->getAttendances() > 0;
 }
Example #12
0
 /**
  * Returns the default country as localized string.
  *
  * @return string the default country's localized name, will be empty if there is no default country
  */
 private function getDefaultCountry()
 {
     $defaultCountryCode = tx_oelib_ConfigurationRegistry::get('plugin.tx_staticinfotables_pi1')->getAsString('countryCode');
     if ($defaultCountryCode === '') {
         return '';
     }
     $this->initStaticInfo();
     if (class_exists('SJBR\\StaticInfoTables\\Utility\\LocalizationUtility', TRUE)) {
         $currentLanguageCode = Tx_Oelib_ConfigurationRegistry::get('config')->getAsString('language');
         $identifiers = array('iso' => $defaultCountryCode);
         $result = \SJBR\StaticInfoTables\Utility\LocalizationUtility::getLabelFieldValue($identifiers, 'static_countries', $currentLanguageCode, TRUE);
     } else {
         $result = tx_staticinfotables_div::getTitleFromIsoCode('static_countries', $defaultCountryCode, $this->staticInfo->getCurrentLanguage(), TRUE);
     }
     return $result;
 }
 /**
  * @test
  */
 public function getSingleViewPageFromConfigurationForNoPluginSetReturnsPageUidFromTypoScriptSetup()
 {
     tx_oelib_ConfigurationRegistry::get('plugin.tx_seminars_pi1')->set('detailPID', 91);
     $fixture = new tx_seminars_tests_fixtures_Service_TestingSingleViewLinkBuilder();
     self::assertEquals(91, $fixture->getSingleViewPageFromConfiguration());
 }