mirror of
https://github.com/werkraum-media/events.git
synced 2024-11-10 03:56:09 +01:00
Implement date search
This commit is contained in:
parent
8821bb4639
commit
f1cbba74c1
14 changed files with 386 additions and 266 deletions
|
@ -1,21 +1,9 @@
|
|||
<?php
|
||||
namespace Wrm\Events\Controller;
|
||||
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "DD Events" Extension for TYPO3 CMS.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* (c) 2019 Dirk Koritnik <koritnik@werkraum-media.de>
|
||||
*
|
||||
***/
|
||||
|
||||
use Wrm\Events\Domain\Model\Dto\DateDemand;
|
||||
use Wrm\Events\Domain\Model\Date;
|
||||
use Wrm\Events\Domain\Repository\DateRepository;
|
||||
use Wrm\Events\Domain\Repository\RegionRepository;
|
||||
use TYPO3\CMS\Core\Database\QueryGenerator;
|
||||
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
|
||||
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
|
||||
|
@ -29,7 +17,12 @@ class DateController extends ActionController
|
|||
/**
|
||||
* @var dateRepository
|
||||
*/
|
||||
protected $dateRepository = null;
|
||||
protected $dateRepository;
|
||||
|
||||
/**
|
||||
* @var regionRepository
|
||||
*/
|
||||
protected $regionRepository;
|
||||
|
||||
/**
|
||||
* @var QueryGenerator
|
||||
|
@ -41,11 +34,15 @@ class DateController extends ActionController
|
|||
*/
|
||||
protected $pluginSettings;
|
||||
|
||||
/**
|
||||
/*
|
||||
* @param RegionRepository $regionRepository
|
||||
* @param DateRepository $dateRepository
|
||||
*/
|
||||
public function injectDateRepository(DateRepository $dateRepository)
|
||||
{
|
||||
public function __construct(
|
||||
RegionRepository $regionRepository,
|
||||
DateRepository $dateRepository
|
||||
) {
|
||||
$this->regionRepository = $regionRepository;
|
||||
$this->dateRepository = $dateRepository;
|
||||
}
|
||||
|
||||
|
@ -71,6 +68,49 @@ class DateController extends ActionController
|
|||
$this->view->assign('dates', $dates);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function searchAction()
|
||||
{
|
||||
|
||||
$searchword = null;
|
||||
$regions = null;
|
||||
$selRegion = null;
|
||||
$dates = null;
|
||||
$start = null;
|
||||
$end = null;
|
||||
|
||||
if ($this->request->hasArgument('searchword') && $this->request->getArgument('searchword') != '') {
|
||||
$searchword = $this->request->getArgument('searchword');
|
||||
}
|
||||
|
||||
if ($this->request->hasArgument('region') && $this->request->getArgument('region') != '') {
|
||||
$selRegion = $this->request->getArgument('region');
|
||||
}
|
||||
|
||||
if ($this->request->hasArgument('start') && $this->request->getArgument('start') != '') {
|
||||
$start = date( "Y-m-d", strtotime( $this->request->getArgument('start')));
|
||||
}
|
||||
|
||||
if ($this->request->hasArgument('end') && $this->request->getArgument('end') != '') {
|
||||
$end = date( "Y-m-d", strtotime( $this->request->getArgument('end')));
|
||||
}
|
||||
|
||||
$demand = $this->createDemandFromSearch();
|
||||
$dates = $this->dateRepository->findByDemand($demand);
|
||||
|
||||
$regions = $this->regionRepository->findAll();
|
||||
|
||||
$this->view->assign('searchword', $searchword);
|
||||
$this->view->assign('regions', $regions);
|
||||
$this->view->assign('selRegion', $selRegion);
|
||||
$this->view->assign('dates', $dates);
|
||||
$this->view->assign('start', $start);
|
||||
$this->view->assign('end', $end);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* action teaser
|
||||
*
|
||||
|
@ -96,25 +136,53 @@ class DateController extends ActionController
|
|||
/**
|
||||
* @return DateDemand
|
||||
*/
|
||||
|
||||
protected function createDemandFromSettings(): DateDemand
|
||||
{
|
||||
$demand = $this->objectManager->get(DateDemand::class);
|
||||
|
||||
$demand->setRegion((string)$this->settings['region']);
|
||||
|
||||
$demand->setCategories((string)$this->settings['categories']);
|
||||
$categoryCombination = (int)$this->settings['categoryCombination'] === 1 ? 'or' : 'and';
|
||||
|
||||
$demand->setCategoryCombination($categoryCombination);
|
||||
|
||||
$demand->setIncludeSubCategories((bool)$this->settings['includeSubcategories']);
|
||||
$demand->setSortBy((string)$this->settings['sortByDate']);
|
||||
$demand->setSortOrder((string)$this->settings['sortOrder']);
|
||||
$demand->setHighlight((int)$this->settings['highlight']);
|
||||
|
||||
if (!empty($this->settings['limit'])) {
|
||||
$demand->setLimit($this->settings['limit']);
|
||||
}
|
||||
|
||||
return $demand;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return DateDemand
|
||||
*/
|
||||
protected function createDemandFromSearch(): DateDemand
|
||||
{
|
||||
$demand = $this->objectManager->get(DateDemand::class);
|
||||
|
||||
if ($this->request->hasArgument('region') && $this->request->getArgument('region') != '')
|
||||
$demand->setRegion((string)$this->request->getArgument('region'));
|
||||
|
||||
if ($this->request->hasArgument('highlight') && $this->request->hasArgument('highlight') != '')
|
||||
$demand->setHighlight((int)$this->settings['highlight']);
|
||||
|
||||
if ($this->request->hasArgument('searchword') && $this->request->getArgument('searchword') != '')
|
||||
$demand->setSearchword((string)$this->request->getArgument('searchword'));
|
||||
|
||||
if ($this->request->hasArgument('start') && $this->request->getArgument('start') != '') {
|
||||
$demand->setStart(date( "Y-m-d", strtotime( $this->request->getArgument('start'))));
|
||||
}
|
||||
|
||||
if ($this->request->hasArgument('end') && $this->request->getArgument('end') != '') {
|
||||
$demand->setEnd(date( "Y-m-d", strtotime( $this->request->getArgument('end'))));
|
||||
}
|
||||
|
||||
$demand->setSortBy((string)$this->settings['sortByDate']);
|
||||
$demand->setSortOrder((string)$this->settings['sortOrder']);
|
||||
|
||||
$demand->setHighlight((string)$this->settings['highlight']);
|
||||
|
||||
if (!empty($this->settings['limit'])) {
|
||||
$demand->setLimit($this->settings['limit']);
|
||||
}
|
||||
|
|
|
@ -84,6 +84,21 @@ class EventController extends ActionController
|
|||
$this->view->assign('events', $events);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $search
|
||||
*/
|
||||
public function searchAction(): void
|
||||
{
|
||||
$search = '';
|
||||
if ($this->request->hasArgument('search')) {
|
||||
$search = $this->request->getArgument('search');
|
||||
}
|
||||
|
||||
$this->view->assign('search', $search);
|
||||
$this->view->assign('events', $this->eventRepository->findSearchWord($search));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return EventDemand
|
||||
*/
|
||||
|
|
|
@ -2,18 +2,6 @@
|
|||
namespace Wrm\Events\Domain\Model;
|
||||
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "DD Events" Extension for TYPO3 CMS.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* (c) 2019 Dirk Koritnik <koritnik@werkraum-media.de>
|
||||
*
|
||||
***/
|
||||
|
||||
|
||||
/**
|
||||
* Date
|
||||
*/
|
||||
|
@ -28,7 +16,7 @@ class Date extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
|
|||
/**
|
||||
* @var \DateTime
|
||||
*/
|
||||
protected $end = '';
|
||||
protected $end = null;
|
||||
|
||||
/**
|
||||
* @var \Wrm\Events\Domain\Model\Event
|
||||
|
|
|
@ -32,18 +32,33 @@ class DateDemand {
|
|||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $region = null;
|
||||
protected $region = '';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
* @var bool
|
||||
*/
|
||||
protected $highlight = null;
|
||||
protected $highlight = 0;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $limit = '';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $start = '';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $end = '';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $searchword = '';
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
|
@ -141,15 +156,15 @@ class DateDemand {
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return bool
|
||||
*/
|
||||
public function getHighlight(): string
|
||||
public function getHighlight(): bool
|
||||
{
|
||||
return $this->highlight;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $hightlight
|
||||
* @param bool $highlight
|
||||
*/
|
||||
public function setHighlight(string $highlight): void
|
||||
{
|
||||
|
@ -172,6 +187,52 @@ class DateDemand {
|
|||
$this->limit = $limit;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getSearchword(): string
|
||||
{
|
||||
return $this->searchword;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $searchword
|
||||
*/
|
||||
public function setSearchword(string $searchword): void
|
||||
{
|
||||
$this->searchword = $searchword;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getStart(): string
|
||||
{
|
||||
return $this->start;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $start
|
||||
*/
|
||||
public function setStart(string $start): void
|
||||
{
|
||||
$this->start = $start;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getEnd(): string
|
||||
{
|
||||
return $this->end;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $end
|
||||
*/
|
||||
public function setEnd(string $end): void
|
||||
{
|
||||
$this->end = $end;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,21 +1,7 @@
|
|||
<?php
|
||||
namespace Wrm\Events\Domain\Repository;
|
||||
|
||||
/**
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
use Wrm\Events\Domain\Model\Dto\DateDemand;
|
||||
use Wrm\Events\Domain\Model\Event;
|
||||
use Wrm\Events\Service\CategoryService;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
|
@ -26,25 +12,17 @@ class DateRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
|
|||
{
|
||||
|
||||
/**
|
||||
* Find all products based on selected uids
|
||||
*
|
||||
* Find all dates based on selected uids
|
||||
* @param string $uids
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function findByUids($uids)
|
||||
{
|
||||
$uids = explode(',', $uids);
|
||||
|
||||
$query = $this->createQuery();
|
||||
//$query->getQuerySettings()->setRespectStoragePage(false);
|
||||
|
||||
$query->matching(
|
||||
$query->in('uid', $uids)
|
||||
);
|
||||
|
||||
//return $this->orderByField($query->execute(), $uids);
|
||||
|
||||
return $query->execute();
|
||||
}
|
||||
|
||||
|
@ -56,11 +34,11 @@ class DateRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
|
|||
public function findByDemand(DateDemand $demand)
|
||||
{
|
||||
$query = $this->createDemandQuery($demand);
|
||||
return $query->execute();
|
||||
|
||||
// For testing purposes
|
||||
// $query = $this->createDemandQueryViaBuilder($demand);
|
||||
|
||||
return $query->execute();
|
||||
//return $query->execute()->fetchAll();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -71,9 +49,7 @@ class DateRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
|
|||
protected function createDemandQuery(DateDemand $demand): QueryInterface
|
||||
{
|
||||
$query = $this->createQuery();
|
||||
|
||||
$constraints = [];
|
||||
|
||||
$categories = $demand->getCategories();
|
||||
|
||||
if ($categories) {
|
||||
|
@ -89,25 +65,37 @@ class DateRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
|
|||
$constraints['region'] = $query->equals('event.region', $demand->getRegion());
|
||||
}
|
||||
|
||||
if ($demand->getRegion() !== null) {
|
||||
if ($demand->getHighlight() !== FALSE) {
|
||||
$constraints['highlight'] = $query->equals('event.highlight', $demand->getHighlight());
|
||||
}
|
||||
|
||||
if ($demand->getSearchword() !== '') {
|
||||
$constraints['searchword'] = $query->logicalOr(
|
||||
[
|
||||
$query->like('event.title', '%' . $demand->getSearchword() . '%'),
|
||||
$query->like('event.teaser', '%' . $demand->getSearchword() . '%')
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
if ($demand->getStart() !== '' && $demand->getEnd() != '') {
|
||||
$constraints['daterange'] = $query->logicalAnd(
|
||||
[
|
||||
$query->greaterThanOrEqual('start', $demand->getStart()),
|
||||
$query->lessThanOrEqual('start', $demand->getEnd())
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
if ($demand->getLimit() !== '') {
|
||||
$query->setLimit((int) $demand->getLimit());
|
||||
}
|
||||
|
||||
|
||||
if (!empty($constraints)) {
|
||||
$query->matching($query->logicalAnd($constraints));
|
||||
}
|
||||
|
||||
|
||||
$sortBy = $demand->getSortBy();
|
||||
if ($sortBy && $sortBy !== 'singleSelection' && $sortBy !== 'default') {
|
||||
$order = strtolower($demand->getSortOrder()) === 'desc' ? QueryInterface::ORDER_DESCENDING : QueryInterface::ORDER_ASCENDING;
|
||||
$query->setOrderings([$sortBy => $order]);
|
||||
}
|
||||
$query->setOrderings([$demand->getSortBy() => $demand->getSortOrder()]);
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
@ -140,37 +128,30 @@ class DateRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param DateDemand
|
||||
* @return $statement
|
||||
* @throws InvalidQueryException
|
||||
* findSearchWord with Query Builder
|
||||
* @param $search
|
||||
*/
|
||||
|
||||
protected function createDemandQueryViaBuilder(DateDemand $demand) {
|
||||
|
||||
//$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_Events_domain_model_date');
|
||||
public function findSearchWord($search)
|
||||
{
|
||||
|
||||
$connection = GeneralUtility::makeInstance(ConnectionPool::class)
|
||||
->getConnectionForTable('tx_Events_domain_model_date');
|
||||
->getConnectionForTable('tx_events_domain_model_date');
|
||||
|
||||
$queryBuilder = $connection->createQueryBuilder();
|
||||
|
||||
$statement = $queryBuilder
|
||||
->select('tx_Events_domain_model_date.start', 'tx_Events_domain_model_date.end', 'tx_Events_domain_model_date.event')
|
||||
->from('tx_Events_domain_model_date')
|
||||
->select('*')
|
||||
->from('tx_events_domain_model_date')
|
||||
->join(
|
||||
'tx_Events_domain_model_date',
|
||||
'tx_Events_domain_model_event',
|
||||
'tx_events_domain_model_date',
|
||||
'tx_events_domain_model_event',
|
||||
'event',
|
||||
$queryBuilder->expr()->eq('tx_Events_domain_model_date.event', $queryBuilder->quoteIdentifier('event.uid'))
|
||||
$queryBuilder->expr()->eq('tx_events_domain_model_date.event', $queryBuilder->quoteIdentifier('event.uid'))
|
||||
)->where(
|
||||
$queryBuilder->expr()->eq('event.title', $queryBuilder->createNamedParameter('Bachführung'))
|
||||
);
|
||||
$queryBuilder->expr()->like('event.title', $queryBuilder->createNamedParameter('%' . $search . '%'))
|
||||
)->orderBy('tx_events_domain_model_date.start');
|
||||
|
||||
if ($demand->getLimit() !== '') {
|
||||
$statement->setMaxResults((int) $demand->getLimit());
|
||||
}
|
||||
|
||||
return $statement;
|
||||
return $statement->execute()->fetchAll();
|
||||
}
|
||||
|
||||
}
|
|
@ -131,4 +131,16 @@ class EventRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
|
|||
return $constraints;
|
||||
}
|
||||
|
||||
|
||||
public function findSearchWord($search)
|
||||
{
|
||||
$query = $this->createQuery();
|
||||
$query->matching(
|
||||
$query->like('title', '%' . $search . '%')
|
||||
);
|
||||
$query->setOrderings(['title' => QueryInterface::ORDER_ASCENDING]);
|
||||
$query->setLimit(20);
|
||||
return $query->execute();
|
||||
}
|
||||
|
||||
}
|
|
@ -41,6 +41,16 @@
|
|||
<numIndex index="1">Date->show</numIndex>
|
||||
</numIndex>
|
||||
|
||||
<numIndex index="6">
|
||||
<numIndex index="0">Event Search</numIndex>
|
||||
<numIndex index="1">Event->search</numIndex>
|
||||
</numIndex>
|
||||
|
||||
<numIndex index="6">
|
||||
<numIndex index="0">Date Search</numIndex>
|
||||
<numIndex index="1">Date->search</numIndex>
|
||||
</numIndex>
|
||||
|
||||
</items>
|
||||
</config>
|
||||
</TCEforms>
|
||||
|
@ -55,21 +65,14 @@
|
|||
<type>select</type>
|
||||
<items type="array">
|
||||
<numIndex index="0" type="array">
|
||||
<numIndex index="0">Default</numIndex>
|
||||
<numIndex index="1">default</numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="1" type="array">
|
||||
<numIndex index="0">Title</numIndex>
|
||||
<numIndex index="1">title</numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="2" type="array">
|
||||
<numIndex index="1" type="array">
|
||||
<numIndex index="0">Region</numIndex>
|
||||
<numIndex index="1">region</numIndex>
|
||||
</numIndex>
|
||||
</items>
|
||||
<!--
|
||||
<itemsProcFunc>FriendsOfTYPO3\TtAddress\Hooks\Tca\AddFieldsToSelector->main</itemsProcFunc>
|
||||
-->
|
||||
</config>
|
||||
</TCEforms>
|
||||
</settings.sortByEvent>
|
||||
|
@ -78,26 +81,24 @@
|
|||
<TCEforms>
|
||||
<exclude>1</exclude>
|
||||
<label>Sort By</label>
|
||||
<displayCond>FIELD:switchableControllerActions:=:Date->list</displayCond>
|
||||
<displayCond>
|
||||
<OR>
|
||||
<numIndex index="0">FIELD:switchableControllerActions:=:Date->list</numIndex>
|
||||
<numIndex index="1">FIELD:switchableControllerActions:=:Date->search</numIndex>
|
||||
</OR>
|
||||
</displayCond>
|
||||
<config>
|
||||
<type>select</type>
|
||||
<items type="array">
|
||||
<numIndex index="0" type="array">
|
||||
<numIndex index="0">Default</numIndex>
|
||||
<numIndex index="1">default</numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="1" type="array">
|
||||
<numIndex index="0">Start</numIndex>
|
||||
<numIndex index="1">start</numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="2" type="array">
|
||||
<numIndex index="1" type="array">
|
||||
<numIndex index="0">End</numIndex>
|
||||
<numIndex index="1">end</numIndex>
|
||||
</numIndex>
|
||||
</items>
|
||||
<!--
|
||||
<itemsProcFunc>FriendsOfTYPO3\TtAddress\Hooks\Tca\AddFieldsToSelector->main</itemsProcFunc>
|
||||
-->
|
||||
</config>
|
||||
</TCEforms>
|
||||
</settings.sortByDate>
|
||||
|
@ -110,6 +111,7 @@
|
|||
<OR>
|
||||
<numIndex index="0">FIELD:switchableControllerActions:=:Event->list</numIndex>
|
||||
<numIndex index="1">FIELD:switchableControllerActions:=:Date->list</numIndex>
|
||||
<numIndex index="2">FIELD:switchableControllerActions:=:Date->search</numIndex>
|
||||
</OR>
|
||||
</displayCond>
|
||||
<config>
|
||||
|
@ -141,6 +143,7 @@
|
|||
<OR>
|
||||
<numIndex index="0">FIELD:switchableControllerActions:=:Event->list</numIndex>
|
||||
<numIndex index="1">FIELD:switchableControllerActions:=:Date->list</numIndex>
|
||||
<numIndex index="2">FIELD:switchableControllerActions:=:Date->search</numIndex>
|
||||
</OR>
|
||||
</displayCond>
|
||||
<config>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
|
||||
|
||||
|
||||
<f:widget.paginate objects="{dates}" as="paginatedDates" configuration="{itemsPerPage: 25, insertAbove: 0, insertBelow: 1, maximumNumberOfLinks: 5}">
|
||||
<f:for each="{paginatedDates}" as="date">
|
||||
<div class="row mb-3">
|
||||
|
@ -34,4 +35,5 @@
|
|||
</div>
|
||||
</f:for>
|
||||
</f:widget.paginate>
|
||||
|
||||
</html>
|
55
Resources/Private/Partials/Date/SearchForm.html
Normal file
55
Resources/Private/Partials/Date/SearchForm.html
Normal file
|
@ -0,0 +1,55 @@
|
|||
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
|
||||
<div class="row">
|
||||
<div class="col-8 mb-5">
|
||||
<!-- TODO bg color classes not loaded in scss -->
|
||||
|
||||
<f:form action="search" additionalAttributes="{role: 'form'}">
|
||||
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="form-group">
|
||||
<label for="searchword">Suchwort</label>
|
||||
<f:form.textfield type="text" class="form-control" id="searchword" name="searchword" value="{searchword}" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="form-group">
|
||||
<label for="start">Datum von</label>
|
||||
<f:form.textfield type="text" class="form-control" id="start" name="start" value="{start}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="form-group">
|
||||
<label for="end">Datum bis</label>
|
||||
<f:form.textfield type="text" class="form-control" id="end" name="end" value="{end}" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-3">
|
||||
<div class="form-check">
|
||||
<f:form.radio class="form-check-input" name="region" value="{region.uid}" checked="{selRegion}==0" id="radio_0"/>
|
||||
<label class="form-check-label" for="radio_0">Alle Städte</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<f:for each="{regions}" as="region">
|
||||
<div class="col-3">
|
||||
<div class="form-check">
|
||||
<f:form.radio class="form-check-input" name="region" value="{region.uid}" checked="{selRegion}=={region.uid}" id="radio_{region.uid}"/>
|
||||
<label class="form-check-label" for="radio_{region.uid}">{region.title}</label>
|
||||
</div>
|
||||
</div>
|
||||
</f:for>
|
||||
</div>
|
||||
<div class="form-group mt-3">
|
||||
<f:form.submit value="Suchen" class="btn btn-primary" />
|
||||
</div>
|
||||
</f:form>
|
||||
|
||||
</div>
|
||||
</div>
|
14
Resources/Private/Partials/Event/SearchForm.html
Normal file
14
Resources/Private/Partials/Event/SearchForm.html
Normal file
|
@ -0,0 +1,14 @@
|
|||
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="p-3 mb-2 bg-light text-dark">
|
||||
<f:form action="search" additionalAttributes="{role: 'form'}">
|
||||
<div class="input-group mb-3">
|
||||
<f:form.textfield name="search" value="{search}" class="form-control" />
|
||||
<f:form.submit value="Search" class="btn btn-outline-secondary" />
|
||||
</div>
|
||||
</f:form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -1,148 +0,0 @@
|
|||
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
|
||||
<table class="tx-events" >
|
||||
<tr>
|
||||
<td>
|
||||
<f:translate key="tx_events_domain_model_events.global_id" />
|
||||
</td>
|
||||
<td>
|
||||
{events.globalId}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<f:translate key="tx_events_domain_model_events.title" />
|
||||
</td>
|
||||
<td>
|
||||
{events.title}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<f:translate key="tx_events_domain_model_events.teaser" />
|
||||
</td>
|
||||
<td>
|
||||
{events.teaser}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<f:translate key="tx_events_domain_model_events.details" />
|
||||
</td>
|
||||
<td>
|
||||
{events.details}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<f:translate key="tx_events_domain_model_events.price_info" />
|
||||
</td>
|
||||
<td>
|
||||
{events.priceInfo}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<f:translate key="tx_events_domain_model_events.street" />
|
||||
</td>
|
||||
<td>
|
||||
{events.street}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<f:translate key="tx_events_domain_model_events.district" />
|
||||
</td>
|
||||
<td>
|
||||
{events.district}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<f:translate key="tx_events_domain_model_events.city" />
|
||||
</td>
|
||||
<td>
|
||||
{events.city}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<f:translate key="tx_events_domain_model_events.zip" />
|
||||
</td>
|
||||
<td>
|
||||
{events.zip}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<f:translate key="tx_events_domain_model_events.web" />
|
||||
</td>
|
||||
<td>
|
||||
{events.web}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<f:translate key="tx_events_domain_model_events.booking" />
|
||||
</td>
|
||||
<td>
|
||||
{events.booking}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<f:translate key="tx_events_domain_model_events.ticket" />
|
||||
</td>
|
||||
<td>
|
||||
{events.ticket}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<f:translate key="tx_events_domain_model_events.facebook" />
|
||||
</td>
|
||||
<td>
|
||||
{events.facebook}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<f:translate key="tx_events_domain_model_events.youtube" />
|
||||
</td>
|
||||
<td>
|
||||
{events.youtube}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<f:translate key="tx_events_domain_model_events.latitude" />
|
||||
</td>
|
||||
<td>
|
||||
{events.latitude}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<f:translate key="tx_events_domain_model_events.longitude" />
|
||||
</td>
|
||||
<td>
|
||||
{events.longitude}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<f:translate key="tx_events_domain_model_events.images" />
|
||||
</td>
|
||||
<td>
|
||||
<f:image src="{events.images.originalResource.publicUrl}" width="200"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<f:translate key="tx_events_domain_model_events.slug" />
|
||||
</td>
|
||||
<td>
|
||||
{events.slug}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</html>
|
42
Resources/Private/Templates/Date/Search.html
Normal file
42
Resources/Private/Templates/Date/Search.html
Normal file
|
@ -0,0 +1,42 @@
|
|||
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
|
||||
|
||||
<f:render partial="Date/SearchForm" arguments="{searchword: searchword, dates: dates, regions: regions, selRegion: selRegion, start: start, end: end}"/>
|
||||
|
||||
<hr class="mt-2 mb-4">
|
||||
|
||||
<f:widget.paginate objects="{dates}" as="paginatedDates" configuration="{itemsPerPage: 25, insertAbove: 0, insertBelow: 1, maximumNumberOfLinks: 5, addQueryStringMethod: 'POST,GET'}">
|
||||
<f:for each="{paginatedDates}" as="date">
|
||||
<div class="row mt-3 mb-3 pb-3 border-bottom ">
|
||||
<div class="col-2">
|
||||
<b><f:format.date format="H:i">{date.start}</f:format.date></b><br>
|
||||
<b><f:format.date format="%a">{date.start}</f:format.date></b><br>
|
||||
<b><f:format.date format="d.m.">{date.start}</f:format.date></b><br>
|
||||
{date.event.region.title}<br>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<f:if condition="{date.event.highlight}">
|
||||
<f:then>
|
||||
<b>Hightlight</b>
|
||||
</f:then>
|
||||
</f:if>
|
||||
<h4>{date.event.title}</h4>
|
||||
<p><strong>{date.event.teaser}</strong></p>
|
||||
<f:format.crop maxCharacters="150">{date.event.details}</f:format.crop>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<f:if condition="{date.event.images}">
|
||||
<f:then>
|
||||
<f:link.action pageUid="{settings.showPID}" action="show" controller="Date" arguments="{date: date}">
|
||||
<f:image src="{date.event.images.originalResource.originalFile.uid}" alt="" width="400c" height="280c" class="img-fluid img-thumbnail"/>
|
||||
</f:link.action>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<img src="https://dummyimage.com/400x280/ddd/ccc" alt="Dummy" width="400" height="280" class="img-fluid img-thumbnail"/>
|
||||
</f:else>
|
||||
</f:if>
|
||||
</div>
|
||||
</div>
|
||||
</f:for>
|
||||
</f:widget.paginate>
|
||||
|
||||
</html>
|
27
Resources/Private/Templates/Event/Search.html
Normal file
27
Resources/Private/Templates/Event/Search.html
Normal file
|
@ -0,0 +1,27 @@
|
|||
<f:render partial="Event/SearchForm" arguments="{search: search}"/>
|
||||
|
||||
<div class="row">
|
||||
<f:for each="{events}" as="event">
|
||||
<div class="col-sm-12 col-md-6 col-lg-4 col-xl-4">
|
||||
<div class="menu-tile">
|
||||
<f:if condition="{event.images}">
|
||||
<f:then>
|
||||
<f:link.action pageUid="{settings.showPID}" action="show" controller="Event" arguments="{event: event}">
|
||||
<f:image src="{event.images.originalResource.originalFile.uid}" alt="" width="480c" height="320c" class="img-fluid img-thumbnail"/>
|
||||
</f:link.action>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<img src="https://dummyimage.com/480x320/ddd/ccc" alt="Dummy" width="480" height="320" class="img-fluid img-thumbnail"/>
|
||||
</f:else>
|
||||
</f:if>
|
||||
</div>
|
||||
<div class="caption">
|
||||
<div class="caption-text mt-3">
|
||||
{event.region.title}
|
||||
<h4>{event.title}</h4>
|
||||
<p>{event.teaser}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</f:for>
|
||||
</div>
|
|
@ -9,12 +9,12 @@ call_user_func(
|
|||
'Wrm.Events',
|
||||
'Pi1',
|
||||
[
|
||||
'Event' => 'teaser, list, show',
|
||||
'Date' => 'teaser, list, show'
|
||||
'Event' => 'teaser, list, show, search',
|
||||
'Date' => 'teaser, list, show, search'
|
||||
],
|
||||
[
|
||||
'Event' => 'teaser, list, show',
|
||||
'Date' => 'teaser, list, show'
|
||||
'Event' => 'teaser, list, show, search',
|
||||
'Date' => 'teaser, list, show, search'
|
||||
]
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in a new issue