jweiland-net / events2

With this TYPO3 extension you can organize one, multiple and recurring events.
GNU General Public License v2.0
18 stars 16 forks source link

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

Open derBoogie opened 3 years ago

derBoogie commented 3 years ago

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

derBoogie commented 3 years ago

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());
    }
  3. 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>
  2. Create template .../Templates/Day/ListArchive.html and copy markup from List.html

  3. FlexForms.xlf needs to be extended with:

    <trans-unit id="listArchive">
    <source>List archive events</source>
    </trans-unit>
  4. 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 commented 2 years ago

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

maslme commented 1 year ago

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 commented 1 year ago

@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.