Upgrade to TYPO3 9.5 LTS
This commit is contained in:
+1
@@ -0,0 +1 @@
|
||||
deny from all
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
namespace EP\EpEvents;
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 Björn Fromme <[email protected]>, dreipunktnull
|
||||
* Cedric Ziel <[email protected]>, dreipunktnull
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
final class Constants
|
||||
{
|
||||
const PAGETYPE_CATEGORY = 101;
|
||||
const PAGETYPE_OFFER = 102;
|
||||
const PAGETYPE_ACTIVITY = 103;
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
namespace EP\EpEvents\Controller;
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 Björn Fromme <[email protected]>, dreipunktnull
|
||||
* Cedric Ziel <[email protected]>, dreipunktnull
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
use EP\EpEvents\Domain\Model\Activity;
|
||||
use EP\EpEvents\Domain\Repository\ActivityRepository;
|
||||
use EP\EpEvents\Domain\Repository\OfferRepository;
|
||||
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
|
||||
|
||||
class ActivityController extends ActionController
|
||||
{
|
||||
/**
|
||||
* @var ActivityRepository
|
||||
*/
|
||||
protected $activityRepository;
|
||||
|
||||
/**
|
||||
* @var OfferRepository
|
||||
*/
|
||||
protected $offerRepository;
|
||||
|
||||
/**
|
||||
* @param ActivityRepository $activityRepository
|
||||
* @param OfferRepository $offerRepository
|
||||
*/
|
||||
public function __construct(ActivityRepository $activityRepository, OfferRepository $offerRepository)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->activityRepository = $activityRepository;
|
||||
$this->offerRepository = $offerRepository;
|
||||
}
|
||||
|
||||
public function listAction()
|
||||
{
|
||||
$configuration = ['activityType' => $this->settings['activityType']];
|
||||
$content = $this->configurationManager->getContentObject()->data;
|
||||
$activities = $this->activityRepository->findByConfiguratorType($configuration['activityType']);
|
||||
$this->view->assign('activities', $activities);
|
||||
$this->view->assign('configuration', $configuration);
|
||||
$this->view->assign('content', $content);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Activity $activity
|
||||
*/
|
||||
public function detailAction(Activity $activity)
|
||||
{
|
||||
$offers = $this->offerRepository->findByActivity($activity);
|
||||
$this->view->assign('activity', $activity);
|
||||
$this->view->assign('offers', $offers);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
<?php
|
||||
namespace EP\EpEvents\Controller;
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 Björn Fromme <[email protected]>, dreipunktnull
|
||||
* Cedric Ziel <[email protected]>, dreipunktnull
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
use EP\EpEvents\Domain\Model\Inquiry;
|
||||
use EP\EpEvents\Service\ConfigurationService;
|
||||
use EP\EpEvents\Service\EmailService;
|
||||
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
|
||||
use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
|
||||
|
||||
class AjaxFormController extends ActionController
|
||||
{
|
||||
|
||||
/**
|
||||
* @var EmailService
|
||||
*/
|
||||
protected $emailService;
|
||||
|
||||
/**
|
||||
* @var ConfigurationService
|
||||
*/
|
||||
protected $configurationService;
|
||||
|
||||
public function __construct(EmailService $emailService, ConfigurationService $configurationService)
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->emailService = $emailService;
|
||||
$this->configurationService = $configurationService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Inquiry $inquiry
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function processInquiryFormAction(Inquiry $inquiry)
|
||||
{
|
||||
$response['status'] = 'ok';
|
||||
$this->emailService->send([
|
||||
'toEmail' => $this->settings['inquiryToEmail'],
|
||||
'toName' => $this->settings['inquiryToName'],
|
||||
'subject' => 'Anfrage E&P Events',
|
||||
'templateName' => 'Email/Inquiry',
|
||||
'variables' => [ 'inquiry' => $inquiry ]
|
||||
]);
|
||||
return json_encode($response);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Inquiry $inquiry
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function processConfiguratorFormAction(Inquiry $inquiry)
|
||||
{
|
||||
$response['status'] = 'ok';
|
||||
$this->emailService->send([
|
||||
'toEmail' => $this->settings['inquiryToEmail'],
|
||||
'toName' => $this->settings['inquiryToName'],
|
||||
'subject' => 'Anfrage E&P Events',
|
||||
'templateName' => 'Email/Configurator',
|
||||
'variables' => [
|
||||
'inquiry' => $inquiry,
|
||||
'config' => $this->configurationService->getConfiguratorConfig(),
|
||||
]
|
||||
]);
|
||||
return json_encode($response);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected function errorAction() {
|
||||
$formErrors = [];
|
||||
if ($this->arguments->validate()->hasErrors()) {
|
||||
foreach ($this->arguments->validate()->getFlattenedErrors() as $key => $errors)
|
||||
{
|
||||
$key = str_replace('.', '', $key);
|
||||
$errorsRaw = [];
|
||||
foreach ($errors as $error)
|
||||
{
|
||||
$translationKey = sprintf('tx_epevents.message.%s.%s', $key, $error->getCode());
|
||||
$errorsRaw[] = LocalizationUtility::translate($translationKey, 'ep_events');
|
||||
}
|
||||
$formErrors[$key] = implode(', ', $errorsRaw);
|
||||
}
|
||||
}
|
||||
|
||||
$response['status'] = 'validation';
|
||||
$response['errors'] = $formErrors;
|
||||
|
||||
return json_encode($response);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
namespace EP\EpEvents\Controller;
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 Björn Fromme <[email protected]>, dreipunktnull
|
||||
* Cedric Ziel <[email protected]>, dreipunktnull
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
use EP\EpEvents\Domain\Repository\ContactRepository;
|
||||
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
|
||||
|
||||
class ContactController extends ActionController
|
||||
{
|
||||
/**
|
||||
* @var ContactRepository
|
||||
*/
|
||||
protected $contactRepository;
|
||||
|
||||
/**
|
||||
* @param ContactRepository $contactRepository
|
||||
*/
|
||||
public function injectContactRepository(ContactRepository $contactRepository)
|
||||
{
|
||||
$this->contactRepository = $contactRepository;
|
||||
}
|
||||
|
||||
public function listAction()
|
||||
{
|
||||
$contacts = $this->contactRepository->findAll();
|
||||
$content = $this->configurationManager->getContentObject()->data;
|
||||
$this->view->assign('contacts', $contacts);
|
||||
$this->view->assign('content', $content);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
<?php
|
||||
namespace EP\EpEvents\Controller;
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 Björn Fromme <[email protected]>, dreipunktnull
|
||||
* Cedric Ziel <[email protected]>, dreipunktnull
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
use EP\EpEvents\Domain\Model\Inquiry;
|
||||
use EP\EpEvents\Service\ConfigurationService;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
|
||||
|
||||
class FormController extends ActionController
|
||||
{
|
||||
/**
|
||||
* @var ConfigurationService
|
||||
*/
|
||||
protected $configurationService;
|
||||
|
||||
/**
|
||||
* @param ConfigurationService $configurationService
|
||||
*/
|
||||
public function __construct(ConfigurationService $configurationService)
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->configurationService = $configurationService;
|
||||
}
|
||||
|
||||
public function inquiryFormAction()
|
||||
{
|
||||
$inquiry = $this->getInquiryFromContext();
|
||||
$this->view->assign('inquiry', $inquiry);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $travelType
|
||||
* @param int $locationType
|
||||
*/
|
||||
public function contactFormAction($travelType = 0, $locationType = 0)
|
||||
{
|
||||
$inquiry = Inquiry::fromArguments($travelType, $locationType);
|
||||
$pageUrl = $this->getCurrentPageUrl();
|
||||
$inquiry->setPageUrl($pageUrl);
|
||||
$this->view->assign('inquiry', $inquiry);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $travelType
|
||||
* @param int $locationType
|
||||
*/
|
||||
public function configuratorAction($travelType = 0, $locationType = 0)
|
||||
{
|
||||
if ($travelType !== 0) {
|
||||
$inquiry = Inquiry::fromArguments($travelType, $locationType);
|
||||
} else {
|
||||
$inquiry = $this->getInquiryFromContext();
|
||||
}
|
||||
$this->view->assign('configuratorConfig', $this->configurationService->getConfiguratorConfig());
|
||||
$this->view->assign('inquiry', $inquiry);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Inquiry
|
||||
*/
|
||||
protected function getInquiryFromContext()
|
||||
{
|
||||
$content = $this->configurationManager->getContentObject()->data;
|
||||
$defaults = $this->settings['configurator']['defaults'];
|
||||
if (isset($content['offer'])) {
|
||||
$offer = $content['offer'];
|
||||
$inquiry = Inquiry::fromOffer($offer, $defaults);
|
||||
} elseif (isset($content['travelType'])) {
|
||||
$config = $this->configurationService->getConfiguratorConfig();
|
||||
/** @var \EP\EpEvents\Domain\Model\Traveltype $travelType */
|
||||
$travelType = $content['travelType'];
|
||||
$configuratorType = $travelType->getConfiguratorType();
|
||||
$inquiryName = $config['travelTypeOptions'][$configuratorType];
|
||||
$inquiry = Inquiry::fromTraveltype($travelType, $inquiryName, $defaults);
|
||||
} elseif (isset($content['activityType'])) {
|
||||
$inquiry = new Inquiry($defaults);
|
||||
$inquiry->setActivityType($content['activityType']);
|
||||
} else {
|
||||
$inquiry = new Inquiry($defaults);
|
||||
}
|
||||
$pageUrl = $this->getCurrentPageUrl();
|
||||
$inquiry->setPageUrl($pageUrl);
|
||||
return $inquiry;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected function getCurrentPageUrl()
|
||||
{
|
||||
if (GeneralUtility::_GET('ref')) {
|
||||
$pageUid = GeneralUtility::_GET('ref');
|
||||
} else {
|
||||
$pageUid = $GLOBALS['TSFE']->id;
|
||||
}
|
||||
return $this->uriBuilder
|
||||
->reset()
|
||||
->setCreateAbsoluteUri(true)
|
||||
->setTargetPageUid($pageUid)
|
||||
->build()
|
||||
;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
namespace EP\EpEvents\Controller;
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 Björn Fromme <[email protected]>, dreipunktnull
|
||||
* Cedric Ziel <[email protected]>, dreipunktnull
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
use EP\EpEvents\Domain\Model\Offer;
|
||||
use EP\EpEvents\Domain\Repository\OfferRepository;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
|
||||
|
||||
class OfferController extends ActionController
|
||||
{
|
||||
/**
|
||||
* @var OfferRepository
|
||||
*/
|
||||
protected $offerRepository;
|
||||
|
||||
/**
|
||||
* @param OfferRepository $offerRepository
|
||||
*/
|
||||
public function __construct(OfferRepository $offerRepository)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->offerRepository = $offerRepository;
|
||||
}
|
||||
|
||||
public function teaserAction()
|
||||
{
|
||||
$content = $this->configurationManager->getContentObject()->data;
|
||||
$configuration = [
|
||||
'travelType' => isset($this->settings['travelType']) ? $this->settings['travelType'] : $content['travelType'],
|
||||
'locationType' => isset($this->settings['locationType']) ? $this->settings['locationType'] : $content['locationType'],
|
||||
'locationDistance' => isset($this->settings['locationDistance']) ? $this->settings['locationDistance'] : $content['locationDistance'],
|
||||
'hotelType' => isset($this->settings['hotelType']) ? $this->settings['hotelType'] : $content['hotelType'],
|
||||
'activityType' => isset($this->settings['activityType']) ? $this->settings['activityType'] : $content['activityType'],
|
||||
'offerUid' => isset($content['offerUid']) ? $content['offerUid'] : null,
|
||||
];
|
||||
$offers = $this->offerRepository->findByConfiguration($configuration);
|
||||
$this->view->assign('offers', $offers);
|
||||
$this->view->assign('configuration', $configuration);
|
||||
$this->view->assign('content', $content);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Offer $offer
|
||||
*/
|
||||
public function detailAction(Offer $offer = null)
|
||||
{
|
||||
if ($offer === null) {
|
||||
$pageUid = $GLOBALS['TSFE']->id;
|
||||
$offer = $this->offerRepository->findByDetailPage($pageUid)->getFirst();
|
||||
}
|
||||
$search = GeneralUtility::_GET('search');
|
||||
$this->view->assign('offer', $offer);
|
||||
$this->view->assign('search', $search);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
<?php
|
||||
namespace EP\EpEvents\Controller;
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 Björn Fromme <[email protected]>, dreipunktnull
|
||||
* Cedric Ziel <[email protected]>, dreipunktnull
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
use EP\EpEvents\Domain\Model\Search;
|
||||
use EP\EpEvents\Domain\Repository\OfferRepository;
|
||||
use TYPO3\CMS\Core\Log\LogManager;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
|
||||
|
||||
class SearchController extends ActionController
|
||||
{
|
||||
/**
|
||||
* @var OfferRepository
|
||||
*/
|
||||
protected $offerRepository;
|
||||
|
||||
/**
|
||||
* @param OfferRepository $offerRepository
|
||||
*/
|
||||
public function __construct(OfferRepository $offerRepository)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->offerRepository = $offerRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Search $search
|
||||
*/
|
||||
public function formAction(Search $search = null)
|
||||
{
|
||||
if ($search === null) {
|
||||
$search = new Search(null, $GLOBALS['TSFE']->id);
|
||||
}
|
||||
$this->view->assign('search', $search);
|
||||
}
|
||||
|
||||
public function initializeResultAction()
|
||||
{
|
||||
$query = GeneralUtility::_GET('search');
|
||||
if ($query) {
|
||||
$search = new Search($query);
|
||||
$this->request->setArgument('search', $search);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Search $search
|
||||
*/
|
||||
public function resultAction(Search $search = null)
|
||||
{
|
||||
if ($search === null) {
|
||||
$this->redirectToUri('/');
|
||||
}
|
||||
$result = null;
|
||||
$searchValid = strlen($search->getQuery()) >= 3;
|
||||
if ($searchValid) {
|
||||
$this->logSearch($search);
|
||||
$result = $this->offerRepository->search($search->getQuery());
|
||||
}
|
||||
$this->view->assign('searchValid', $searchValid);
|
||||
$this->view->assign('result', $result);
|
||||
$this->view->assign('search', $search);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Search $search
|
||||
*/
|
||||
private function logSearch(Search $search)
|
||||
{
|
||||
$ignoreIps = GeneralUtility::trimExplode(',', $this->settings['searchLogIgnoreIps'], true);
|
||||
$remoteIp = GeneralUtility::getIndpEnv('REMOTE_ADDR');
|
||||
if (in_array($remoteIp, $ignoreIps)) {
|
||||
return;
|
||||
}
|
||||
/** @var $logger \TYPO3\CMS\Core\Log\Logger */
|
||||
$logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(__CLASS__);
|
||||
$logger->info('Searchresult processed', [
|
||||
'search' => $search->getQuery(),
|
||||
'pageUid' => $search->getPageUid(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
namespace EP\EpEvents\Controller;
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 Björn Fromme <[email protected]>, dreipunktnull
|
||||
* Cedric Ziel <[email protected]>, dreipunktnull
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
use EP\EpEvents\Domain\Repository\TestimonialRepository;
|
||||
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
|
||||
|
||||
class TestimonialController extends ActionController
|
||||
{
|
||||
/**
|
||||
* @var TestimonialRepository
|
||||
*/
|
||||
protected $testimonialRepository;
|
||||
|
||||
/**
|
||||
* @param TestimonialRepository $testimonialRepository
|
||||
*/
|
||||
public function injectTestimonialRepository(TestimonialRepository $testimonialRepository)
|
||||
{
|
||||
$this->testimonialRepository = $testimonialRepository;
|
||||
}
|
||||
|
||||
public function listAction()
|
||||
{
|
||||
$testimonials = $this->testimonialRepository->findAll();
|
||||
$content = $this->configurationManager->getContentObject()->data;
|
||||
$this->view->assign('testimonials', $testimonials);
|
||||
$this->view->assign('content', $content);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
namespace EP\EpEvents\DataProcessing;
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 Björn Fromme <[email protected]>, dreipunktnull
|
||||
* Cedric Ziel <[email protected]>, dreipunktnull
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
use EP\EpEvents\Constants;
|
||||
use EP\EpEvents\Domain\Repository\OfferRepository;
|
||||
use EP\EpEvents\Domain\Repository\TraveltypeRepository;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Extbase\Object\ObjectManager;
|
||||
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
|
||||
use TYPO3\CMS\Frontend\ContentObject\DataProcessorInterface;
|
||||
|
||||
class OfferProcessor implements DataProcessorInterface
|
||||
{
|
||||
/**
|
||||
* @param ContentObjectRenderer $cObj
|
||||
* @param array $contentObjectConfiguration
|
||||
* @param array $processorConfiguration
|
||||
* @param array $processedData
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function process(
|
||||
ContentObjectRenderer $cObj,
|
||||
array $contentObjectConfiguration,
|
||||
array $processorConfiguration,
|
||||
array $processedData
|
||||
) {
|
||||
// Process page data for special page type only
|
||||
if ((int) $cObj->data['doktype'] !== Constants::PAGETYPE_OFFER) {
|
||||
return $processedData;
|
||||
}
|
||||
// Get offer repository instance
|
||||
/** @var \TYPO3\CMS\Extbase\Object\ObjectManager $objectManager */
|
||||
$objectManager = GeneralUtility::makeInstance(ObjectManager::class);
|
||||
/** @var \EP\EpEvents\Domain\Repository\OfferRepository $repository */
|
||||
$repository = $objectManager->get(OfferRepository::class);
|
||||
$offer = null;
|
||||
// First look for selected offer in page settings and fetch offer
|
||||
// by page uid otherwise
|
||||
$offerUid = (int) $cObj->data['tx_epevents_offer'];
|
||||
if ($offerUid !== 0) {
|
||||
/** @var \EP\EpEvents\Domain\Model\Offer $offer */
|
||||
$offer = $repository->forceFindByUid($offerUid)->getFirst();
|
||||
} else {
|
||||
$pageUid = $GLOBALS['TSFE']->id;
|
||||
$offer = $repository->forceFindByDetailPage($pageUid)->getFirst();
|
||||
}
|
||||
/** @var \EP\EpEvents\Domain\Model\Offer $offer */
|
||||
$processedData['offer'] = $offer;
|
||||
$processedData['travelType'] = null;
|
||||
if ($offer->getConfiguratorType()) {
|
||||
$configuratorType = $offer->getConfiguratorType();
|
||||
/** @var \EP\EpEvents\Domain\Repository\TraveltypeRepository $repository */
|
||||
$repository = $objectManager->get(TraveltypeRepository::class);
|
||||
$processedData['traveltype'] = $repository->findOneByConfiguratorType($configuratorType);
|
||||
}
|
||||
if ($offer->getLocation()) {
|
||||
$processedData['locationtype'] = $offer->getLocation()->getConfiguratorType();
|
||||
}
|
||||
$processedData['search'] = GeneralUtility::_GET('search');
|
||||
return $processedData;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
namespace EP\EpEvents\DataProcessing;
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 Björn Fromme <[email protected]>, dreipunktnull
|
||||
* Cedric Ziel <[email protected]>, dreipunktnull
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
use EP\EpEvents\Constants;
|
||||
use EP\EpEvents\Domain\Repository\TraveltypeRepository;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Extbase\Object\ObjectManager;
|
||||
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
|
||||
use TYPO3\CMS\Frontend\ContentObject\DataProcessorInterface;
|
||||
|
||||
class TraveltypeProcessor implements DataProcessorInterface
|
||||
{
|
||||
/**
|
||||
* @param ContentObjectRenderer $cObj
|
||||
* @param array $contentObjectConfiguration
|
||||
* @param array $processorConfiguration
|
||||
* @param array $processedData
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function process(
|
||||
ContentObjectRenderer $cObj,
|
||||
array $contentObjectConfiguration,
|
||||
array $processorConfiguration,
|
||||
array $processedData
|
||||
) {
|
||||
// Process page data for special page type only
|
||||
if ((int) $cObj->data['doktype'] !== Constants::PAGETYPE_CATEGORY) {
|
||||
return $processedData;
|
||||
}
|
||||
// Get traveltype repository instance
|
||||
/** @var \TYPO3\CMS\Extbase\Object\ObjectManager $objectManager */
|
||||
$objectManager = GeneralUtility::makeInstance(ObjectManager::class);
|
||||
/** @var \EP\EpEvents\Domain\Repository\TraveltypeRepository $repository */
|
||||
$repository = $objectManager->get(TraveltypeRepository::class);
|
||||
$traveltype = null;
|
||||
$traveltypeUid = (int) $cObj->data['tx_epevents_traveltype'];
|
||||
if ($traveltypeUid !== 0) {
|
||||
/** @var \EP\EpEvents\Domain\Model\Traveltype $traveltype */
|
||||
$traveltype = $repository->findByIdentifier($traveltypeUid);
|
||||
}
|
||||
$processedData['traveltype'] = $traveltype;
|
||||
return $processedData;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,241 @@
|
||||
<?php
|
||||
namespace EP\EpEvents\Domain\Model;
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 Björn Fromme <[email protected]>, dreipunktnull
|
||||
* Cedric Ziel <[email protected]>, dreipunktnull
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
/**
|
||||
* Activity
|
||||
*/
|
||||
class Activity extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
|
||||
{
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $configuratorTypeLabels = [
|
||||
1 => 'Outdoor & Action',
|
||||
2 => 'Event-Gastronomie',
|
||||
3 => 'Sightseeing',
|
||||
4 => 'Spezial',
|
||||
];
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $name = '';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $description = '';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $footertext = '';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $bannertext = '';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $keywords = '';
|
||||
|
||||
/**
|
||||
* @var \TYPO3\CMS\Extbase\Domain\Model\FileReference
|
||||
*/
|
||||
protected $imageTeaser;
|
||||
|
||||
/**
|
||||
* @var \TYPO3\CMS\Extbase\Domain\Model\FileReference
|
||||
*/
|
||||
protected $imageHeader;
|
||||
|
||||
/**
|
||||
* @var \TYPO3\CMS\Extbase\Domain\Model\FileReference
|
||||
*/
|
||||
protected $imageOffer;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $configuratorType = 0;
|
||||
|
||||
/**
|
||||
* @return string $name
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
$this->name = $name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string $description
|
||||
*/
|
||||
public function getDescription()
|
||||
{
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $description
|
||||
*/
|
||||
public function setDescription($description)
|
||||
{
|
||||
$this->description = $description;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getFootertext()
|
||||
{
|
||||
return $this->footertext;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $footertext
|
||||
*/
|
||||
public function setFootertext($footertext)
|
||||
{
|
||||
$this->footertext = $footertext;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getBannertext()
|
||||
{
|
||||
return $this->bannertext;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $bannertext
|
||||
*/
|
||||
public function setBannertext($bannertext)
|
||||
{
|
||||
$this->bannertext = $bannertext;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getKeywords()
|
||||
{
|
||||
return $this->keywords;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $keywords
|
||||
*/
|
||||
public function setKeywords($keywords)
|
||||
{
|
||||
$this->keywords = $keywords;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \TYPO3\CMS\Extbase\Domain\Model\FileReference $imageTeaser
|
||||
*/
|
||||
public function getImageTeaser()
|
||||
{
|
||||
return $this->imageTeaser;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $imageTeaser
|
||||
*/
|
||||
public function setImageTeaser(\TYPO3\CMS\Extbase\Domain\Model\FileReference $imageTeaser)
|
||||
{
|
||||
$this->imageTeaser = $imageTeaser;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \TYPO3\CMS\Extbase\Domain\Model\FileReference $imageHeader
|
||||
*/
|
||||
public function getImageHeader()
|
||||
{
|
||||
return $this->imageHeader;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $imageHeader
|
||||
*/
|
||||
public function setImageHeader(\TYPO3\CMS\Extbase\Domain\Model\FileReference $imageHeader)
|
||||
{
|
||||
$this->imageHeader = $imageHeader;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \TYPO3\CMS\Extbase\Domain\Model\FileReference $imageOffer
|
||||
*/
|
||||
public function getImageOffer()
|
||||
{
|
||||
return $this->imageOffer;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $imageOffer
|
||||
*/
|
||||
public function setImageOffer(\TYPO3\CMS\Extbase\Domain\Model\FileReference $imageOffer)
|
||||
{
|
||||
$this->imageOffer = $imageOffer;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int $configuratorType
|
||||
*/
|
||||
public function getConfiguratorType()
|
||||
{
|
||||
return $this->configuratorType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $configuratorType
|
||||
*/
|
||||
public function setConfiguratorType($configuratorType)
|
||||
{
|
||||
$this->configuratorType = $configuratorType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getConfiguratorTypeLabel()
|
||||
{
|
||||
return $this->configuratorTypeLabels[$this->configuratorType];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,166 @@
|
||||
<?php
|
||||
namespace EP\EpEvents\Domain\Model;
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 Björn Fromme <[email protected]>, dreipunktnull
|
||||
* Cedric Ziel <[email protected]>, dreipunktnull
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
/**
|
||||
* Contact
|
||||
*/
|
||||
class Contact extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
|
||||
{
|
||||
|
||||
/**
|
||||
* name
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $name = '';
|
||||
|
||||
/**
|
||||
* position
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $position = '';
|
||||
|
||||
/**
|
||||
* email
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $email = '';
|
||||
|
||||
/**
|
||||
* phone
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $phone = '';
|
||||
|
||||
/**
|
||||
* image
|
||||
*
|
||||
* @var \TYPO3\CMS\Extbase\Domain\Model\FileReference
|
||||
*/
|
||||
protected $image = null;
|
||||
|
||||
/**
|
||||
* Returns the name
|
||||
*
|
||||
* @return string $name
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the name
|
||||
*
|
||||
* @param string $name
|
||||
* @return void
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
$this->name = $name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getPosition()
|
||||
{
|
||||
return $this->position;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $position
|
||||
*/
|
||||
public function setPosition($position)
|
||||
{
|
||||
$this->position = $position;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the email
|
||||
*
|
||||
* @return string $email
|
||||
*/
|
||||
public function getEmail()
|
||||
{
|
||||
return $this->email;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the email
|
||||
*
|
||||
* @param string $email
|
||||
* @return void
|
||||
*/
|
||||
public function setEmail($email)
|
||||
{
|
||||
$this->email = $email;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getPhone()
|
||||
{
|
||||
return $this->phone;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $phone
|
||||
*/
|
||||
public function setPhone($phone)
|
||||
{
|
||||
$this->phone = $phone;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the image
|
||||
*
|
||||
* @return \TYPO3\CMS\Extbase\Domain\Model\FileReference $image
|
||||
*/
|
||||
public function getImage()
|
||||
{
|
||||
return $this->image;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the image
|
||||
*
|
||||
* @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $image
|
||||
* @return void
|
||||
*/
|
||||
public function setImage(\TYPO3\CMS\Extbase\Domain\Model\FileReference $image)
|
||||
{
|
||||
$this->image = $image;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,197 @@
|
||||
<?php
|
||||
namespace EP\EpEvents\Domain\Model;
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 Björn Fromme <[email protected]>, dreipunktnull
|
||||
* Cedric Ziel <[email protected]>, dreipunktnull
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
/**
|
||||
* Hotel
|
||||
*/
|
||||
class Hotel extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
|
||||
{
|
||||
/**
|
||||
* name
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $name = '';
|
||||
|
||||
/**
|
||||
* internal name
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $nameInternal = '';
|
||||
|
||||
/**
|
||||
* description
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = '';
|
||||
|
||||
/**
|
||||
* imageTeaser
|
||||
*
|
||||
* @var \TYPO3\CMS\Extbase\Domain\Model\FileReference
|
||||
*/
|
||||
protected $imageTeaser = null;
|
||||
|
||||
/**
|
||||
* imageOffer
|
||||
*
|
||||
* @var \TYPO3\CMS\Extbase\Domain\Model\FileReference
|
||||
*/
|
||||
protected $imageOffer = null;
|
||||
|
||||
/**
|
||||
* configuratorType
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $configuratorType = 0;
|
||||
|
||||
/**
|
||||
* Returns the name
|
||||
*
|
||||
* @return string $name
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the name
|
||||
*
|
||||
* @param string $name
|
||||
* @return void
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
$this->name = $name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getNameInternal()
|
||||
{
|
||||
return $this->nameInternal;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $nameInternal
|
||||
*/
|
||||
public function setNameInternal($nameInternal)
|
||||
{
|
||||
$this->nameInternal = $nameInternal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the description
|
||||
*
|
||||
* @return string $description
|
||||
*/
|
||||
public function getDescription()
|
||||
{
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the description
|
||||
*
|
||||
* @param string $description
|
||||
* @return void
|
||||
*/
|
||||
public function setDescription($description)
|
||||
{
|
||||
$this->description = $description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the imageTeaser
|
||||
*
|
||||
* @return \TYPO3\CMS\Extbase\Domain\Model\FileReference $imageTeaser
|
||||
*/
|
||||
public function getImageTeaser()
|
||||
{
|
||||
return $this->imageTeaser;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the imageTeaser
|
||||
*
|
||||
* @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $imageTeaser
|
||||
* @return void
|
||||
*/
|
||||
public function setImageTeaser(\TYPO3\CMS\Extbase\Domain\Model\FileReference $imageTeaser)
|
||||
{
|
||||
$this->imageTeaser = $imageTeaser;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the imageOffer
|
||||
*
|
||||
* @return \TYPO3\CMS\Extbase\Domain\Model\FileReference $imageOffer
|
||||
*/
|
||||
public function getImageOffer()
|
||||
{
|
||||
return $this->imageOffer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the imageOffer
|
||||
*
|
||||
* @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $imageOffer
|
||||
* @return void
|
||||
*/
|
||||
public function setImageOffer(\TYPO3\CMS\Extbase\Domain\Model\FileReference $imageOffer)
|
||||
{
|
||||
$this->imageOffer = $imageOffer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the configuratorType
|
||||
*
|
||||
* @return int $configuratorType
|
||||
*/
|
||||
public function getConfiguratorType()
|
||||
{
|
||||
return $this->configuratorType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the configuratorType
|
||||
*
|
||||
* @param int $configuratorType
|
||||
* @return void
|
||||
*/
|
||||
public function setConfiguratorType($configuratorType)
|
||||
{
|
||||
$this->configuratorType = $configuratorType;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,462 @@
|
||||
<?php
|
||||
namespace EP\EpEvents\Domain\Model;
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 Björn Fromme <[email protected]>, dreipunktnull
|
||||
* Cedric Ziel <[email protected]>, dreipunktnull
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
use TYPO3\CMS\Extbase\DomainObject\AbstractValueObject;
|
||||
|
||||
class Inquiry extends AbstractValueObject
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $inquiryName;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $travelType;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $hotelType;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $locationType;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $activityType;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $distance;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $pax;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $budget;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $period;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $dateFrom;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $dateTo;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @TYPO3\CMS\Extbase\Annotation\Validate("NotEmpty")
|
||||
*/
|
||||
protected $name;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @TYPO3\CMS\Extbase\Annotation\Validate("NotEmpty")
|
||||
* @TYPO3\CMS\Extbase\Annotation\Validate("EmailAddress")
|
||||
*/
|
||||
protected $email;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @TYPO3\CMS\Extbase\Annotation\Validate("NotEmpty")
|
||||
*/
|
||||
protected $phone;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $message;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $pageUrl;
|
||||
|
||||
/**
|
||||
* @param array $defaults
|
||||
*/
|
||||
public function __construct(array $defaults = [])
|
||||
{
|
||||
foreach ($defaults as $key => $value)
|
||||
{
|
||||
if (property_exists($this, $key)) {
|
||||
$this->$key = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Offer $offer
|
||||
* @param array $defaults
|
||||
*
|
||||
* @return Inquiry
|
||||
*/
|
||||
public static function fromOffer(Offer $offer, array $defaults = [])
|
||||
{
|
||||
$inquiry = new self($defaults);
|
||||
$inquiry->setInquiryName($offer->getName() . ' ' . $offer->getLocation()->getName());
|
||||
$inquiry->setTravelType($offer->getConfiguratorType());
|
||||
if ($offer->getLocation()) {
|
||||
$inquiry->setLocationType($offer->getLocation()->getConfiguratorType());
|
||||
}
|
||||
if ($offer->getHotel()) {
|
||||
$inquiry->setHotelType($offer->getHotel()->getConfiguratorType());
|
||||
}
|
||||
if ($offer->getLocation()->getConfiguratorDistance()) {
|
||||
$inquiry->setDistance($offer->getLocation()->getConfiguratorDistance());
|
||||
}
|
||||
if ($offer->getConfiguratorBudget()) {
|
||||
$inquiry->setBudget($offer->getConfiguratorBudget());
|
||||
}
|
||||
if ($offer->getConfiguratorPax()) {
|
||||
$inquiry->setPax($offer->getConfiguratorPax());
|
||||
}
|
||||
if ($offer->getConfiguratorPeriod()) {
|
||||
$inquiry->setPeriod($offer->getConfiguratorPeriod());
|
||||
}
|
||||
$activities = [];
|
||||
/** @var \EP\EpEvents\Domain\Model\Activity $activity */
|
||||
foreach ($offer->getActivities() as $activity)
|
||||
{
|
||||
$activities[] = $activity->getConfiguratorType();
|
||||
}
|
||||
$inquiry->setActivityType(implode(',', array_unique($activities)));
|
||||
return $inquiry;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Traveltype $traveltype
|
||||
* @param string $name
|
||||
* @param array $defaults
|
||||
*
|
||||
* @return Inquiry
|
||||
*/
|
||||
public static function fromTraveltype(Traveltype $traveltype, $name = '', array $defaults = [])
|
||||
{
|
||||
$inquiry = new self($defaults);
|
||||
$inquiry->setInquiryName($name);
|
||||
$inquiry->setTravelType($traveltype->getConfiguratorType());
|
||||
return $inquiry;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $travelType
|
||||
* @param int $locationType
|
||||
*
|
||||
* @return Inquiry
|
||||
*/
|
||||
public static function fromArguments($travelType = 0, $locationType = 0)
|
||||
{
|
||||
$inquiry = new self;
|
||||
if ($travelType) {
|
||||
$inquiry->setTravelType((string) $travelType);
|
||||
}
|
||||
if ($locationType) {
|
||||
$inquiry->setLocationType((string) $locationType);
|
||||
}
|
||||
return $inquiry;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getInquiryName()
|
||||
{
|
||||
return $this->inquiryName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $inquiryName
|
||||
*/
|
||||
public function setInquiryName($inquiryName)
|
||||
{
|
||||
$this->inquiryName = $inquiryName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getTravelType()
|
||||
{
|
||||
return $this->travelType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $travelType
|
||||
*/
|
||||
public function setTravelType($travelType)
|
||||
{
|
||||
$this->travelType = $travelType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getHotelType()
|
||||
{
|
||||
return $this->hotelType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $hotelType
|
||||
*/
|
||||
public function setHotelType($hotelType)
|
||||
{
|
||||
$this->hotelType = $hotelType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getLocationType()
|
||||
{
|
||||
return $this->locationType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $locationType
|
||||
*/
|
||||
public function setLocationType($locationType)
|
||||
{
|
||||
$this->locationType = $locationType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getActivityType()
|
||||
{
|
||||
return $this->activityType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $activityType
|
||||
*/
|
||||
public function setActivityType($activityType)
|
||||
{
|
||||
$this->activityType = $activityType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getDistance()
|
||||
{
|
||||
return $this->distance;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $distance
|
||||
*/
|
||||
public function setDistance($distance)
|
||||
{
|
||||
$this->distance = $distance;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getPax()
|
||||
{
|
||||
return $this->pax;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $pax
|
||||
*/
|
||||
public function setPax($pax)
|
||||
{
|
||||
$this->pax = $pax;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getBudget()
|
||||
{
|
||||
return $this->budget;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $budget
|
||||
*/
|
||||
public function setBudget($budget)
|
||||
{
|
||||
$this->budget = $budget;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getPeriod()
|
||||
{
|
||||
return $this->period;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $period
|
||||
*/
|
||||
public function setPeriod($period)
|
||||
{
|
||||
$this->period = $period;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getDateFrom()
|
||||
{
|
||||
return $this->dateFrom;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $dateFrom
|
||||
*/
|
||||
public function setDateFrom($dateFrom)
|
||||
{
|
||||
$this->dateFrom = $dateFrom;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getDateTo()
|
||||
{
|
||||
return $this->dateTo;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $dateTo
|
||||
*/
|
||||
public function setDateTo($dateTo)
|
||||
{
|
||||
$this->dateTo = $dateTo;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
$this->name = $name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getEmail()
|
||||
{
|
||||
return $this->email;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $email
|
||||
*/
|
||||
public function setEmail($email)
|
||||
{
|
||||
$this->email = $email;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getPhone()
|
||||
{
|
||||
return $this->phone;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $phone
|
||||
*/
|
||||
public function setPhone($phone)
|
||||
{
|
||||
$this->phone = $phone;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getMessage()
|
||||
{
|
||||
return $this->message;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $message
|
||||
*/
|
||||
public function setMessage($message)
|
||||
{
|
||||
$this->message = $message;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getPageUrl()
|
||||
{
|
||||
return $this->pageUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $pageUrl
|
||||
*/
|
||||
public function setPageUrl($pageUrl)
|
||||
{
|
||||
$this->pageUrl = $pageUrl;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,364 @@
|
||||
<?php
|
||||
namespace EP\EpEvents\Domain\Model;
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 Björn Fromme <[email protected]>, dreipunktnull
|
||||
* Cedric Ziel <[email protected]>, dreipunktnull
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
/**
|
||||
* Location
|
||||
*/
|
||||
class Location extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
|
||||
{
|
||||
const DISTANCE_GERMANY = 1;
|
||||
const DISTANCE_EUROPE = 2;
|
||||
const DISTANCE_WORLD = 3;
|
||||
|
||||
/**
|
||||
* name
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $name = '';
|
||||
|
||||
/**
|
||||
* descriptionShort
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $descriptionShort = '';
|
||||
|
||||
/**
|
||||
* descriptionLong
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $descriptionLong = '';
|
||||
|
||||
/**
|
||||
* season
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $season = '';
|
||||
|
||||
/**
|
||||
* imageHeader
|
||||
*
|
||||
* @var \TYPO3\CMS\Extbase\Domain\Model\FileReference
|
||||
*/
|
||||
protected $imageHeader = null;
|
||||
|
||||
/**
|
||||
* imageTeaser
|
||||
*
|
||||
* @var \TYPO3\CMS\Extbase\Domain\Model\FileReference
|
||||
*/
|
||||
protected $imageTeaser = null;
|
||||
|
||||
/**
|
||||
* imageOffer
|
||||
*
|
||||
* @var \TYPO3\CMS\Extbase\Domain\Model\FileReference
|
||||
*/
|
||||
protected $imageOffer = null;
|
||||
|
||||
/**
|
||||
* configuratorType
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $configuratorType = 0;
|
||||
|
||||
/**
|
||||
* configuratorDistance
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $configuratorDistance = 1;
|
||||
|
||||
/**
|
||||
* footerText1
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $footerText1 = '';
|
||||
|
||||
/**
|
||||
* footerText2
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $footerText2 = '';
|
||||
|
||||
/**
|
||||
* footerText3
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $footerText3 = '';
|
||||
|
||||
/**
|
||||
* Returns the name
|
||||
*
|
||||
* @return string $name
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the name
|
||||
*
|
||||
* @param string $name
|
||||
* @return void
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
$this->name = $name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the descriptionShort
|
||||
*
|
||||
* @return string $descriptionShort
|
||||
*/
|
||||
public function getDescriptionShort()
|
||||
{
|
||||
return $this->descriptionShort;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the descriptionShort
|
||||
*
|
||||
* @param string $descriptionShort
|
||||
* @return void
|
||||
*/
|
||||
public function setDescriptionShort($descriptionShort)
|
||||
{
|
||||
$this->descriptionShort = $descriptionShort;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the imageHeader
|
||||
*
|
||||
* @return \TYPO3\CMS\Extbase\Domain\Model\FileReference $imageHeader
|
||||
*/
|
||||
public function getImageHeader()
|
||||
{
|
||||
return $this->imageHeader;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the imageHeader
|
||||
*
|
||||
* @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $imageHeader
|
||||
* @return void
|
||||
*/
|
||||
public function setImageHeader(\TYPO3\CMS\Extbase\Domain\Model\FileReference $imageHeader)
|
||||
{
|
||||
$this->imageHeader = $imageHeader;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the imageTeaser
|
||||
*
|
||||
* @return \TYPO3\CMS\Extbase\Domain\Model\FileReference $imageTeaser
|
||||
*/
|
||||
public function getImageTeaser()
|
||||
{
|
||||
return $this->imageTeaser;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the imageTeaser
|
||||
*
|
||||
* @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $imageTeaser
|
||||
* @return void
|
||||
*/
|
||||
public function setImageTeaser(\TYPO3\CMS\Extbase\Domain\Model\FileReference $imageTeaser)
|
||||
{
|
||||
$this->imageTeaser = $imageTeaser;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the imageOffer
|
||||
*
|
||||
* @return \TYPO3\CMS\Extbase\Domain\Model\FileReference $imageOffer
|
||||
*/
|
||||
public function getImageOffer()
|
||||
{
|
||||
return $this->imageOffer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the imageOffer
|
||||
*
|
||||
* @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $imageOffer
|
||||
* @return void
|
||||
*/
|
||||
public function setImageOffer(\TYPO3\CMS\Extbase\Domain\Model\FileReference $imageOffer)
|
||||
{
|
||||
$this->imageOffer = $imageOffer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the configuratorType
|
||||
*
|
||||
* @return int $configuratorType
|
||||
*/
|
||||
public function getConfiguratorType()
|
||||
{
|
||||
return $this->configuratorType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the configuratorType
|
||||
*
|
||||
* @param int $configuratorType
|
||||
* @return void
|
||||
*/
|
||||
public function setConfiguratorType($configuratorType)
|
||||
{
|
||||
$this->configuratorType = $configuratorType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getConfiguratorDistance()
|
||||
{
|
||||
return $this->configuratorDistance;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $configuratorDistance
|
||||
*/
|
||||
public function setConfiguratorDistance($configuratorDistance)
|
||||
{
|
||||
$this->configuratorDistance = $configuratorDistance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the descriptionLong
|
||||
*
|
||||
* @return string descriptionLong
|
||||
*/
|
||||
public function getDescriptionLong()
|
||||
{
|
||||
return $this->descriptionLong;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the descriptionLong
|
||||
*
|
||||
* @param string $descriptionLong
|
||||
* @return void
|
||||
*/
|
||||
public function setDescriptionLong($descriptionLong)
|
||||
{
|
||||
$this->descriptionLong = $descriptionLong;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getSeason()
|
||||
{
|
||||
return $this->season;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $season
|
||||
*/
|
||||
public function setSeason($season)
|
||||
{
|
||||
$this->season = $season;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the footerText1
|
||||
*
|
||||
* @return string $footerText1
|
||||
*/
|
||||
public function getFooterText1()
|
||||
{
|
||||
return $this->footerText1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the footerText1
|
||||
*
|
||||
* @param string $footerText1
|
||||
* @return void
|
||||
*/
|
||||
public function setFooterText1($footerText1)
|
||||
{
|
||||
$this->footerText1 = $footerText1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the footerText2
|
||||
*
|
||||
* @return string $footerText2
|
||||
*/
|
||||
public function getFooterText2()
|
||||
{
|
||||
return $this->footerText2;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the footerText2
|
||||
*
|
||||
* @param string $footerText2
|
||||
* @return void
|
||||
*/
|
||||
public function setFooterText2($footerText2)
|
||||
{
|
||||
$this->footerText2 = $footerText2;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the footerText3
|
||||
*
|
||||
* @return string $footerText3
|
||||
*/
|
||||
public function getFooterText3()
|
||||
{
|
||||
return $this->footerText3;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the footerText3
|
||||
*
|
||||
* @param string $footerText3
|
||||
* @return void
|
||||
*/
|
||||
public function setFooterText3($footerText3)
|
||||
{
|
||||
$this->footerText3 = $footerText3;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,721 @@
|
||||
<?php
|
||||
namespace EP\EpEvents\Domain\Model;
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 Björn Fromme <[email protected]>, dreipunktnull
|
||||
* Cedric Ziel <[email protected]>, dreipunktnull
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
/**
|
||||
* Offer
|
||||
*/
|
||||
class Offer extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
|
||||
{
|
||||
const TYPE_EXAMPLE = 1;
|
||||
const TYPE_CLIENT = 2;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $configuratorTypeLabels = [
|
||||
1 => 'Incentive',
|
||||
2 => 'Team Building',
|
||||
3 => 'Meeting',
|
||||
4 => 'Corporate Event',
|
||||
];
|
||||
|
||||
/**
|
||||
* type
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $type = 1;
|
||||
|
||||
/**
|
||||
* name
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $name = '';
|
||||
|
||||
/**
|
||||
* name internal
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $nameInternal = '';
|
||||
|
||||
/**
|
||||
* groupname
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $groupname = '';
|
||||
|
||||
/**
|
||||
* price
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $price = 0;
|
||||
|
||||
/**
|
||||
* headline
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $headline = '';
|
||||
|
||||
/**
|
||||
* header
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $header = '';
|
||||
|
||||
/**
|
||||
* arrival
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $arrival = '';
|
||||
|
||||
/**
|
||||
* schedule
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $schedule = '';
|
||||
|
||||
/**
|
||||
* services
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $services = '';
|
||||
|
||||
/**
|
||||
* guidelines
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $guidelines = '';
|
||||
|
||||
/**
|
||||
* imageHeader
|
||||
*
|
||||
* @var \TYPO3\CMS\Extbase\Domain\Model\FileReference
|
||||
*/
|
||||
protected $imageHeader;
|
||||
|
||||
/**
|
||||
* imageTeaser
|
||||
*
|
||||
* @var \TYPO3\CMS\Extbase\Domain\Model\FileReference
|
||||
*/
|
||||
protected $imageTeaser;
|
||||
|
||||
/**
|
||||
* imageTeaserMobile
|
||||
*
|
||||
* @var \TYPO3\CMS\Extbase\Domain\Model\FileReference
|
||||
*/
|
||||
protected $imageTeaserMobile;
|
||||
|
||||
/**
|
||||
* bookingForm
|
||||
*
|
||||
* @var \TYPO3\CMS\Extbase\Domain\Model\FileReference
|
||||
*/
|
||||
protected $bookingForm;
|
||||
|
||||
/**
|
||||
* configuratorType
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $configuratorType = 0;
|
||||
|
||||
/**
|
||||
* configuratorBudget
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $configuratorBudget = 0;
|
||||
|
||||
/**
|
||||
* configuratorPax
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $configuratorPax = 0;
|
||||
|
||||
/**
|
||||
* configuratorPeriod
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $configuratorPeriod = 0;
|
||||
|
||||
/**
|
||||
* contact
|
||||
*
|
||||
* @var \EP\EpEvents\Domain\Model\Contact
|
||||
*/
|
||||
protected $contact;
|
||||
|
||||
/**
|
||||
* hotel
|
||||
*
|
||||
* @var \EP\EpEvents\Domain\Model\Hotel
|
||||
*/
|
||||
protected $hotel;
|
||||
|
||||
/**
|
||||
* location
|
||||
*
|
||||
* @var \EP\EpEvents\Domain\Model\Location
|
||||
*/
|
||||
protected $location;
|
||||
|
||||
/**
|
||||
* activities
|
||||
*
|
||||
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\EP\EpEvents\Domain\Model\Activity>
|
||||
*/
|
||||
protected $activities;
|
||||
|
||||
/**
|
||||
* detailPage
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $detailPage;
|
||||
|
||||
/**
|
||||
* __construct
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
//Do not remove the next line: It would break the functionality
|
||||
$this->initStorageObjects();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes all ObjectStorage properties
|
||||
* Do not modify this method!
|
||||
* It will be rewritten on each save in the extension builder
|
||||
* You may modify the constructor of this class instead
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function initStorageObjects()
|
||||
{
|
||||
$this->activities = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $type
|
||||
*/
|
||||
public function setType($type)
|
||||
{
|
||||
$this->type = $type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the name
|
||||
*
|
||||
* @return string $name
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the name
|
||||
*
|
||||
* @param string $name
|
||||
* @return void
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
$this->name = $name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getNameInternal()
|
||||
{
|
||||
return $this->nameInternal;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $nameInternal
|
||||
*/
|
||||
public function setNameInternal($nameInternal)
|
||||
{
|
||||
$this->nameInternal = $nameInternal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the groupname
|
||||
*
|
||||
* @return string $groupname
|
||||
*/
|
||||
public function getGroupname()
|
||||
{
|
||||
return $this->groupname;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the groupname
|
||||
*
|
||||
* @param string $groupname
|
||||
* @return void
|
||||
*/
|
||||
public function setGroupname($groupname)
|
||||
{
|
||||
$this->groupname = $groupname;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getPrice()
|
||||
{
|
||||
return $this->price;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $price
|
||||
*/
|
||||
public function setPrice($price)
|
||||
{
|
||||
$this->price = $price;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getHeadline()
|
||||
{
|
||||
return $this->headline;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $headline
|
||||
*/
|
||||
public function setHeadline($headline)
|
||||
{
|
||||
$this->headline = $headline;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the header
|
||||
*
|
||||
* @return string $header
|
||||
*/
|
||||
public function getHeader()
|
||||
{
|
||||
return $this->header;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the header
|
||||
*
|
||||
* @param string $header
|
||||
* @return void
|
||||
*/
|
||||
public function setHeader($header)
|
||||
{
|
||||
$this->header = $header;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the arrival
|
||||
*
|
||||
* @return string $arrival
|
||||
*/
|
||||
public function getArrival()
|
||||
{
|
||||
return $this->arrival;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the arrival
|
||||
*
|
||||
* @param string $arrival
|
||||
* @return void
|
||||
*/
|
||||
public function setArrival($arrival)
|
||||
{
|
||||
$this->arrival = $arrival;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the schedule
|
||||
*
|
||||
* @return string $schedule
|
||||
*/
|
||||
public function getSchedule()
|
||||
{
|
||||
return $this->schedule;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the schedule
|
||||
*
|
||||
* @param string $schedule
|
||||
* @return void
|
||||
*/
|
||||
public function setSchedule($schedule)
|
||||
{
|
||||
$this->schedule = $schedule;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the services
|
||||
*
|
||||
* @return string $services
|
||||
*/
|
||||
public function getServices()
|
||||
{
|
||||
return $this->services;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the services
|
||||
*
|
||||
* @param string $services
|
||||
* @return void
|
||||
*/
|
||||
public function setServices($services)
|
||||
{
|
||||
$this->services = $services;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the guidelines
|
||||
*
|
||||
* @return string $guidelines
|
||||
*/
|
||||
public function getGuidelines()
|
||||
{
|
||||
return $this->guidelines;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the guidelines
|
||||
*
|
||||
* @param string $guidelines
|
||||
* @return void
|
||||
*/
|
||||
public function setGuidelines($guidelines)
|
||||
{
|
||||
$this->guidelines = $guidelines;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the imageHeader
|
||||
*
|
||||
* @return \TYPO3\CMS\Extbase\Domain\Model\FileReference $imageHeader
|
||||
*/
|
||||
public function getImageHeader()
|
||||
{
|
||||
return $this->imageHeader;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the imageHeader
|
||||
*
|
||||
* @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $imageHeader
|
||||
* @return void
|
||||
*/
|
||||
public function setImageHeader(\TYPO3\CMS\Extbase\Domain\Model\FileReference $imageHeader)
|
||||
{
|
||||
$this->imageHeader = $imageHeader;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \TYPO3\CMS\Extbase\Domain\Model\FileReference
|
||||
*/
|
||||
public function getImageTeaser()
|
||||
{
|
||||
return $this->imageTeaser;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $imageTeaser
|
||||
*/
|
||||
public function setImageTeaser(\TYPO3\CMS\Extbase\Domain\Model\FileReference $imageTeaser)
|
||||
{
|
||||
$this->imageTeaser = $imageTeaser;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \TYPO3\CMS\Extbase\Domain\Model\FileReference
|
||||
*/
|
||||
public function getImageTeaserMobile()
|
||||
{
|
||||
return $this->imageTeaserMobile;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $imageTeaserMobile
|
||||
*/
|
||||
public function setImageTeaserMobile(\TYPO3\CMS\Extbase\Domain\Model\FileReference $imageTeaserMobile)
|
||||
{
|
||||
$this->imageTeaserMobile = $imageTeaserMobile;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the bookingForm
|
||||
*
|
||||
* @return \TYPO3\CMS\Extbase\Domain\Model\FileReference $bookingForm
|
||||
*/
|
||||
public function getBookingForm()
|
||||
{
|
||||
return $this->bookingForm;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the bookingForm
|
||||
*
|
||||
* @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $bookingForm
|
||||
* @return void
|
||||
*/
|
||||
public function setBookingForm(\TYPO3\CMS\Extbase\Domain\Model\FileReference $bookingForm)
|
||||
{
|
||||
$this->bookingForm = $bookingForm;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the contact
|
||||
*
|
||||
* @return \EP\EpEvents\Domain\Model\Contact $contact
|
||||
*/
|
||||
public function getContact()
|
||||
{
|
||||
return $this->contact;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the contact
|
||||
*
|
||||
* @param \EP\EpEvents\Domain\Model\Contact $contact
|
||||
* @return void
|
||||
*/
|
||||
public function setContact(\EP\EpEvents\Domain\Model\Contact $contact)
|
||||
{
|
||||
$this->contact = $contact;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the hotel
|
||||
*
|
||||
* @return \EP\EpEvents\Domain\Model\Hotel $hotel
|
||||
*/
|
||||
public function getHotel()
|
||||
{
|
||||
return $this->hotel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the hotel
|
||||
*
|
||||
* @param \EP\EpEvents\Domain\Model\Hotel $hotel
|
||||
* @return void
|
||||
*/
|
||||
public function setHotel(\EP\EpEvents\Domain\Model\Hotel $hotel)
|
||||
{
|
||||
$this->hotel = $hotel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the location
|
||||
*
|
||||
* @return \EP\EpEvents\Domain\Model\Location $location
|
||||
*/
|
||||
public function getLocation()
|
||||
{
|
||||
return $this->location;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the location
|
||||
*
|
||||
* @param \EP\EpEvents\Domain\Model\Location $location
|
||||
* @return void
|
||||
*/
|
||||
public function setLocation(\EP\EpEvents\Domain\Model\Location $location)
|
||||
{
|
||||
$this->location = $location;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a Activity
|
||||
*
|
||||
* @param \EP\EpEvents\Domain\Model\Activity $activity
|
||||
* @return void
|
||||
*/
|
||||
public function addActivity(\EP\EpEvents\Domain\Model\Activity $activity)
|
||||
{
|
||||
$this->activities->attach($activity);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a Activity
|
||||
*
|
||||
* @param \EP\EpEvents\Domain\Model\Activity $activityToRemove The Activity to be removed
|
||||
* @return void
|
||||
*/
|
||||
public function removeActivity(\EP\EpEvents\Domain\Model\Activity $activityToRemove)
|
||||
{
|
||||
$this->activities->detach($activityToRemove);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the activities
|
||||
*
|
||||
* @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\EP\EpEvents\Domain\Model\Activity> $activities
|
||||
*/
|
||||
public function getActivities()
|
||||
{
|
||||
return $this->activities;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the activities
|
||||
*
|
||||
* @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\EP\EpEvents\Domain\Model\Activity> $activities
|
||||
* @return void
|
||||
*/
|
||||
public function setActivities(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $activities)
|
||||
{
|
||||
$this->activities = $activities;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the configuratorType
|
||||
*
|
||||
* @return int $configuratorType
|
||||
*/
|
||||
public function getConfiguratorType()
|
||||
{
|
||||
return $this->configuratorType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the configuratorType
|
||||
*
|
||||
* @param int $configuratorType
|
||||
* @return void
|
||||
*/
|
||||
public function setConfiguratorType($configuratorType)
|
||||
{
|
||||
$this->configuratorType = $configuratorType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getConfiguratorBudget()
|
||||
{
|
||||
return $this->configuratorBudget;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $configuratorBudget
|
||||
*/
|
||||
public function setConfiguratorBudget($configuratorBudget)
|
||||
{
|
||||
$this->configuratorBudget = $configuratorBudget;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getConfiguratorPax()
|
||||
{
|
||||
return $this->configuratorPax;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $configuratorPax
|
||||
*/
|
||||
public function setConfiguratorPax($configuratorPax)
|
||||
{
|
||||
$this->configuratorPax = $configuratorPax;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getConfiguratorPeriod()
|
||||
{
|
||||
return $this->configuratorPeriod;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $configuratorPeriod
|
||||
*/
|
||||
public function setConfiguratorPeriod($configuratorPeriod)
|
||||
{
|
||||
$this->configuratorPeriod = $configuratorPeriod;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getDetailPage()
|
||||
{
|
||||
return $this->detailPage;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $detailPage
|
||||
*/
|
||||
public function setDetailPage($detailPage)
|
||||
{
|
||||
$this->detailPage = $detailPage;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getConfiguratorTypeLabel()
|
||||
{
|
||||
return $this->configuratorTypeLabels[$this->configuratorType];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
namespace EP\EpEvents\Domain\Model;
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2018 Björn Fromme <[email protected]>, dreipunktnull
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
class Search
|
||||
{
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $query;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $pageUid;
|
||||
|
||||
/**
|
||||
* @param string $query
|
||||
* @param null $pageUid
|
||||
*/
|
||||
public function __construct($query = null, $pageUid = null)
|
||||
{
|
||||
$this->setQuery($query);
|
||||
$this->setPageUid($pageUid);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getQuery()
|
||||
{
|
||||
return $this->query;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $query
|
||||
*/
|
||||
public function setQuery($query)
|
||||
{
|
||||
$this->query = $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getPageUid()
|
||||
{
|
||||
return $this->pageUid;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $pageUid
|
||||
*/
|
||||
public function setPageUid($pageUid)
|
||||
{
|
||||
$this->pageUid = $pageUid;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
<?php
|
||||
namespace EP\EpEvents\Domain\Model;
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 Björn Fromme <[email protected]>, dreipunktnull
|
||||
* Cedric Ziel <[email protected]>, dreipunktnull
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
/**
|
||||
* Testimonial
|
||||
*/
|
||||
class Testimonial extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
|
||||
{
|
||||
|
||||
/**
|
||||
* clientName
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $clientName = '';
|
||||
|
||||
/**
|
||||
* clientImage
|
||||
*
|
||||
* @var \TYPO3\CMS\Extbase\Domain\Model\FileReference
|
||||
*/
|
||||
protected $clientImage = null;
|
||||
|
||||
/**
|
||||
* quote
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $quote = '';
|
||||
|
||||
/**
|
||||
* Returns the clientName
|
||||
*
|
||||
* @return string $clientName
|
||||
*/
|
||||
public function getClientName()
|
||||
{
|
||||
return $this->clientName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the clientName
|
||||
*
|
||||
* @param string $clientName
|
||||
* @return void
|
||||
*/
|
||||
public function setClientName($clientName)
|
||||
{
|
||||
$this->clientName = $clientName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the clientImage
|
||||
*
|
||||
* @return \TYPO3\CMS\Extbase\Domain\Model\FileReference $clientImage
|
||||
*/
|
||||
public function getClientImage()
|
||||
{
|
||||
return $this->clientImage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the clientImage
|
||||
*
|
||||
* @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $clientImage
|
||||
* @return void
|
||||
*/
|
||||
public function setClientImage(\TYPO3\CMS\Extbase\Domain\Model\FileReference $clientImage)
|
||||
{
|
||||
$this->clientImage = $clientImage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the quote
|
||||
*
|
||||
* @return string $quote
|
||||
*/
|
||||
public function getQuote()
|
||||
{
|
||||
return $this->quote;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the quote
|
||||
*
|
||||
* @param string $quote
|
||||
* @return void
|
||||
*/
|
||||
public function setQuote($quote)
|
||||
{
|
||||
$this->quote = $quote;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,252 @@
|
||||
<?php
|
||||
namespace EP\EpEvents\Domain\Model;
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 Björn Fromme <[email protected]>, dreipunktnull
|
||||
* Cedric Ziel <[email protected]>, dreipunktnull
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
/**
|
||||
* Traveltype
|
||||
*/
|
||||
class Traveltype extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $title = '';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $subtitle = '';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $headertext = '';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $subheadline = '';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $description = '';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $bannertext = '';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $buttonlabel = '';
|
||||
|
||||
/**
|
||||
* @var \TYPO3\CMS\Extbase\Domain\Model\FileReference
|
||||
*/
|
||||
protected $imageHeader;
|
||||
|
||||
/**
|
||||
* @var \TYPO3\CMS\Extbase\Domain\Model\FileReference
|
||||
*/
|
||||
protected $imageBanner;
|
||||
|
||||
/**
|
||||
* configuratorType
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $configuratorType = 0;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getTitle()
|
||||
{
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $title
|
||||
*/
|
||||
public function setTitle($title)
|
||||
{
|
||||
$this->title = $title;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getSubtitle()
|
||||
{
|
||||
return $this->subtitle;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $subtitle
|
||||
*/
|
||||
public function setSubtitle($subtitle)
|
||||
{
|
||||
$this->subtitle = $subtitle;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getHeadertext()
|
||||
{
|
||||
return $this->headertext;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $headertext
|
||||
*/
|
||||
public function setHeadertext($headertext)
|
||||
{
|
||||
$this->headertext = $headertext;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getSubheadline()
|
||||
{
|
||||
return $this->subheadline;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $subheadline
|
||||
*/
|
||||
public function setSubheadline($subheadline)
|
||||
{
|
||||
$this->subheadline = $subheadline;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getDescription()
|
||||
{
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $description
|
||||
*/
|
||||
public function setDescription($description)
|
||||
{
|
||||
$this->description = $description;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getBannertext()
|
||||
{
|
||||
return $this->bannertext;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $bannertext
|
||||
*/
|
||||
public function setBannertext($bannertext)
|
||||
{
|
||||
$this->bannertext = $bannertext;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getButtonlabel()
|
||||
{
|
||||
return $this->buttonlabel;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $buttonlabel
|
||||
*/
|
||||
public function setButtonlabel($buttonlabel)
|
||||
{
|
||||
$this->buttonlabel = $buttonlabel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the imageHeader
|
||||
*
|
||||
* @return \TYPO3\CMS\Extbase\Domain\Model\FileReference $imageHeader
|
||||
*/
|
||||
public function getImageHeader()
|
||||
{
|
||||
return $this->imageHeader;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the imageHeader
|
||||
*
|
||||
* @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $imageHeader
|
||||
* @return void
|
||||
*/
|
||||
public function setImageHeader(\TYPO3\CMS\Extbase\Domain\Model\FileReference $imageHeader)
|
||||
{
|
||||
$this->imageHeader = $imageHeader;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \TYPO3\CMS\Extbase\Domain\Model\FileReference
|
||||
*/
|
||||
public function getImageBanner()
|
||||
{
|
||||
return $this->imageBanner;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $imageBanner
|
||||
*/
|
||||
public function setImageBanner(\TYPO3\CMS\Extbase\Domain\Model\FileReference $imageBanner)
|
||||
{
|
||||
$this->imageBanner = $imageBanner;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int $configuratorType
|
||||
*/
|
||||
public function getConfiguratorType()
|
||||
{
|
||||
return $this->configuratorType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $configuratorType
|
||||
* @return void
|
||||
*/
|
||||
public function setConfiguratorType($configuratorType)
|
||||
{
|
||||
$this->configuratorType = $configuratorType;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
namespace EP\EpEvents\Domain\Repository;
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 Björn Fromme <[email protected]>, dreipunktnull
|
||||
* Cedric Ziel <[email protected]>, dreipunktnull
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
use TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings;
|
||||
|
||||
class AbstractRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
|
||||
{
|
||||
public function initializeObject()
|
||||
{
|
||||
/** @var $querySettings \TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings */
|
||||
$querySettings = $this->objectManager->get(Typo3QuerySettings::class);
|
||||
$querySettings->setRespectStoragePage(FALSE);
|
||||
$this->setDefaultQuerySettings($querySettings);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
namespace EP\EpEvents\Domain\Repository;
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 Björn Fromme <[email protected]>, dreipunktnull
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
class ActivityRepository extends AbstractRepository
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
namespace EP\EpEvents\Domain\Repository;
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 Björn Fromme <[email protected]>, dreipunktnull
|
||||
* Cedric Ziel <[email protected]>, dreipunktnull
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
use TYPO3\CMS\Extbase\Persistence\QueryInterface;
|
||||
|
||||
class ContactRepository extends AbstractRepository
|
||||
{
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $defaultOrderings = [
|
||||
'sorting' => QueryInterface::ORDER_ASCENDING,
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
<?php
|
||||
namespace EP\EpEvents\Domain\Repository;
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 Björn Fromme <[email protected]>, dreipunktnull
|
||||
* Cedric Ziel <[email protected]>, dreipunktnull
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
use EP\EpEvents\Domain\Model\Activity;
|
||||
use EP\EpEvents\Domain\Model\Offer;
|
||||
use TYPO3\CMS\Extbase\Persistence\QueryInterface;
|
||||
|
||||
class OfferRepository extends AbstractRepository
|
||||
{
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $defaultOrderings = [
|
||||
'nameInternal' => QueryInterface::ORDER_ASCENDING,
|
||||
];
|
||||
|
||||
/**
|
||||
* @param array $configuration
|
||||
* @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface
|
||||
*/
|
||||
public function findByConfiguration(array $configuration)
|
||||
{
|
||||
if (array_sum($configuration) === 0) {
|
||||
return [];
|
||||
}
|
||||
$query = $this->createQuery();
|
||||
$constraints = [
|
||||
$query->logicalNot($query->equals('type', Offer::TYPE_CLIENT))
|
||||
];
|
||||
if ($configuration['offerUid']) {
|
||||
$constraints[] = $query->logicalNot($query->equals('uid', $configuration['offerUid']));
|
||||
}
|
||||
if ($configuration['travelType'] > 0) {
|
||||
$constraints[] = $query->equals('configuratorType', $configuration['travelType']);
|
||||
}
|
||||
if ($configuration['locationDistance'] > 0) {
|
||||
$constraints[] = $query->equals('location.configuratorDistance', $configuration['locationDistance']);
|
||||
}
|
||||
if ($configuration['locationType'] > 0) {
|
||||
$constraints[] = $query->equals('location.configuratorType', $configuration['locationType']);
|
||||
}
|
||||
if ($configuration['hotelType'] > 0) {
|
||||
$constraints[] = $query->equals('hotel.configuratorType', $configuration['hotelType']);
|
||||
}
|
||||
if ($configuration['activityType'] > 0) {
|
||||
$constraints[] = $query->equals('activities.configuratorType', $configuration['activityType']);
|
||||
}
|
||||
return $query->matching($query->logicalAnd($constraints))->execute();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Activity $activity
|
||||
* @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface
|
||||
*/
|
||||
public function findByActivity(Activity $activity)
|
||||
{
|
||||
$query = $this->createQuery();
|
||||
$query->matching(
|
||||
$query->logicalAnd(
|
||||
$query->contains('activities', $activity),
|
||||
$query->equals('type', Offer::TYPE_EXAMPLE)
|
||||
)
|
||||
);
|
||||
return $query->execute();
|
||||
}
|
||||
|
||||
/**
|
||||
* Ignores enable fields to avoid issues with deactivated offed entities
|
||||
*
|
||||
* @param int $uid
|
||||
* @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface
|
||||
*/
|
||||
public function forceFindByUid($uid)
|
||||
{
|
||||
$query = $this->createQuery();
|
||||
$query->getQuerySettings()->setIgnoreEnableFields(true);
|
||||
$query->matching($query->equals('uid', $uid));
|
||||
return $query->execute();
|
||||
}
|
||||
|
||||
/**
|
||||
* Ignores enable fields to avoid issues with deactivated offed entities
|
||||
*
|
||||
* @param int $pageUid
|
||||
* @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface
|
||||
*/
|
||||
public function forceFindByDetailPage($pageUid)
|
||||
{
|
||||
$query = $this->createQuery();
|
||||
$query->getQuerySettings()->setIgnoreEnableFields(true);
|
||||
$query->matching($query->equals('detail_page', $pageUid));
|
||||
return $query->execute();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $queryString
|
||||
* @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface
|
||||
*/
|
||||
public function search($queryString)
|
||||
{
|
||||
$query = $this->createQuery();
|
||||
$constraints = [
|
||||
$query->like('nameInternal', '%' . $queryString . '%'),
|
||||
$query->like('header', '%' . $queryString . '%'),
|
||||
$query->like('schedule', '%' . $queryString . '%'),
|
||||
$query->like('services', '%' . $queryString . '%'),
|
||||
$query->like('location.name', '%' . $queryString . '%'),
|
||||
$query->like('location.description_short', '%' . $queryString . '%'),
|
||||
$query->like('location.description_long', '%' . $queryString . '%'),
|
||||
];
|
||||
return $query->matching(
|
||||
$query->logicalAnd(
|
||||
$query->greaterThan('detailPage', 0),
|
||||
$query->logicalOr($constraints)
|
||||
)
|
||||
)->execute();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
namespace EP\EpEvents\Domain\Repository;
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 Björn Fromme <[email protected]>, dreipunktnull
|
||||
* Cedric Ziel <[email protected]>, dreipunktnull
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
class TestimonialRepository extends AbstractRepository
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
namespace EP\EpEvents\Domain\Repository;
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 Björn Fromme <[email protected]>, dreipunktnull
|
||||
* Cedric Ziel <[email protected]>, dreipunktnull
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
class TraveltypeRepository extends AbstractRepository
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
namespace EP\EpEvents\Form;
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 Björn Fromme <[email protected]>, dreipunktnull
|
||||
* Cedric Ziel <[email protected]>, dreipunktnull
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
class UrlField
|
||||
{
|
||||
|
||||
public function render($parameters, $fObj)
|
||||
{
|
||||
$uid = $parameters['row']['uid'];
|
||||
$urlSegment = $parameters['row']['url'];
|
||||
if ($uid && $urlSegment) {
|
||||
$url = \tx_pagepath_api::getPagePath(889, [
|
||||
'tx_epevents_offer' => [
|
||||
'controller' => 'offer',
|
||||
'action' => 'show',
|
||||
'offer' => $uid,
|
||||
]
|
||||
]);
|
||||
return urldecode($url);
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
namespace EP\EpEvents\Hooks;
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 Björn Fromme <[email protected]>, dreipunktnull
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
use EP\EpProducts\Traits\DbConnectionTrait;
|
||||
use TYPO3\CMS\Core\DataHandling\DataHandler;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
|
||||
use TYPO3\CMS\Extbase\Object\ObjectManager;
|
||||
|
||||
class Tcemain
|
||||
{
|
||||
use DbConnectionTrait;
|
||||
|
||||
/**
|
||||
* @param array $fields
|
||||
* @param string $table
|
||||
* @param int $id
|
||||
* @param DataHandler $obj
|
||||
* @throws \Doctrine\DBAL\DBALException
|
||||
*/
|
||||
public function processDatamap_preProcessFieldArray(array &$fields, $table, $id, DataHandler $obj)
|
||||
{
|
||||
if ($table === 'tx_epevents_domain_model_offer') {
|
||||
// Set default value for url segment
|
||||
if (empty($fields['url'])) {
|
||||
$fields['url'] = $fields['name'] . date('dmy');
|
||||
}
|
||||
// Clear realurl cache for detail page
|
||||
$settings = $this->getSettings();
|
||||
$detailPageUid = $settings['plugin']['tx_epevents']['settings']['offerDetailPageUid'];
|
||||
if ((int) $detailPageUid > 0) {
|
||||
$qb = $this->getDbConnection()->createQueryBuilder();
|
||||
$qb
|
||||
->delete('tx_realurl_urldata')
|
||||
->where('page_id = :pageUid')
|
||||
->setParameter('pageUid', $detailPageUid)
|
||||
->execute()
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function getSettings()
|
||||
{
|
||||
$objectManager = GeneralUtility::makeInstance(ObjectManager::class);
|
||||
$configurationManager = $objectManager->get(ConfigurationManagerInterface::class);
|
||||
return GeneralUtility::removeDotsFromTS(
|
||||
$configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
namespace EP\EpEvents\Service;
|
||||
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
|
||||
use TYPO3\CMS\Extensionmanager\Utility\ConfigurationUtility;
|
||||
|
||||
class ConfigurationService
|
||||
{
|
||||
|
||||
/**
|
||||
* @var ConfigurationManagerInterface
|
||||
*/
|
||||
protected $configurationManager;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $settings;
|
||||
|
||||
/**
|
||||
* @param ConfigurationManagerInterface $configurationManager
|
||||
*/
|
||||
public function __construct(ConfigurationManagerInterface $configurationManager)
|
||||
{
|
||||
$this->configurationManager = $configurationManager;
|
||||
$settings = GeneralUtility::removeDotsFromTS(
|
||||
$this->configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT)
|
||||
);
|
||||
$this->settings = $settings['plugin']['tx_epevents'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getConfiguratorConfig()
|
||||
{
|
||||
$extensionConfig = $this->settings['settings']['configurator']['options'];
|
||||
|
||||
return [
|
||||
'budgetOptions' => $this->parseConfigItem($extensionConfig, 'budget'),
|
||||
'paxOptions' => $this->parseConfigItem($extensionConfig, 'pax'),
|
||||
'periodOptions' => $this->parseConfigItem($extensionConfig, 'period'),
|
||||
'travelTypeOptions' => $this->parseConfigItem($extensionConfig, 'travelType'),
|
||||
'locationTypeOptions' => $this->parseConfigItem($extensionConfig, 'locationType'),
|
||||
'accommodationTypeOptions' => $this->parseConfigItem($extensionConfig, 'accommodationType'),
|
||||
'programmeTypeOptions' => $this->parseConfigItem($extensionConfig, 'programmeType'),
|
||||
'distanceOptions' => $this->parseConfigItem($extensionConfig, 'distance'),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $configArray
|
||||
* @param string $itemName
|
||||
* @return array
|
||||
*/
|
||||
protected function parseConfigItem($configArray, $itemName)
|
||||
{
|
||||
$config = [];
|
||||
foreach (explode(';', $configArray[$itemName]) as $item)
|
||||
{
|
||||
[ $value, $label ] = explode(':', $item);
|
||||
$config[$value] = $label;
|
||||
}
|
||||
|
||||
return $config;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
<?php
|
||||
namespace EP\EpEvents\Service;
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 Björn Fromme <[email protected]>, dreipunktnull
|
||||
* Cedric Ziel <[email protected]>, dreipunktnull
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
use EP\EpEvents\Domain\Model\Inquiry;
|
||||
use TYPO3\CMS\Core\Mail\MailMessage;
|
||||
use TYPO3\CMS\Core\SingletonInterface;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
|
||||
use TYPO3\CMS\Fluid\View\StandaloneView;
|
||||
|
||||
class EmailService implements SingletonInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* @var ConfigurationManagerInterface
|
||||
*/
|
||||
protected $configurationManager;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $settings;
|
||||
|
||||
/**
|
||||
* @param ConfigurationManagerInterface $configurationManager
|
||||
*/
|
||||
public function __construct(ConfigurationManagerInterface $configurationManager)
|
||||
{
|
||||
$this->configurationManager = $configurationManager;
|
||||
$settings = GeneralUtility::removeDotsFromTS(
|
||||
$this->configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT)
|
||||
);
|
||||
$this->settings = $settings['plugin']['tx_epevents'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $options
|
||||
* @param array $variables
|
||||
* @return bool
|
||||
*/
|
||||
public function send(array $options)
|
||||
{
|
||||
$fromEmail = $this->settings['settings']['inquiryToEmail'];
|
||||
$fromName = $this->settings['settings']['inquiryToName'];
|
||||
$enableAutoreply = $this->settings['settings']['enableContactFormAutoreply'];
|
||||
$autoreplySubject = $this->settings['settings']['contactFormAutoreplySubject'];
|
||||
|
||||
$toEmail = $options['toEmail'];
|
||||
$toName = $options['toName'];
|
||||
$subject = $options['subject'];
|
||||
$templateName = $options['templateName'];
|
||||
$variables = $options['variables'];
|
||||
|
||||
/** @var MailMessage $message */
|
||||
$message = GeneralUtility::makeInstance(MailMessage::class);
|
||||
$message
|
||||
->setTo([$toEmail => $toName])
|
||||
->setFrom([$fromEmail => $fromName])
|
||||
->setSubject($subject)
|
||||
;
|
||||
|
||||
$view = $this->getView($templateName);
|
||||
$view->assignMultiple($variables);
|
||||
$message->setBody($view->render(), 'text/html');
|
||||
|
||||
$messageSent = $message->send();
|
||||
$autoreplySent = false;
|
||||
|
||||
if ($enableAutoreply) {
|
||||
/** @var Inquiry $inquiry */
|
||||
$inquiry = $variables['inquiry'];
|
||||
$toEmail = $inquiry->getEmail();
|
||||
$toName = $inquiry->getName();
|
||||
$templateName = 'Email/Autoreply';
|
||||
|
||||
/** @var MailMessage $message */
|
||||
$message = GeneralUtility::makeInstance(MailMessage::class);
|
||||
$message
|
||||
->setTo([$toEmail => $toName])
|
||||
->setFrom([$fromEmail => $fromName])
|
||||
->setSubject($autoreplySubject)
|
||||
;
|
||||
|
||||
$view = $this->getView($templateName);
|
||||
$view->assignMultiple($variables);
|
||||
$message->setBody($view->render(), 'text/html');
|
||||
|
||||
$autoreplySent = $message->send();
|
||||
}
|
||||
|
||||
return $messageSent && $autoreplySent;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $templateName
|
||||
* @param string $format
|
||||
* @return StandaloneView
|
||||
*/
|
||||
protected function getView($templateName, $format = 'html')
|
||||
{
|
||||
/** @var StandaloneView $view */
|
||||
$view = GeneralUtility::makeInstance(StandaloneView::class);
|
||||
$view->setFormat($format);
|
||||
$view->getRequest()->setControllerExtensionName('ep_events');
|
||||
|
||||
$view->setTemplateRootPaths($this->settings['view']['templateRootPaths']);
|
||||
$view->setLayoutRootPaths($this->settings['view']['layoutRootPaths']);
|
||||
$view->setPartialRootPaths($this->settings['view']['partialRootPaths']);
|
||||
$view->setTemplate($templateName);
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
<?php
|
||||
|
||||
namespace EP\EpEvents\Updates;
|
||||
|
||||
use GeorgRinger\News\Service\Transliterator\Transliterator;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\Database\Query\QueryBuilder;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Install\Updates\DatabaseUpdatedPrerequisite;
|
||||
use TYPO3\CMS\Install\Updates\UpgradeWizardInterface;
|
||||
|
||||
class ActivitySlugUpdater implements UpgradeWizardInterface
|
||||
{
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getTitle(): string
|
||||
{
|
||||
return 'Updates slug field "path_segment" of EXT:ep_events activity records';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Fills empty slug field "path_segment" of EXT:ep_events records with urlized name.';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getIdentifier(): string
|
||||
{
|
||||
return 'activitySlug';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function updateNecessary(): bool
|
||||
{
|
||||
$elementCount = $this->countRequiredUpdates();
|
||||
|
||||
return (bool)$elementCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function executeUpdate(): bool
|
||||
{
|
||||
$queryBuilder = $this->getQueryBuilder();
|
||||
|
||||
$statement = $queryBuilder->select('uid', 'name')
|
||||
->from('tx_epevents_domain_model_activity')
|
||||
->where(
|
||||
$queryBuilder->expr()->orX(
|
||||
$queryBuilder->expr()->eq(
|
||||
'path_segment',
|
||||
$queryBuilder->createNamedParameter('')
|
||||
),
|
||||
$queryBuilder->expr()->isNull('path_segment')
|
||||
)
|
||||
)
|
||||
->execute();
|
||||
while ($record = $statement->fetch()) {
|
||||
$slug = Transliterator::urlize($record['name']);
|
||||
$queryBuilder = $this->getQueryBuilder();
|
||||
$queryBuilder->update('tx_epevents_domain_model_activity')
|
||||
->where(
|
||||
$queryBuilder->expr()->eq(
|
||||
'uid',
|
||||
$queryBuilder->createNamedParameter($record['uid'], \PDO::PARAM_INT)
|
||||
)
|
||||
)
|
||||
->set('path_segment', $slug);
|
||||
$queryBuilder->execute();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function countRequiredUpdates(): int
|
||||
{
|
||||
$queryBuilder = $this->getQueryBuilder();
|
||||
|
||||
return $queryBuilder->count('uid')
|
||||
->from('tx_epevents_domain_model_activity')
|
||||
->where(
|
||||
$queryBuilder->expr()->orX(
|
||||
$queryBuilder->expr()->eq(
|
||||
'path_segment',
|
||||
$queryBuilder->createNamedParameter('')
|
||||
),
|
||||
$queryBuilder->expr()->isNull('path_segment')
|
||||
)
|
||||
)
|
||||
->execute()->fetchColumn();
|
||||
}
|
||||
|
||||
protected function getQueryBuilder(): QueryBuilder
|
||||
{
|
||||
/** @var QueryBuilder $queryBuilder */
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
|
||||
->getQueryBuilderForTable('tx_epevents_domain_model_activity');
|
||||
$queryBuilder->getRestrictions()->removeAll();
|
||||
|
||||
return $queryBuilder;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
public function getPrerequisites(): array
|
||||
{
|
||||
return [
|
||||
DatabaseUpdatedPrerequisite::class,
|
||||
];
|
||||
}
|
||||
}
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
namespace EP\EpEvents\ViewHelpers;
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 Björn Fromme <[email protected]>, dreipunktnull
|
||||
* Cedric Ziel <[email protected]>, dreipunktnull
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
|
||||
|
||||
class ConfiguratorTypeLabelsViewHelper extends AbstractViewHelper
|
||||
{
|
||||
use CompileWithRenderStatic;
|
||||
|
||||
public function initializeArguments()
|
||||
{
|
||||
parent::initializeArguments();
|
||||
|
||||
$this->registerArgument('type', 'string', 'The type', true);
|
||||
$this->registerArgument('config', 'array', 'The config', true);
|
||||
$this->registerArgument('values', 'string', 'The labels', true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $arguments
|
||||
* @param \Closure $renderChildrenClosure
|
||||
* @param RenderingContextInterface $renderingContext
|
||||
* @return mixed
|
||||
*/
|
||||
public static function renderStatic(
|
||||
array $arguments,
|
||||
\Closure $renderChildrenClosure,
|
||||
RenderingContextInterface $renderingContext
|
||||
)
|
||||
{
|
||||
if (empty($arguments['values'])) {
|
||||
return 'Keine Angabe';
|
||||
}
|
||||
$types = [];
|
||||
$indexes = GeneralUtility::trimExplode(',', $arguments['values']);
|
||||
$type = $arguments['type'];
|
||||
$config = $arguments['config'];
|
||||
foreach ($indexes as $index)
|
||||
{
|
||||
$types[] = $config[$type][$index];
|
||||
}
|
||||
|
||||
return implode(', ', $types);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
namespace EP\EpEvents\ViewHelpers;
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2018 Björn Fromme <[email protected]>, dreipunktnull
|
||||
* Cedric Ziel <[email protected]>, dreipunktnull
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
|
||||
|
||||
class SectionCssClassViewHelper extends AbstractViewHelper
|
||||
{
|
||||
use CompileWithRenderStatic;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected static $cssClasses = [
|
||||
1 => 'incentives',
|
||||
2 => 'teambuilding',
|
||||
3 => 'meetings',
|
||||
4 => 'events',
|
||||
];
|
||||
|
||||
public function initializeArguments()
|
||||
{
|
||||
parent::initializeArguments();
|
||||
|
||||
$this->registerArgument('sectionValue', 'string', 'The section value');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $arguments
|
||||
* @param \Closure $renderChildrenClosure
|
||||
* @param RenderingContextInterface $renderingContext
|
||||
* @return mixed
|
||||
*/
|
||||
public static function renderStatic(
|
||||
array $arguments,
|
||||
\Closure $renderChildrenClosure,
|
||||
RenderingContextInterface $renderingContext
|
||||
)
|
||||
{
|
||||
$sectionValue = $renderChildrenClosure();
|
||||
if ($sectionValue === null) {
|
||||
$sectionValue = $arguments['sectionValue'];
|
||||
}
|
||||
if (array_key_exists($sectionValue, static::$cssClasses)) {
|
||||
return 'section-' . static::$cssClasses[$sectionValue];
|
||||
}
|
||||
|
||||
return 'section-default';
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
namespace EP\EpEvents\ViewHelpers;
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2018 Björn Fromme <[email protected]>, dreipunktnull
|
||||
* Cedric Ziel <[email protected]>, dreipunktnull
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
|
||||
|
||||
class SectionIconViewHelper extends AbstractViewHelper
|
||||
{
|
||||
use CompileWithRenderStatic;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected static $icons = [
|
||||
1 => 'icon_incentives',
|
||||
2 => 'icon_teambuilding',
|
||||
3 => 'icon_meetings',
|
||||
4 => 'icon_events',
|
||||
];
|
||||
|
||||
public function initializeArguments()
|
||||
{
|
||||
parent::initializeArguments();
|
||||
|
||||
$this->registerArgument('sectionValue', 'string', 'The section value');
|
||||
$this->registerArgument('opaque', 'bool', 'Whether to use opaque icon', false, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $arguments
|
||||
* @param \Closure $renderChildrenClosure
|
||||
* @param RenderingContextInterface $renderingContext
|
||||
* @return mixed
|
||||
*/
|
||||
public static function renderStatic(
|
||||
array $arguments,
|
||||
\Closure $renderChildrenClosure,
|
||||
RenderingContextInterface $renderingContext
|
||||
)
|
||||
{
|
||||
$sectionValue = $renderChildrenClosure();
|
||||
if ($sectionValue === null) {
|
||||
$sectionValue = $arguments['sectionValue'];
|
||||
}
|
||||
|
||||
$icon = '';
|
||||
if (array_key_exists($sectionValue, static::$icons)) {
|
||||
$icon = static::$icons[$sectionValue];
|
||||
if ($arguments['opaque']) {
|
||||
$icon .= '_opaque';
|
||||
}
|
||||
$icon .= '.svg';
|
||||
}
|
||||
|
||||
return $icon;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
namespace EP\EpEvents\ViewHelpers;
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2018 Björn Fromme <[email protected]>, dreipunktnull
|
||||
* Cedric Ziel <[email protected]>, dreipunktnull
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
|
||||
|
||||
class SoftHyphenViewHelper extends AbstractViewHelper
|
||||
{
|
||||
use CompileWithRenderStatic;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $escapeOutput = false;
|
||||
|
||||
public function initializeArguments()
|
||||
{
|
||||
parent::initializeArguments();
|
||||
|
||||
$this->registerArgument('string', 'string', 'The string to process');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $arguments
|
||||
* @param \Closure $renderChildrenClosure
|
||||
* @param RenderingContextInterface $renderingContext
|
||||
* @return mixed
|
||||
*/
|
||||
public static function renderStatic(
|
||||
array $arguments,
|
||||
\Closure $renderChildrenClosure,
|
||||
RenderingContextInterface $renderingContext
|
||||
)
|
||||
{
|
||||
$string = $renderChildrenClosure();
|
||||
if ($string === null) {
|
||||
$string = $arguments['string'];
|
||||
}
|
||||
|
||||
return str_replace('--', '­', $string);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user