Example #1
0
 /**
  * Gets the unique event title, consisting of the event title and the date (comma-separated).
  *
  * If the event has no date, just the title is returned.
  *
  * @param tx_seminars_Model_Event $event the event to get the unique event title for
  *
  * @return string the unique event title (or '' if there is an error)
  */
 protected function getTitleAndDate(tx_seminars_Model_Event $event)
 {
     $result = htmlspecialchars($event->getTitle());
     if (!$event->hasBeginDate()) {
         return $result;
     }
     /** @var tx_seminars_ViewHelper_DateRange $dateRangeViewHelper */
     $dateRangeViewHelper = t3lib_div::makeInstance('tx_seminars_ViewHelper_DateRange');
     return $result . ', ' . $dateRangeViewHelper->render($event);
 }
Example #2
0
 /**
  * @test
  */
 public function setPaymentMethodsSetsPaymentMethods()
 {
     $this->fixture->setData(array());
     $paymentMethods = new tx_oelib_List();
     $this->fixture->setPaymentMethods($paymentMethods);
     self::assertSame($paymentMethods, $this->fixture->getPaymentMethods());
 }
Example #3
0
 /**
  * @test
  */
 public function setPaymentMethodsThrowsException()
 {
     $this->setExpectedException('BadMethodCallException', 'setPaymentMethods may only be called on single events and event ' . 'topics, but not on event dates.');
     $topic = new tx_seminars_Model_Event();
     $this->fixture->setData(array('object_type' => tx_seminars_Model_Event::TYPE_DATE, 'topic' => $topic));
     $this->fixture->setPaymentMethods(new tx_oelib_List());
 }
Example #4
0
 /**
  * Creates a hyperlink to the single view page of the event $event.
  *
  * @param tx_seminars_Model_Event $event
  *        the event which to link to
  * @param string $linkText the link text, must not be empty
  * @param bool $htmlspecialcharLinkText whether to htmlspecialchar the link text
  *
  * @return string HTML code for the link to the event's single view page
  */
 public function createSingleViewLink(tx_seminars_Model_Event $event, $linkText, $htmlspecialcharLinkText = TRUE)
 {
     $processedLinkText = $htmlspecialcharLinkText ? htmlspecialchars($linkText) : $linkText;
     $linkConditionConfiguration = $this->getConfValueString('linkToSingleView', 's_listView');
     $createLink = $linkConditionConfiguration === 'always' || $linkConditionConfiguration === 'onlyForNonEmptyDescription' && $event->hasDescription();
     if (!$createLink) {
         return $processedLinkText;
     }
     $url = $this->getLinkBuilder()->createRelativeUrlForEvent($event);
     return '<a href="' . htmlspecialchars($url) . '">' . $processedLinkText . '</a>';
 }
Example #5
0
 /**
  * @test
  */
 public function hasImageForSingleEventWithImageReturnsTrue()
 {
     $this->fixture->setData(array('object_type' => tx_seminars_Model_Event::TYPE_COMPLETE, 'image' => 'file.jpg'));
     self::assertTrue($this->fixture->hasImage());
 }
Example #6
0
 /**
  * Builds the content for the publishing e-mail to the reviewer.
  *
  * @param tx_seminars_Model_Event $event
  *        the event to send the publication e-mail for
  *
  * @return string the e-mail body for the publishing e-mail, will not be
  *                empty
  */
 private function createEMailContent(tx_seminars_Model_Event $event)
 {
     $this->getTemplateCode(TRUE);
     $this->setLabels();
     $markerPrefix = 'publish_event';
     if ($event->hasBeginDate()) {
         $beginDate = strftime($this->getConfValueString('dateFormatYMD'), $event->getBeginDateAsUnixTimeStamp());
     } else {
         $beginDate = '';
     }
     $this->setMarker('title', $event->getTitle(), $markerPrefix);
     $this->setOrDeleteMarkerIfNotEmpty('date', $beginDate, $markerPrefix, 'wrapper_publish_event');
     $this->setMarker('description', $event->getDescription(), $markerPrefix);
     $this->setMarker('link', $this->createReviewUrl(), $markerPrefix);
     return $this->getSubpart('MAIL_PUBLISH_EVENT');
 }
 /**
  * Gets the single view page UID/URL from $event (if any single view page is set for
  * the event) or from the configuration.
  *
  * @param tx_seminars_Model_Event $event the event for which to get the single view page
  *
  * @return string
  *         the single view page UID/URL for $event, will be empty if neither
  *         the event nor the configuration has any single view page set
  */
 protected function getSingleViewPageForEvent(tx_seminars_Model_Event $event)
 {
     if ($event->hasCombinedSingleViewPage()) {
         $result = $event->getCombinedSingleViewPage();
     } elseif ($this->configurationHasSingleViewPage()) {
         $result = (string) $this->getSingleViewPageFromConfiguration();
     } else {
         $result = '';
     }
     return $result;
 }