diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2024-03-06 13:15:21 +0000 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2024-03-06 13:15:21 +0000 |
| commit | 41b3733ff6b1dd9213c1fd610b1e2606f1294933 (patch) | |
| tree | d18a613153ec1571cc0c2e8d6ca363c2f9caf05a /cli/Commands | |
| parent | 3934e77abcfc0f62ce8102a197aff7fb94deac1d (diff) | |
fixes #3750
Closes #3750
Merge request studip/studip!2607
Diffstat (limited to 'cli/Commands')
| -rw-r--r-- | cli/Commands/Fix/EndTimeWeeklyRecurredEvents.php | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/cli/Commands/Fix/EndTimeWeeklyRecurredEvents.php b/cli/Commands/Fix/EndTimeWeeklyRecurredEvents.php deleted file mode 100644 index 40e7a2b..0000000 --- a/cli/Commands/Fix/EndTimeWeeklyRecurredEvents.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php - -namespace Studip\Cli\Commands\Fix; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Style\SymfonyStyle; - -class EndTimeWeeklyRecurredEvents extends Command -{ - protected static $defaultName = 'fix:end-time-weekly-recurred-events'; - - protected function configure(): void - { - $this->setDescription('Fix end time weekly recurred events'); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $io = new SymfonyStyle($input, $output); - $events = \EventData::findBySQL("rtype = 'WEEKLY' AND IFNULL(count, 0) > 0"); - $cal_event = new \CalendarEvent(); - - $i = 0; - - foreach ($events as $event) { - $id = $event->getId(); - $cal_event->event = $event; - $rrule = $cal_event->getRecurrence(); - $cal_event->setRecurrence($rrule); - $event->expire = $cal_event->event->expire; - $event->setId($id); - $event->store(); - $i++; - } - $io->info('Wrong end time of recurrence fixed for ' . $i . ' events.'); - return Command::SUCCESS; - } -} |
