From a72921061360525fc7e072a53ff510a1369559f9 Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Thu, 7 Jul 2022 09:49:27 +0530 Subject: [PATCH 01/10] changes for email template modification on update --- patches/015-email-mail-template.patch | 205 ++++++++++++++++++-------- 1 file changed, 141 insertions(+), 64 deletions(-) diff --git a/patches/015-email-mail-template.patch b/patches/015-email-mail-template.patch index 6db695c7..4b6691b7 100644 --- a/patches/015-email-mail-template.patch +++ b/patches/015-email-mail-template.patch @@ -1,83 +1,160 @@ ---- apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 2022-04-27 09:57:34.955523100 +0530 -+++ apps/dav/lib/CalDAV/Schedule/IMipPlugin_Modifiednew.php 2022-04-27 09:57:09.345523100 +0530 -@@ -659,7 +659,7 @@ - Message $iTipMessage, $lastOccurrence) { - $token = $this->createInvitationToken($iTipMessage, $lastOccurrence); - -- $template->addBodyButtonGroup( -+ $template->addBodyButtonGroupTentative( - $l10n->t('Accept'), - $this->urlGenerator->linkToRouteAbsolute('dav.invitation_response.accept', [ - 'token' => $token, -@@ -667,18 +667,11 @@ - $l10n->t('Decline'), - $this->urlGenerator->linkToRouteAbsolute('dav.invitation_response.decline', [ - 'token' => $token, -- ]) -+ ]), -+ $l10n->t('Maybe'), -+ $this->urlGenerator->getAbsoluteUrl('apps/calendar/invitation/tentative/'.$token) - ); +--- ./apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 2022-07-07 09:40:41.675627600 +0530 ++++ ./apps/dav/lib/CalDAV/Schedule/IMipPlugin-new.php 2022-07-07 09:45:48.035627600 +0530 +@@ -151,15 +151,6 @@ + */ + public function schedule(Message $iTipMessage) { -- $moreOptionsURL = $this->urlGenerator->linkToRouteAbsolute('dav.invitation_response.options', [ -- 'token' => $token, -- ]); -- $html = vsprintf('%s', [ -- $moreOptionsURL, $l10n->t('More options …') -- ]); -- $text = $l10n->t('More options at %s', [$moreOptionsURL]); +- // Not sending any emails if the system considers the update +- // insignificant. +- if (!$iTipMessage->significantChange) { +- if (!$iTipMessage->scheduleStatus) { +- $iTipMessage->scheduleStatus = '1.0;We got the message, but it\'s not significant enough to warrant an email'; +- } +- return; +- } - -- $template->addBodyText($html, $text); - } + $summary = $iTipMessage->message->VEVENT->SUMMARY; - /** + if (parse_url($iTipMessage->sender, PHP_URL_SCHEME) !== 'mailto') { +@@ -414,7 +405,7 @@ + return false; + } ---- ./apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 2022-07-04 12:41:03.228533600 +0530 -+++ ./apps/dav/lib/CalDAV/Schedule/IMipPlugin-new.php 2022-07-04 14:42:56.208533600 +0530 -@@ -419,23 +419,33 @@ +- /** ++ /** + * @param IL10N $l10n * @param VEvent $vevent */ - private function generateWhenString(IL10N $l10n, VEvent $vevent) { -- $dtstart = $vevent->DTSTART; -- if (isset($vevent->DTEND)) { -- $dtend = $vevent->DTEND; -- } elseif (isset($vevent->DURATION)) { -- $isFloating = $vevent->DTSTART->isFloating(); -- $dtend = clone $vevent->DTSTART; +@@ -542,21 +533,57 @@ + * @param VEVENT $vevent + */ + private function addBulletList(IEMailTemplate $template, IL10N $l10n, $vevent) { +- if ($vevent->SUMMARY) { +- $template->addBodyListItem($vevent->SUMMARY, $l10n->t('Title:'), +- $this->getAbsoluteImagePath('caldav/title.png'),'','',self::IMIP_INDENT); + $lastmodified=0; -+ $selectedEvent = $vevent; ++ $selectedEvent = $parentevent = $vevent; + foreach( $vevent as $currentevent){ + $dtstamp= $currentevent->{'LAST-MODIFIED'}; + $dtstampTime = strtotime($dtstamp); + if($dtstampTime>$lastmodified){ + $lastmodified=$dtstampTime; + $selectedEvent = $currentevent; ++ } + } +- $meetingWhen = $this->generateWhenString($l10n, $vevent); ++ ++ if ($selectedEvent->SUMMARY) { ++ ++ if(trim($selectedEvent->SUMMARY)==trim($parentevent->SUMMARY)){ ++ $template->addBodyListItem($selectedEvent->SUMMARY, $l10n->t('Title:'), ++ $this->getAbsoluteImagePath('caldav/title.png'),'','',self::IMIP_INDENT); ++ }else{ ++ $template->addBodyListItemModified($selectedEvent->SUMMARY, $l10n->t('Updated Title:'), ++ $this->getAbsoluteImagePath('caldav/title.png'),'','',self::IMIP_INDENT); + } + } -+ $dtstart = $selectedEvent->DTSTART; -+ if (isset($selectedEvent->DTEND)) { -+ $dtend = $selectedEvent->DTEND; -+ } elseif (isset($selectedEvent->DURATION)) { -+ $isFloating = $selectedEvent->DTSTART->isFloating(); -+ $dtend = clone $selectedEvent->DTSTART; - $endDateTime = $dtend->getDateTime(); -- $endDateTime = $endDateTime->add(DateTimeParser::parse($vevent->DURATION->getValue())); -+ $endDateTime = $endDateTime->add(DateTimeParser::parse($selectedEvent->DURATION->getValue())); - $dtend->setDateTime($endDateTime, $isFloating); -- } elseif (!$vevent->DTSTART->hasTime()) { -- $isFloating = $vevent->DTSTART->isFloating(); -- $dtend = clone $vevent->DTSTART; -+ } elseif (!$selectedEvent->DTSTART->hasTime()) { -+ $isFloating = $selectedEvent->DTSTART->isFloating(); -+ $dtend = clone $selectedEvent->DTSTART; - $endDateTime = $dtend->getDateTime(); - $endDateTime = $endDateTime->modify('+1 day'); - $dtend->setDateTime($endDateTime, $isFloating); - } else { -- $dtend = clone $vevent->DTSTART; -+ $dtend = clone $selectedEvent->DTSTART; ++ $meetingWhen = $this->generateWhenString($l10n, $selectedEvent); + if ($meetingWhen) { +- $template->addBodyListItem($meetingWhen, $l10n->t('Time:'), +- $this->getAbsoluteImagePath('caldav/time.png'),'','',self::IMIP_INDENT); ++ $selectedtimestart= substr(($selectedEvent->DTSTART), strpos(($selectedEvent->DTSTART), "T") + 1); ++ $parenttimestart= substr(($parentevent->DTSTART), strpos(($parentevent->DTSTART), "T") + 1); ++ $selectedtimeend= substr(($selectedEvent->DTEND), strpos(($selectedEvent->DTEND), "T") + 1); ++ $parenttimeend= substr(($parentevent->DTEND), strpos(($parentevent->DTEND), "T") + 1); ++ ++ if(trim($selectedtimestart)==trim($parenttimestart) && trim($selectedtimeend)==trim($parenttimeend)){ ++ $template->addBodyListItem($meetingWhen, $l10n->t('Time:'), ++ $this->getAbsoluteImagePath('caldav/time.png'),'','',self::IMIP_INDENT); ++ }else{ ++ $template->addBodyListItemModified($meetingWhen, $l10n->t('Updated Time:'), ++ $this->getAbsoluteImagePath('caldav/time.png'),'','',self::IMIP_INDENT); ++ } ++ ++ + } +- if ($vevent->LOCATION) { +- $template->addBodyListItem($vevent->LOCATION, $l10n->t('Location:'), +- $this->getAbsoluteImagePath('caldav/location.png'),'','',self::IMIP_INDENT); ++ if ($selectedEvent->LOCATION) { ++ if(trim($selectedEvent->LOCATION)==trim($parentevent->LOCATION)){ ++ $template->addBodyListItem($selectedEvent->LOCATION, $l10n->t('Location:'), ++ $this->getAbsoluteImagePath('caldav/location.png'),'','',self::IMIP_INDENT); ++ }else{ ++ $template->addBodyListItemModified($selectedEvent->LOCATION, $l10n->t('Updated Location:'), ++ $this->getAbsoluteImagePath('caldav/location.png'),'','',self::IMIP_INDENT); ++ } ++ ++ } +- if ($vevent->URL) { +- $url = $vevent->URL->getValue(); ++ if ($selectedEvent->URL) { ++ $url = $selectedEvent->URL->getValue(); + $template->addBodyListItem(sprintf('%s', + htmlspecialchars($url), + htmlspecialchars($url)), +@@ -565,12 +592,18 @@ + $url,'',self::IMIP_INDENT); + } + +- $this->addAttendees($template, $l10n, $vevent); ++ $this->addAttendees($template, $l10n, $selectedEvent); + + /* Put description last, like an email body, since it can be arbitrarily long */ +- if ($vevent->DESCRIPTION) { +- $template->addBodyListItem($vevent->DESCRIPTION->getValue(), $l10n->t('Description:'), +- $this->getAbsoluteImagePath('caldav/description.png'),'','',self::IMIP_INDENT); ++ if ($selectedEvent->DESCRIPTION) { ++ if(trim($selectedEvent->DESCRIPTION)==trim($parentevent->DESCRIPTION)){ ++ $template->addBodyListItem($selectedEvent->DESCRIPTION->getValue(), $l10n->t('Description:'), ++ $this->getAbsoluteImagePath('caldav/description.png'),'','',self::IMIP_INDENT); ++ }else{ ++ $template->addBodyListItemModified($selectedEvent->DESCRIPTION, $l10n->t('Updated Description:'), ++ $this->getAbsoluteImagePath('caldav/description.png'),'','',self::IMIP_INDENT); ++ } ++ + } + } + +@@ -659,7 +692,7 @@ + Message $iTipMessage, $lastOccurrence) { + $token = $this->createInvitationToken($iTipMessage, $lastOccurrence); + +- $template->addBodyButtonGroupTentative( ++ $template->addBodyButtonGroup( + $l10n->t('Accept'), + $this->urlGenerator->linkToRouteAbsolute('dav.invitation_response.accept', [ + 'token' => $token, +@@ -667,11 +700,18 @@ + $l10n->t('Decline'), + $this->urlGenerator->linkToRouteAbsolute('dav.invitation_response.decline', [ + 'token' => $token, +- ]), +- $l10n->t('Maybe'), +- $this->urlGenerator->getAbsoluteUrl('apps/calendar/invitation/tentative/'.$token) ++ ]) + ); + ++ $moreOptionsURL = $this->urlGenerator->linkToRouteAbsolute('dav.invitation_response.options', [ ++ 'token' => $token, ++ ]); ++ $html = vsprintf('%s', [ ++ $moreOptionsURL, $l10n->t('More options …') ++ ]); ++ $text = $l10n->t('More options at %s', [$moreOptionsURL]); ++ ++ $template->addBodyText($html, $text); + } + + /** +@@ -716,4 +756,4 @@ + + return $token; + } +-} ++} +\ No newline at end of file - $isAllDay = $dtstart instanceof Property\ICalendar\Date; -- GitLab From ce1329520614848c526ca806fafda5fce291e6c4 Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Thu, 7 Jul 2022 09:52:13 +0530 Subject: [PATCH 02/10] changes for email template modification on update --- patches/015-email-mail-template.patch | 3 --- 1 file changed, 3 deletions(-) diff --git a/patches/015-email-mail-template.patch b/patches/015-email-mail-template.patch index 4b6691b7..accc2d85 100644 --- a/patches/015-email-mail-template.patch +++ b/patches/015-email-mail-template.patch @@ -155,6 +155,3 @@ -} +} \ No newline at end of file - - - -- GitLab From 231bd79abcc71e74cb3f72322d6505e96704d5c8 Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Thu, 7 Jul 2022 09:57:44 +0530 Subject: [PATCH 03/10] changes for email template modification on update --- patches/015-email-mail-template.patch | 41 ++++----------------------- 1 file changed, 5 insertions(+), 36 deletions(-) diff --git a/patches/015-email-mail-template.patch b/patches/015-email-mail-template.patch index accc2d85..2fbfc462 100644 --- a/patches/015-email-mail-template.patch +++ b/patches/015-email-mail-template.patch @@ -1,4 +1,4 @@ ---- ./apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 2022-07-07 09:40:41.675627600 +0530 +--- ./apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 2022-07-07 09:56:28.335627600 +0530 +++ ./apps/dav/lib/CalDAV/Schedule/IMipPlugin-new.php 2022-07-07 09:45:48.035627600 +0530 @@ -151,15 +151,6 @@ */ @@ -41,8 +41,7 @@ + $lastmodified=$dtstampTime; + $selectedEvent = $currentevent; + } - } -- $meetingWhen = $this->generateWhenString($l10n, $vevent); ++ } + + if ($selectedEvent->SUMMARY) { + @@ -53,7 +52,8 @@ + $template->addBodyListItemModified($selectedEvent->SUMMARY, $l10n->t('Updated Title:'), + $this->getAbsoluteImagePath('caldav/title.png'),'','',self::IMIP_INDENT); + } -+ } + } +- $meetingWhen = $this->generateWhenString($l10n, $vevent); + $meetingWhen = $this->generateWhenString($l10n, $selectedEvent); if ($meetingWhen) { - $template->addBodyListItem($meetingWhen, $l10n->t('Time:'), @@ -117,38 +117,7 @@ } } -@@ -659,7 +692,7 @@ - Message $iTipMessage, $lastOccurrence) { - $token = $this->createInvitationToken($iTipMessage, $lastOccurrence); - -- $template->addBodyButtonGroupTentative( -+ $template->addBodyButtonGroup( - $l10n->t('Accept'), - $this->urlGenerator->linkToRouteAbsolute('dav.invitation_response.accept', [ - 'token' => $token, -@@ -667,11 +700,18 @@ - $l10n->t('Decline'), - $this->urlGenerator->linkToRouteAbsolute('dav.invitation_response.decline', [ - 'token' => $token, -- ]), -- $l10n->t('Maybe'), -- $this->urlGenerator->getAbsoluteUrl('apps/calendar/invitation/tentative/'.$token) -+ ]) - ); - -+ $moreOptionsURL = $this->urlGenerator->linkToRouteAbsolute('dav.invitation_response.options', [ -+ 'token' => $token, -+ ]); -+ $html = vsprintf('%s', [ -+ $moreOptionsURL, $l10n->t('More options …') -+ ]); -+ $text = $l10n->t('More options at %s', [$moreOptionsURL]); -+ -+ $template->addBodyText($html, $text); - } - - /** -@@ -716,4 +756,4 @@ +@@ -723,4 +756,4 @@ return $token; } -- GitLab From ceafde46f19a132055abe52b7bed2d0fd44396cc Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Thu, 7 Jul 2022 10:06:09 +0530 Subject: [PATCH 04/10] changes for email template modification on update --- patches/015-email-mail-template.patch | 34 +++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/patches/015-email-mail-template.patch b/patches/015-email-mail-template.patch index 2fbfc462..79ac9b29 100644 --- a/patches/015-email-mail-template.patch +++ b/patches/015-email-mail-template.patch @@ -1,3 +1,37 @@ +--- apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 2022-04-27 09:57:34.955523100 +0530 ++++ apps/dav/lib/CalDAV/Schedule/IMipPlugin_Modifiednew.php 2022-04-27 09:57:09.345523100 +0530 +@@ -659,7 +659,7 @@ + Message $iTipMessage, $lastOccurrence) { + $token = $this->createInvitationToken($iTipMessage, $lastOccurrence); + +- $template->addBodyButtonGroup( ++ $template->addBodyButtonGroupTentative( + $l10n->t('Accept'), + $this->urlGenerator->linkToRouteAbsolute('dav.invitation_response.accept', [ + 'token' => $token, +@@ -667,18 +667,11 @@ + $l10n->t('Decline'), + $this->urlGenerator->linkToRouteAbsolute('dav.invitation_response.decline', [ + 'token' => $token, +- ]) ++ ]), ++ $l10n->t('Maybe'), ++ $this->urlGenerator->getAbsoluteUrl('apps/calendar/invitation/tentative/'.$token) + ); + +- $moreOptionsURL = $this->urlGenerator->linkToRouteAbsolute('dav.invitation_response.options', [ +- 'token' => $token, +- ]); +- $html = vsprintf('%s', [ +- $moreOptionsURL, $l10n->t('More options …') +- ]); +- $text = $l10n->t('More options at %s', [$moreOptionsURL]); +- +- $template->addBodyText($html, $text); + } + + /** + --- ./apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 2022-07-07 09:56:28.335627600 +0530 +++ ./apps/dav/lib/CalDAV/Schedule/IMipPlugin-new.php 2022-07-07 09:45:48.035627600 +0530 @@ -151,15 +151,6 @@ -- GitLab From 122df994338340cd957904f39e08143a99a08904 Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Wed, 27 Jul 2022 13:47:55 +0530 Subject: [PATCH 05/10] added new messages and guest --- patches/015-email-mail-template.patch | 119 +++++++++++++++++++++++--- 1 file changed, 107 insertions(+), 12 deletions(-) diff --git a/patches/015-email-mail-template.patch b/patches/015-email-mail-template.patch index 79ac9b29..d96507b0 100644 --- a/patches/015-email-mail-template.patch +++ b/patches/015-email-mail-template.patch @@ -30,10 +30,8 @@ - $template->addBodyText($html, $text); } - /** - ---- ./apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 2022-07-07 09:56:28.335627600 +0530 -+++ ./apps/dav/lib/CalDAV/Schedule/IMipPlugin-new.php 2022-07-07 09:45:48.035627600 +0530 +--- ./apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 2022-07-27 13:21:50.294113800 +0530 ++++ ./apps/dav/lib/CalDAV/Schedule/IMipPlugin-newModified.php 2022-07-27 12:56:55.734113800 +0530 @@ -151,15 +151,6 @@ */ public function schedule(Message $iTipMessage) { @@ -50,7 +48,34 @@ $summary = $iTipMessage->message->VEVENT->SUMMARY; if (parse_url($iTipMessage->sender, PHP_URL_SCHEME) !== 'mailto') { -@@ -414,7 +405,7 @@ +@@ -252,9 +243,25 @@ + + $summary = ((string) $summary !== '') ? (string) $summary : $l10n->t('Untitled event'); + +- $this->addSubjectAndHeading($template, $l10n, $method, $summary); ++ if( count($vevent)>1){ ++ $this->addSubjectAndHeadingUpdated($template, $l10n, $method, $summary); ++ ++ }else{ ++ $this->addSubjectAndHeading($template, $l10n, $method, $summary); ++ } ++ if ($method === self::METHOD_CANCEL) { ++ $template->addHeadingBanner('#FFC2B9','#7D1000',$l10n->t('The invitation has been cancelled')); ++ } ++ if ($method !== self::METHOD_CANCEL && $method !== self::METHOD_REPLY && count($vevent)>1) { ++ $template->addHeadingBanner('#EFFFDB','#293618',$l10n->t('This recurring event has been updated, please review the information below:')); ++ } ++ $sequence = $vevent->SEQUENCE->getValue(); ++ if ($method !== self::METHOD_CANCEL && $method !== self::METHOD_REPLY && count($vevent)==1 && ($sequence > 2)) { ++ $template->addHeadingBanner('#EFFFDB','#293618',$l10n->t('This event has been updated, please review the information below:')); ++ } + $this->addBulletList($template, $l10n, $vevent); + ++ + // Only add response buttons to invitation requests: Fix Issue #11230 + if (($method == self::METHOD_REQUEST) && $this->getAttendeeRsvpOrReqForParticipant($attendee)) { + +@@ -414,7 +421,7 @@ return false; } @@ -59,7 +84,33 @@ * @param IL10N $l10n * @param VEvent $vevent */ -@@ -542,21 +533,57 @@ +@@ -535,28 +542,85 @@ + $template->addHeading($l10n->t('Invitation')); + } + } +- ++ /** ++ * @param IEMailTemplate $template ++ * @param IL10N $l10n ++ * @param string $method ++ * @param string $summary ++ */ ++ private function addSubjectAndHeadingUpdated(IEMailTemplate $template, IL10N $l10n, ++ $method, $summary) { ++ if ($method === self::METHOD_CANCEL) { ++ $template->setSubject('Canceled: ' . $summary); ++ $template->addHeading($l10n->t('Invitation canceled')); ++ } elseif ($method === self::METHOD_REPLY) { ++ $template->setSubject('Re: ' . $summary); ++ $template->addHeading($l10n->t('Invitation updated')); ++ } else { ++ $template->setSubject('Invitation: ' . $summary); ++ $template->addHeading($l10n->t('Invitation Update')); ++ } ++ } + /** + * @param IEMailTemplate $template + * @param IL10N $l10n * @param VEVENT $vevent */ private function addBulletList(IEMailTemplate $template, IL10N $l10n, $vevent) { @@ -75,7 +126,9 @@ + $lastmodified=$dtstampTime; + $selectedEvent = $currentevent; + } -+ } + } +- $meetingWhen = $this->generateWhenString($l10n, $vevent); ++ + + if ($selectedEvent->SUMMARY) { + @@ -86,8 +139,7 @@ + $template->addBodyListItemModified($selectedEvent->SUMMARY, $l10n->t('Updated Title:'), + $this->getAbsoluteImagePath('caldav/title.png'),'','',self::IMIP_INDENT); + } - } -- $meetingWhen = $this->generateWhenString($l10n, $vevent); ++ } + $meetingWhen = $this->generateWhenString($l10n, $selectedEvent); if ($meetingWhen) { - $template->addBodyListItem($meetingWhen, $l10n->t('Time:'), @@ -110,7 +162,9 @@ - if ($vevent->LOCATION) { - $template->addBodyListItem($vevent->LOCATION, $l10n->t('Location:'), - $this->getAbsoluteImagePath('caldav/location.png'),'','',self::IMIP_INDENT); ++ + if ($selectedEvent->LOCATION) { ++ + if(trim($selectedEvent->LOCATION)==trim($parentevent->LOCATION)){ + $template->addBodyListItem($selectedEvent->LOCATION, $l10n->t('Location:'), + $this->getAbsoluteImagePath('caldav/location.png'),'','',self::IMIP_INDENT); @@ -128,7 +182,7 @@ $template->addBodyListItem(sprintf('%s', htmlspecialchars($url), htmlspecialchars($url)), -@@ -565,12 +592,18 @@ +@@ -565,12 +629,28 @@ $url,'',self::IMIP_INDENT); } @@ -148,13 +202,54 @@ + $this->getAbsoluteImagePath('caldav/description.png'),'','',self::IMIP_INDENT); + } + ++ } ++ if (isset($selectedEvent->ATTENDEE)) { ++ $finalguests=''; ++ foreach ($selectedEvent->ATTENDEE as $attendee) { ++ $emailid= substr(($attendee->getValue()),7); ++ $finalguests.=$emailid.' -'.$attendee['PARTSTAT'].', '; ++ ++ } ++ $template->addBodyListItem($finalguests, $l10n->t('Guests:'), ++ $this->getAbsoluteImagePath('caldav/description.png'),'','',self::IMIP_INDENT); } } -@@ -723,4 +756,4 @@ +@@ -659,7 +739,7 @@ + Message $iTipMessage, $lastOccurrence) { + $token = $this->createInvitationToken($iTipMessage, $lastOccurrence); + +- $template->addBodyButtonGroupTentative( ++ $template->addBodyButtonGroup( + $l10n->t('Accept'), + $this->urlGenerator->linkToRouteAbsolute('dav.invitation_response.accept', [ + 'token' => $token, +@@ -667,11 +747,18 @@ + $l10n->t('Decline'), + $this->urlGenerator->linkToRouteAbsolute('dav.invitation_response.decline', [ + 'token' => $token, +- ]), +- $l10n->t('Maybe'), +- $this->urlGenerator->getAbsoluteUrl('apps/calendar/invitation/tentative/'.$token) ++ ]) + ); + ++ $moreOptionsURL = $this->urlGenerator->linkToRouteAbsolute('dav.invitation_response.options', [ ++ 'token' => $token, ++ ]); ++ $html = vsprintf('%s', [ ++ $moreOptionsURL, $l10n->t('More options …') ++ ]); ++ $text = $l10n->t('More options at %s', [$moreOptionsURL]); ++ ++ $template->addBodyText($html, $text); + } + + /** +@@ -716,4 +803,4 @@ return $token; } -} +} -\ No newline at end of file +\ No newline at end of file \ No newline at end of file -- GitLab From c7fd16c40b76c861011343e4921b0af95684f3a3 Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Wed, 27 Jul 2022 13:54:02 +0530 Subject: [PATCH 06/10] added new messages and guest --- patches/015-email-mail-template.patch | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/patches/015-email-mail-template.patch b/patches/015-email-mail-template.patch index d96507b0..7185a93c 100644 --- a/patches/015-email-mail-template.patch +++ b/patches/015-email-mail-template.patch @@ -30,8 +30,10 @@ - $template->addBodyText($html, $text); } + /** + --- ./apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 2022-07-27 13:21:50.294113800 +0530 -+++ ./apps/dav/lib/CalDAV/Schedule/IMipPlugin-newModified.php 2022-07-27 12:56:55.734113800 +0530 ++++ ./apps/dav/lib/CalDAV/Schedule/IMipPlugin-newModified.php 2022-07-27 13:52:13.154113800 +0530 @@ -151,15 +151,6 @@ */ public function schedule(Message $iTipMessage) { @@ -252,4 +254,4 @@ } -} +} -\ No newline at end of file \ No newline at end of file +\ No newline at end of file -- GitLab From 96b8c3988697ba84edd9c4e049e6a233f0194381 Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Thu, 28 Jul 2022 11:47:30 +0530 Subject: [PATCH 07/10] added guest --- patches/015-email-mail-template.patch | 35 +++++---------------------- 1 file changed, 6 insertions(+), 29 deletions(-) diff --git a/patches/015-email-mail-template.patch b/patches/015-email-mail-template.patch index 7185a93c..5b2b5df1 100644 --- a/patches/015-email-mail-template.patch +++ b/patches/015-email-mail-template.patch @@ -33,7 +33,7 @@ /** --- ./apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 2022-07-27 13:21:50.294113800 +0530 -+++ ./apps/dav/lib/CalDAV/Schedule/IMipPlugin-newModified.php 2022-07-27 13:52:13.154113800 +0530 ++++ ./apps/dav/lib/CalDAV/Schedule/IMipPlugin-newModified.php 2022-07-28 11:43:03.254435200 +0530 @@ -151,15 +151,6 @@ */ public function schedule(Message $iTipMessage) { @@ -217,38 +217,15 @@ } } -@@ -659,7 +739,7 @@ - Message $iTipMessage, $lastOccurrence) { - $token = $this->createInvitationToken($iTipMessage, $lastOccurrence); - -- $template->addBodyButtonGroupTentative( -+ $template->addBodyButtonGroup( - $l10n->t('Accept'), - $this->urlGenerator->linkToRouteAbsolute('dav.invitation_response.accept', [ - 'token' => $token, -@@ -667,11 +747,18 @@ - $l10n->t('Decline'), - $this->urlGenerator->linkToRouteAbsolute('dav.invitation_response.decline', [ - 'token' => $token, -- ]), -- $l10n->t('Maybe'), -- $this->urlGenerator->getAbsoluteUrl('apps/calendar/invitation/tentative/'.$token) -+ ]) +@@ -671,7 +751,6 @@ + $l10n->t('Maybe'), + $this->urlGenerator->getAbsoluteUrl('apps/calendar/invitation/tentative/'.$token) ); - -+ $moreOptionsURL = $this->urlGenerator->linkToRouteAbsolute('dav.invitation_response.options', [ -+ 'token' => $token, -+ ]); -+ $html = vsprintf('%s', [ -+ $moreOptionsURL, $l10n->t('More options …') -+ ]); -+ $text = $l10n->t('More options at %s', [$moreOptionsURL]); -+ -+ $template->addBodyText($html, $text); +- } /** -@@ -716,4 +803,4 @@ +@@ -716,4 +795,4 @@ return $token; } -- GitLab From 977e549f7c6ab2d952f55723c3ae104ae951502b Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Mon, 8 Aug 2022 18:05:12 +0530 Subject: [PATCH 08/10] email template mod --- patches/015-email-mail-template.patch | 28 +++++++++------------------ 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/patches/015-email-mail-template.patch b/patches/015-email-mail-template.patch index 5b2b5df1..bbc0a5f3 100644 --- a/patches/015-email-mail-template.patch +++ b/patches/015-email-mail-template.patch @@ -32,8 +32,8 @@ /** ---- ./apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 2022-07-27 13:21:50.294113800 +0530 -+++ ./apps/dav/lib/CalDAV/Schedule/IMipPlugin-newModified.php 2022-07-28 11:43:03.254435200 +0530 +--- ./apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 2022-08-08 17:59:57.632858800 +0530 ++++ ./apps/dav/lib/CalDAV/Schedule/IMipPlugin-new.php 2022-08-08 17:21:58.792858800 +0530 @@ -151,15 +151,6 @@ */ public function schedule(Message $iTipMessage) { @@ -128,8 +128,7 @@ + $lastmodified=$dtstampTime; + $selectedEvent = $currentevent; + } - } -- $meetingWhen = $this->generateWhenString($l10n, $vevent); ++ } + + + if ($selectedEvent->SUMMARY) { @@ -141,7 +140,8 @@ + $template->addBodyListItemModified($selectedEvent->SUMMARY, $l10n->t('Updated Title:'), + $this->getAbsoluteImagePath('caldav/title.png'),'','',self::IMIP_INDENT); + } -+ } + } +- $meetingWhen = $this->generateWhenString($l10n, $vevent); + $meetingWhen = $this->generateWhenString($l10n, $selectedEvent); if ($meetingWhen) { - $template->addBodyListItem($meetingWhen, $l10n->t('Time:'), @@ -184,7 +184,7 @@ $template->addBodyListItem(sprintf('%s', htmlspecialchars($url), htmlspecialchars($url)), -@@ -565,12 +629,28 @@ +@@ -565,12 +629,18 @@ $url,'',self::IMIP_INDENT); } @@ -204,20 +204,10 @@ + $this->getAbsoluteImagePath('caldav/description.png'),'','',self::IMIP_INDENT); + } + -+ } -+ if (isset($selectedEvent->ATTENDEE)) { -+ $finalguests=''; -+ foreach ($selectedEvent->ATTENDEE as $attendee) { -+ $emailid= substr(($attendee->getValue()),7); -+ $finalguests.=$emailid.' -'.$attendee['PARTSTAT'].', '; -+ -+ } -+ $template->addBodyListItem($finalguests, $l10n->t('Guests:'), -+ $this->getAbsoluteImagePath('caldav/description.png'),'','',self::IMIP_INDENT); } } -@@ -671,7 +751,6 @@ +@@ -671,7 +741,6 @@ $l10n->t('Maybe'), $this->urlGenerator->getAbsoluteUrl('apps/calendar/invitation/tentative/'.$token) ); @@ -225,10 +215,10 @@ } /** -@@ -716,4 +795,4 @@ +@@ -716,4 +785,4 @@ return $token; } -} +} -\ No newline at end of file +\ No newline at end of file \ No newline at end of file -- GitLab From 09353cb52e274012e12195e05997b0d5d98fcf3a Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Tue, 9 Aug 2022 11:12:03 +0530 Subject: [PATCH 09/10] version bump --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 5581b82e..0aedb16a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,7 +17,7 @@ ARG ECLOUD_LAUNCHER_JOB_ID="345049" ARG GOOGLE_INTEGRATION_VERSION="1.0.6" ARG LDAP_WRITE_SUPPORT_VERSION="1.4.0" -RUN sed -i 's/22,2,9,1/22,2,9,2/' ${BASE_DIR}/version.php +RUN sed -i 's/22,2,9,1/22,2,9,3/' ${BASE_DIR}/version.php COPY custom_entrypoint.sh / RUN chmod +x /custom_entrypoint.sh RUN mkdir -p /var/www/skeleton/Documents && mkdir -p /var/www/skeleton/Images -- GitLab From 14cfb41b6d5c9064bdfa5dcbaf5f93fc06087558 Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Thu, 18 Aug 2022 19:49:14 +0530 Subject: [PATCH 10/10] translation fix --- patches/015-email-mail-template.patch | 41 +++++++++++++++++++-------- 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/patches/015-email-mail-template.patch b/patches/015-email-mail-template.patch index bbc0a5f3..71c708d8 100644 --- a/patches/015-email-mail-template.patch +++ b/patches/015-email-mail-template.patch @@ -32,8 +32,8 @@ /** ---- ./apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 2022-08-08 17:59:57.632858800 +0530 -+++ ./apps/dav/lib/CalDAV/Schedule/IMipPlugin-new.php 2022-08-08 17:21:58.792858800 +0530 +--- apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 2022-07-27 13:21:50.294113800 +0530 ++++ apps/dav/lib/CalDAV/Schedule/IMipPlugin-New.php 2022-08-16 16:29:16.531866700 +0530 @@ -151,15 +151,6 @@ */ public function schedule(Message $iTipMessage) { @@ -86,7 +86,23 @@ * @param IL10N $l10n * @param VEvent $vevent */ -@@ -535,28 +542,85 @@ +@@ -525,38 +532,99 @@ + private function addSubjectAndHeading(IEMailTemplate $template, IL10N $l10n, + $method, $summary) { + if ($method === self::METHOD_CANCEL) { +- $template->setSubject('Canceled: ' . $summary); ++ //TRANSLATORS Subject for email, when an invitation is cancelled. Ex: "Cancelled: {{Event Name}}" ++ $template->setSubject($l10n->t('Cancelled: %1$s', [$summary])); + $template->addHeading($l10n->t('Invitation canceled')); + } elseif ($method === self::METHOD_REPLY) { +- $template->setSubject('Re: ' . $summary); ++ // TRANSLATORS Subject for email, when an invitation is updated. Ex: "Re: {{Event Name}}" ++ $template->setSubject($l10n->t('Re: %1$s', [$summary])); + $template->addHeading($l10n->t('Invitation updated')); + } else { +- $template->setSubject('Invitation: ' . $summary); ++ // TRANSLATORS Subject for email, when an invitation is sent. Ex: "Invitation: {{Event Name}}" ++ $template->setSubject($l10n->t('Invitation: %1$s', [$summary])); $template->addHeading($l10n->t('Invitation')); } } @@ -100,13 +116,16 @@ + private function addSubjectAndHeadingUpdated(IEMailTemplate $template, IL10N $l10n, + $method, $summary) { + if ($method === self::METHOD_CANCEL) { -+ $template->setSubject('Canceled: ' . $summary); ++ //TRANSLATORS Subject for email, when an invitation is cancelled. Ex: "Cancelled: {{Event Name}}" ++ $template->setSubject($l10n->t('Cancelled: %1$s', [$summary])); + $template->addHeading($l10n->t('Invitation canceled')); + } elseif ($method === self::METHOD_REPLY) { -+ $template->setSubject('Re: ' . $summary); ++ // TRANSLATORS Subject for email, when an invitation is updated. Ex: "Re: {{Event Name}}" ++ $template->setSubject($l10n->t('Re: %1$s', [$summary])); + $template->addHeading($l10n->t('Invitation updated')); + } else { -+ $template->setSubject('Invitation: ' . $summary); ++ // TRANSLATORS Subject for email, when an invitation is sent. Ex: "Invitation: {{Event Name}}" ++ $template->setSubject($l10n->t('Invitation: %1$s', [$summary])); + $template->addHeading($l10n->t('Invitation Update')); + } + } @@ -164,9 +183,7 @@ - if ($vevent->LOCATION) { - $template->addBodyListItem($vevent->LOCATION, $l10n->t('Location:'), - $this->getAbsoluteImagePath('caldav/location.png'),'','',self::IMIP_INDENT); -+ + if ($selectedEvent->LOCATION) { -+ + if(trim($selectedEvent->LOCATION)==trim($parentevent->LOCATION)){ + $template->addBodyListItem($selectedEvent->LOCATION, $l10n->t('Location:'), + $this->getAbsoluteImagePath('caldav/location.png'),'','',self::IMIP_INDENT); @@ -184,7 +201,7 @@ $template->addBodyListItem(sprintf('%s', htmlspecialchars($url), htmlspecialchars($url)), -@@ -565,12 +629,18 @@ +@@ -565,12 +633,18 @@ $url,'',self::IMIP_INDENT); } @@ -207,7 +224,7 @@ } } -@@ -671,7 +741,6 @@ +@@ -671,7 +745,6 @@ $l10n->t('Maybe'), $this->urlGenerator->getAbsoluteUrl('apps/calendar/invitation/tentative/'.$token) ); @@ -215,10 +232,10 @@ } /** -@@ -716,4 +785,4 @@ +@@ -716,4 +789,4 @@ return $token; } -} +} -\ No newline at end of file \ No newline at end of file +\ No newline at end of file -- GitLab