Loading patches/015-email-mail-template.patch +10 −12 Original line number Diff line number Diff line --- ./apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 2024-03-18 11:18:20 +++ ./apps/dav/lib/CalDAV/Schedule/IMipPlugin-new.php 2024-03-11 11:18:22 @@ -175,6 +175,31 @@ @@ -175,6 +175,30 @@ $oldVevent = !empty($modified['old']) && is_array($modified['old']) ? array_pop($modified['old']) : null; $isModified = isset($oldVevent); + if (isset($vEvent->{'RECURRENCE-ID'}) && $modified['sentOld'] === 1) { + \OC::$server->getLogger()->error("Recurrence ID exists"); + if (isset($vEvent->{'RECURRENCE-ID'}) && $modified['sentOld'] === 1 && !empty($oldVevent)) { + + $recurrenceId = $vEvent->{'RECURRENCE-ID'}; + $dateTime = $recurrenceId->getValue(); + $recurrenceArray = explode('T', $dateTime); + + $oldVEventStart = $oldVEvent->DTSTART; + $oldVEventStart = $oldVevent->DTSTART; + $oldStartDateTime = $oldVEventStart->getValue(); + $startDateTimeArray = explode('T', $oldStartDateTime); + $finalStartTime = $recurrenceArray[0] . 'T' . $startDateTimeArray[1]; + + $timeZoneId = (string) $recurrenceId['TZID']; + $oldVEvent->DTSTART->setDateTime( + $oldVevent->DTSTART->setDateTime( + new \DateTime($finalStartTime, new \DateTimeZone($timeZoneId)) + ); + + $oldVEventEnd = $oldVEvent->DTEND; + $oldVEventEnd = $oldVevent->DTEND; + $oldEndDateTime = $oldVEventEnd->getValue(); + $endDateTimeArray = explode('T', $oldEndDateTime); + $finalEndTime = $recurrenceArray[0] . 'T' . $endDateTimeArray[1]; + $oldVEvent->DTEND->setDateTime( + $oldVevent->DTEND->setDateTime( + new \DateTime($finalEndTime, new \DateTimeZone($timeZoneId)) + ); + } // No changed events after all - this shouldn't happen if there is significant change yet here we are // The scheduling status is debatable if(empty($vEvent)) { @@ -242,6 +267,13 @@ @@ -242,6 +266,13 @@ $data['invitee_name'] = ($senderName ?: $sender); $fromEMail = Util::getDefaultEmailAddress('invitations-noreply'); Loading @@ -46,7 +45,7 @@ $fromName = $this->imipService->getFrom($senderName, $this->defaults->getName()); $message = $this->mailer->createMessage() @@ -262,7 +294,22 @@ @@ -262,7 +293,22 @@ $template = $this->mailer->createEMailTemplate('dav.calendarInvite.' . $method, $data); $template->addHeader(); Loading @@ -64,13 +63,13 @@ + $template->addHeadingBanner('#EFFFDB','#293618',$l10n->t('This recurring event has been updated, please review the information below:')); + } + $sequence = $vEvent->SEQUENCE ? $vEvent->SEQUENCE->getValue() : NULL; + if ($sequence && $method !== self::METHOD_CANCEL && $method !== self::METHOD_REPLY && count($vEvent)==1 && ($sequence > 2)) { + if (($sequence && $method !== self::METHOD_CANCEL && $method !== self::METHOD_REPLY && ($sequence > 2)) || isset($vEvent->{'RECURRENCE-ID'})) { + $template->addHeadingBanner('#EFFFDB','#293618',$l10n->t('This event has been updated, please review the information below:')); + } $this->imipService->addBulletList($template, $vEvent, $data); // Only add response buttons to invitation requests: Fix Issue #11230 @@ -295,7 +342,6 @@ @@ -295,7 +341,6 @@ || in_array(strtolower($recipientDomain), $invitationLinkRecipients)) { $token = $this->imipService->createInvitationToken($iTipMessage, $vEvent, $lastOccurrence); $this->imipService->addResponseButtons($template, $token); Loading @@ -78,7 +77,6 @@ } } --- ./apps/dav/lib/CalDAV/Schedule/IMipService.php 2024-03-18 11:40:39 +++ ./apps/dav/lib/CalDAV/Schedule/IMipService-new.php 2024-03-18 13:47:17 @@ -169,10 +169,30 @@ Loading Loading
patches/015-email-mail-template.patch +10 −12 Original line number Diff line number Diff line --- ./apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 2024-03-18 11:18:20 +++ ./apps/dav/lib/CalDAV/Schedule/IMipPlugin-new.php 2024-03-11 11:18:22 @@ -175,6 +175,31 @@ @@ -175,6 +175,30 @@ $oldVevent = !empty($modified['old']) && is_array($modified['old']) ? array_pop($modified['old']) : null; $isModified = isset($oldVevent); + if (isset($vEvent->{'RECURRENCE-ID'}) && $modified['sentOld'] === 1) { + \OC::$server->getLogger()->error("Recurrence ID exists"); + if (isset($vEvent->{'RECURRENCE-ID'}) && $modified['sentOld'] === 1 && !empty($oldVevent)) { + + $recurrenceId = $vEvent->{'RECURRENCE-ID'}; + $dateTime = $recurrenceId->getValue(); + $recurrenceArray = explode('T', $dateTime); + + $oldVEventStart = $oldVEvent->DTSTART; + $oldVEventStart = $oldVevent->DTSTART; + $oldStartDateTime = $oldVEventStart->getValue(); + $startDateTimeArray = explode('T', $oldStartDateTime); + $finalStartTime = $recurrenceArray[0] . 'T' . $startDateTimeArray[1]; + + $timeZoneId = (string) $recurrenceId['TZID']; + $oldVEvent->DTSTART->setDateTime( + $oldVevent->DTSTART->setDateTime( + new \DateTime($finalStartTime, new \DateTimeZone($timeZoneId)) + ); + + $oldVEventEnd = $oldVEvent->DTEND; + $oldVEventEnd = $oldVevent->DTEND; + $oldEndDateTime = $oldVEventEnd->getValue(); + $endDateTimeArray = explode('T', $oldEndDateTime); + $finalEndTime = $recurrenceArray[0] . 'T' . $endDateTimeArray[1]; + $oldVEvent->DTEND->setDateTime( + $oldVevent->DTEND->setDateTime( + new \DateTime($finalEndTime, new \DateTimeZone($timeZoneId)) + ); + } // No changed events after all - this shouldn't happen if there is significant change yet here we are // The scheduling status is debatable if(empty($vEvent)) { @@ -242,6 +267,13 @@ @@ -242,6 +266,13 @@ $data['invitee_name'] = ($senderName ?: $sender); $fromEMail = Util::getDefaultEmailAddress('invitations-noreply'); Loading @@ -46,7 +45,7 @@ $fromName = $this->imipService->getFrom($senderName, $this->defaults->getName()); $message = $this->mailer->createMessage() @@ -262,7 +294,22 @@ @@ -262,7 +293,22 @@ $template = $this->mailer->createEMailTemplate('dav.calendarInvite.' . $method, $data); $template->addHeader(); Loading @@ -64,13 +63,13 @@ + $template->addHeadingBanner('#EFFFDB','#293618',$l10n->t('This recurring event has been updated, please review the information below:')); + } + $sequence = $vEvent->SEQUENCE ? $vEvent->SEQUENCE->getValue() : NULL; + if ($sequence && $method !== self::METHOD_CANCEL && $method !== self::METHOD_REPLY && count($vEvent)==1 && ($sequence > 2)) { + if (($sequence && $method !== self::METHOD_CANCEL && $method !== self::METHOD_REPLY && ($sequence > 2)) || isset($vEvent->{'RECURRENCE-ID'})) { + $template->addHeadingBanner('#EFFFDB','#293618',$l10n->t('This event has been updated, please review the information below:')); + } $this->imipService->addBulletList($template, $vEvent, $data); // Only add response buttons to invitation requests: Fix Issue #11230 @@ -295,7 +342,6 @@ @@ -295,7 +341,6 @@ || in_array(strtolower($recipientDomain), $invitationLinkRecipients)) { $token = $this->imipService->createInvitationToken($iTipMessage, $vEvent, $lastOccurrence); $this->imipService->addResponseButtons($template, $token); Loading @@ -78,7 +77,6 @@ } } --- ./apps/dav/lib/CalDAV/Schedule/IMipService.php 2024-03-18 11:40:39 +++ ./apps/dav/lib/CalDAV/Schedule/IMipService-new.php 2024-03-18 13:47:17 @@ -169,10 +169,30 @@ Loading