Skip to content

Commit

Permalink
Add shortcutLimitEvents option for shortcuts
Browse files Browse the repository at this point in the history
  • Loading branch information
lochmueller committed Jun 28, 2021
1 parent 2d253f9 commit d6d73ff
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Classes/Controller/CalendarController.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,11 @@ public function shortcutAction()
return 'Invalid object';
}

$fetchEvent = $this->indexRepository->findByEventTraversing($event, true, false, 1);
$limitEvents = (int)$this->settings['shortcutLimitEvents'];

$fetchEvent = $this->indexRepository->findByEventTraversing($event, true, false, $limitEvents);
if (\count($fetchEvent) <= 0) {
$fetchEvent = $this->indexRepository->findByEventTraversing($event, false, true, 1, QueryInterface::ORDER_DESCENDING);
$fetchEvent = $this->indexRepository->findByEventTraversing($event, false, true, $limitEvents, QueryInterface::ORDER_DESCENDING);
}

$this->view->assignMultiple([
Expand Down
3 changes: 3 additions & 0 deletions Configuration/TypoScript/constants.typoscript
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ plugin.tx_calendarize {
# cat=calendarize//0110; type=int+; label=Default detail PID: Default detail PID for e.g. the Insert record TS configuration
defaultDetailPid = 0

# cat=calendarize//0130; type=int+; label=Shortcut limit events: The amount of events that are selected in the shortcut view. Keep in mind, that future and past are selected separated.
shortcutLimitEvents = 1

feed {
# cat=calendarize//0080; type=string; label=Title of the Feed: The feed title for atom and xml/rss
title = Title of the feed
Expand Down
1 change: 1 addition & 0 deletions Configuration/TypoScript/setup.typoscript
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ plugin.tx_calendarize {
listStartTimeOffsetHours = {$plugin.tx_calendarize.settings.listStartTimeOffsetHours}
searchEndModifier = {$plugin.tx_calendarize.settings.searchEndModifier}
defaultDetailPid = {$plugin.tx_calendarize.settings.defaultDetailPid}
shortcutLimitEvents = {$plugin.tx_calendarize.settings.shortcutLimitEvents}

paginateConfiguration {
itemsPerPage = 10
Expand Down

0 comments on commit d6d73ff

Please sign in to comment.