Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE REQUEST] Show past events in list view #269

Open
derBoogie opened this issue Jun 1, 2021 · 4 comments
Open

[FEATURE REQUEST] Show past events in list view #269

derBoogie opened this issue Jun 1, 2021 · 4 comments

Comments

@derBoogie
Copy link

A spimle archive list view (without recurring events) would be great!

@derBoogie
Copy link
Author

derBoogie commented Jun 16, 2021

I have implemented the archive view for testing purposes.
This requires relatively little effort:

  1. ext_localconf.php the plugin configuration has to be extended with a "listArchive" action.

  2. DayController.php has to be extended with a "listArchiveAction":

/**
 * @param Filter|null $filter
 */
public function listArchiveAction(?Filter $filter = null): void
{
  $days = $this->dayRepository->findEvents('archive', $this->validateAndAssignFilter($filter));
  $this->view->assign('days', $days);
  CacheUtility::addPageCacheTagsByQuery($days->getQuery());
}
  1. Switch/Case in DatabaseService.php, function addConstraintForDate has to be extended with:
case 'archive':
  if ($this->extConf->getRecurringPast() === 0) {
    // including current time - x months
    $startDateTime = new \DateTime('now -12 months');					
  } else {
    // including current time - x months
    $startDateTime = new \DateTime('today -12 months');
  }
  $endDateTime = $dateTimeUtility->convert('today - 1 day');
  $endDateTime->modify('23:59:59');
  break;
  1. switchableControllerActions in Confuiguration/FelxForms/Events.xml has to be extended with:
<numIndex index="5">
  <numIndex index="0">LLL:EXT:events2/Resources/Private/Language/FlexForms.xlf:listArchive</numIndex>
  <numIndex index="1"><![CDATA[Day->listArchive;Day->show;Day->showByTimestamp;Location->show;Video->show]]></numIndex>
</numIndex>
  1. Create template .../Templates/Day/ListArchive.html and copy markup from List.html

  2. FlexForms.xlf needs to be extended with:

<trans-unit id="listArchive">
  <source>List archive events</source>
</trans-unit>
  1. de.FlexForm.xlf has to be extended with:
<trans-unit id="listArchive">
  <source>List archive events</source>
  <target>Auflistung von Archiv-Terminen</target>
</trans-unit>

It would be great if this could be included in the next release!

@froemken
Copy link
Contributor

froemken commented Sep 5, 2022

Showing past events is not the idea of events2, but since years the type "range" is not fully implemented:
https:/jweiland-net/events2/blob/master/Classes/Domain/Repository/DayRepository.php#L334
Maybe that can be used to implement such a feature.

@maslme
Copy link

maslme commented Jan 12, 2023

As I understood the documentation the extension setting recurringPast https://docs.typo3.org/p/jweiland/events2/main/en-us/Configuration/Extension/Index.html#recurringpast will show past events in the frontend or am I wrong?

@froemken
Copy link
Contributor

@maslme This setting will only configure the past X month a day record will be calculated for each event. Events without a calculated day record will not be shown in frontend. Of cause, you can set this value to f.e. 328, but such huge values will cost a lot of time and power to calculate all these day records. It can result in a lot of day records, which may slow down your complete events2 system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants