From d587bfd4869178afaf558ba92d3d7efc79cad624 Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Wed, 26 Oct 2022 13:55:17 +0530 Subject: [PATCH 1/7] video icon in email --- Dockerfile | 2 +- patches/015-email-mail-template.patch | 76 +++++++++++++++------------ 2 files changed, 44 insertions(+), 34 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9f614454..4a543694 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,7 @@ ARG GOOGLE_INTEGRATION_VERSION="1.0.8" ARG LDAP_WRITE_SUPPORT_VERSION="1.4.0" ARG OIDC_LOGIN_VERSION="2.3.3" -RUN sed -i 's/23,0,9,1/23,0,9,15/' ${BASE_DIR}/version.php +RUN sed -i 's/23,0,9,1/23,0,9,17/' ${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 diff --git a/patches/015-email-mail-template.patch b/patches/015-email-mail-template.patch index 12109ab9..4b0255b2 100644 --- a/patches/015-email-mail-template.patch +++ b/patches/015-email-mail-template.patch @@ -1,9 +1,9 @@ ---- apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 2022-09-06 17:56:20.875827300 +0530 -+++ apps/dav/lib/CalDAV/Schedule/IMipPlugin-new23.php 2022-09-06 17:13:51.925827300 +0530 +--- ./apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 2022-10-26 11:45:19.589156800 +0530 ++++ ./apps/dav/lib/CalDAV/Schedule/iMipPluginNew.php 2022-10-26 13:53:03.959156800 +0530 @@ -151,15 +151,6 @@ */ public function schedule(Message $iTipMessage) { - + - // Not sending any emails if the system considers the update - // insignificant. - if (!$iTipMessage->significantChange) { @@ -14,16 +14,15 @@ - } - $summary = $iTipMessage->message->VEVENT->SUMMARY; - + if (parse_url($iTipMessage->sender, PHP_URL_SCHEME) !== 'mailto') { -@@ -252,7 +243,22 @@ - +@@ -252,7 +243,21 @@ + $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); + } @@ -38,9 +37,17 @@ + $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 -@@ -542,24 +548,84 @@ +@@ -516,6 +521,7 @@ + return $dtStart->format('Y-m-d') === $dtEnd->format('Y-m-d'); + } + ++ + /** + * @param IEMailTemplate $template + * @param IL10N $l10n +@@ -542,24 +548,86 @@ /** * @param IEMailTemplate $template * @param IL10N $l10n @@ -83,10 +90,7 @@ + $selectedEvent = $currentevent; + } + } -+ -+ + 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); @@ -100,11 +104,14 @@ if ($meetingWhen) { - $template->addBodyListItem($meetingWhen, $l10n->t('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); + $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); @@ -112,22 +119,25 @@ + $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:'), ++ if (filter_var(trim($selectedEvent->LOCATION), FILTER_VALIDATE_URL) === TRUE) { ++ $template->addBodyListItem($selectedEvent->LOCATION, $l10n->t('Location:'), ++ $this->getAbsoluteImagePath('caldav/videocall.png'),'','',self::IMIP_INDENT); ++ }else{ ++ $template->addBodyListItem($selectedEvent->LOCATION, $l10n->t('Location:'), + $this->getAbsoluteImagePath('caldav/location.png'),'','',self::IMIP_INDENT); ++ } + }else{ -+ $template->addBodyListItemModified($selectedEvent->LOCATION, $l10n->t('Updated Location:'), ++ if (filter_var(trim($selectedEvent->LOCATION), FILTER_VALIDATE_URL) === TRUE) { ++ $template->addBodyListItemModified($selectedEvent->LOCATION, $l10n->t('Updated Location:'), ++ $this->getAbsoluteImagePath('caldav/videocall.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(); @@ -136,13 +146,14 @@ $template->addBodyListItem(sprintf('%s', htmlspecialchars($url), htmlspecialchars($url)), -@@ -568,12 +634,18 @@ +@@ -567,13 +635,16 @@ + $this->getAbsoluteImagePath('caldav/link.png'), $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:'), @@ -155,20 +166,19 @@ + $template->addBodyListItemModified($selectedEvent->DESCRIPTION, $l10n->t('Updated Description:'), + $this->getAbsoluteImagePath('caldav/description.png'),'','',self::IMIP_INDENT); + } -+ } } - -@@ -662,7 +734,7 @@ + +@@ -662,7 +733,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, -@@ -670,18 +742,10 @@ +@@ -670,18 +741,10 @@ $l10n->t('Decline'), $this->urlGenerator->linkToRouteAbsolute('dav.invitation_response.decline', [ 'token' => $token, @@ -188,5 +198,5 @@ - - $template->addBodyText($html, $text); } - + /** -- GitLab From 48e937828d103bbd5d8436c512371fc8e299d02e Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Wed, 26 Oct 2022 14:01:16 +0530 Subject: [PATCH 2/7] calendar job updated --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 4a543694..b2bc9233 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ ARG NEWS_VERSION="18.1.1" ARG QUOTA_WARN_VERSION="1.14.0" ARG NOTES_VERSION="4.5.1" ARG CONTACTS_JOB_ID="400045" -ARG CALENDAR_JOB_ID="398394" +ARG CALENDAR_JOB_ID="414814" ARG USER_BACKEND_RAW_SQL_VERSION="1.3.0" ARG EMAIL_RECOVERY_JOB_ID="389385" ARG RAINLOOP_VERSION="7.2.5" -- GitLab From 600f3ddcc6ac1c5d446286061884dda5da4e9d6f Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Wed, 26 Oct 2022 14:11:13 +0530 Subject: [PATCH 3/7] calendar job updated --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index b2bc9233..930e29f5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ ARG NEWS_VERSION="18.1.1" ARG QUOTA_WARN_VERSION="1.14.0" ARG NOTES_VERSION="4.5.1" ARG CONTACTS_JOB_ID="400045" -ARG CALENDAR_JOB_ID="414814" +ARG CALENDAR_JOB_ID="414851" ARG USER_BACKEND_RAW_SQL_VERSION="1.3.0" ARG EMAIL_RECOVERY_JOB_ID="389385" ARG RAINLOOP_VERSION="7.2.5" -- GitLab From dd050a61346028ec2a60086bb14e74eed3896dca Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Wed, 26 Oct 2022 14:21:54 +0530 Subject: [PATCH 4/7] video icon in email --- patches/015-email-mail-template.patch | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/patches/015-email-mail-template.patch b/patches/015-email-mail-template.patch index 4b0255b2..d88ea884 100644 --- a/patches/015-email-mail-template.patch +++ b/patches/015-email-mail-template.patch @@ -3,7 +3,7 @@ @@ -151,15 +151,6 @@ */ public function schedule(Message $iTipMessage) { - + - // Not sending any emails if the system considers the update - // insignificant. - if (!$iTipMessage->significantChange) { @@ -14,12 +14,12 @@ - } - $summary = $iTipMessage->message->VEVENT->SUMMARY; - + if (parse_url($iTipMessage->sender, PHP_URL_SCHEME) !== 'mailto') { @@ -252,7 +243,21 @@ - + $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); @@ -37,12 +37,12 @@ + $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 @@ -516,6 +521,7 @@ return $dtStart->format('Y-m-d') === $dtEnd->format('Y-m-d'); } - + + /** * @param IEMailTemplate $template @@ -122,7 +122,7 @@ + } + if ($selectedEvent->LOCATION) { + if(trim($selectedEvent->LOCATION)==trim($parentevent->LOCATION)){ -+ if (filter_var(trim($selectedEvent->LOCATION), FILTER_VALIDATE_URL) === TRUE) { ++ if (filter_var(trim($selectedEvent->LOCATION), FILTER_VALIDATE_URL)) { + $template->addBodyListItem($selectedEvent->LOCATION, $l10n->t('Location:'), + $this->getAbsoluteImagePath('caldav/videocall.png'),'','',self::IMIP_INDENT); + }else{ @@ -130,7 +130,7 @@ + $this->getAbsoluteImagePath('caldav/location.png'),'','',self::IMIP_INDENT); + } + }else{ -+ if (filter_var(trim($selectedEvent->LOCATION), FILTER_VALIDATE_URL) === TRUE) { ++ if (filter_var(trim($selectedEvent->LOCATION), FILTER_VALIDATE_URL)) { + $template->addBodyListItemModified($selectedEvent->LOCATION, $l10n->t('Updated Location:'), + $this->getAbsoluteImagePath('caldav/videocall.png'),'','',self::IMIP_INDENT); + }else{ @@ -168,11 +168,11 @@ + } } } - + @@ -662,7 +733,7 @@ Message $iTipMessage, $lastOccurrence) { $token = $this->createInvitationToken($iTipMessage, $lastOccurrence); - + - $template->addBodyButtonGroup( + $template->addBodyButtonGroupTentative( $l10n->t('Accept'), @@ -198,5 +198,5 @@ - - $template->addBodyText($html, $text); } - + /** -- GitLab From 6b873babcd48d1f94b69ef0aeccef0c3a0b055ed Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Wed, 26 Oct 2022 14:26:30 +0530 Subject: [PATCH 5/7] version bump --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 930e29f5..cf073cbc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,7 @@ ARG GOOGLE_INTEGRATION_VERSION="1.0.8" ARG LDAP_WRITE_SUPPORT_VERSION="1.4.0" ARG OIDC_LOGIN_VERSION="2.3.3" -RUN sed -i 's/23,0,9,1/23,0,9,17/' ${BASE_DIR}/version.php +RUN sed -i 's/23,0,9,1/23,0,9,18/' ${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 c530b2a1128e70d8a22d43032e06c0daff1769b5 Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Wed, 26 Oct 2022 15:33:17 +0530 Subject: [PATCH 6/7] code styling --- patches/015-email-mail-template.patch | 57 +++++++++++++-------------- 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/patches/015-email-mail-template.patch b/patches/015-email-mail-template.patch index d88ea884..f654c784 100644 --- a/patches/015-email-mail-template.patch +++ b/patches/015-email-mail-template.patch @@ -1,9 +1,9 @@ --- ./apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 2022-10-26 11:45:19.589156800 +0530 -+++ ./apps/dav/lib/CalDAV/Schedule/iMipPluginNew.php 2022-10-26 13:53:03.959156800 +0530 ++++ ./apps/dav/lib/CalDAV/Schedule/iMipPluginNew.php 2022-10-26 15:28:50.269156800 +0530 @@ -151,15 +151,6 @@ */ public function schedule(Message $iTipMessage) { - + - // Not sending any emails if the system considers the update - // insignificant. - if (!$iTipMessage->significantChange) { @@ -14,16 +14,16 @@ - } - $summary = $iTipMessage->message->VEVENT->SUMMARY; - + if (parse_url($iTipMessage->sender, PHP_URL_SCHEME) !== 'mailto') { @@ -252,7 +243,21 @@ - + $summary = ((string) $summary !== '') ? (string) $summary : $l10n->t('Untitled event'); - + - $this->addSubjectAndHeading($template, $l10n, $method, $summary); -+ if( count($vevent)>1){ ++ if ( count($vevent)>1) { + $this->addSubjectAndHeadingUpdated($template, $l10n, $method, $summary); -+ }else{ ++ } else { + $this->addSubjectAndHeading($template, $l10n, $method, $summary); + } + if ($method === self::METHOD_CANCEL) { @@ -37,12 +37,12 @@ + $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 @@ -516,6 +521,7 @@ return $dtStart->format('Y-m-d') === $dtEnd->format('Y-m-d'); } - + + /** * @param IEMailTemplate $template @@ -82,19 +82,19 @@ - $this->getAbsoluteImagePath('caldav/title.png'),'','',self::IMIP_INDENT); + $lastmodified=0; + $selectedEvent = $parentevent = $vevent; -+ foreach( $vevent as $currentevent){ ++ foreach( $vevent as $currentevent) { + $dtstamp= $currentevent->{'LAST-MODIFIED'}; + $dtstampTime = strtotime($dtstamp); -+ if($dtstampTime>$lastmodified){ ++ if ($dtstampTime>$lastmodified) { + $lastmodified=$dtstampTime; + $selectedEvent = $currentevent; + } + } + if ($selectedEvent->SUMMARY) { -+ if(trim($selectedEvent->SUMMARY)==trim($parentevent->SUMMARY)){ ++ if (trim($selectedEvent->SUMMARY) == trim($parentevent->SUMMARY)) { + $template->addBodyListItem($selectedEvent->SUMMARY, $l10n->t('Title:'), + $this->getAbsoluteImagePath('caldav/title.png'),'','',self::IMIP_INDENT); -+ }else{ ++ } else { + $template->addBodyListItemModified($selectedEvent->SUMMARY, $l10n->t('Updated Title:'), + $this->getAbsoluteImagePath('caldav/title.png'),'','',self::IMIP_INDENT); + } @@ -104,36 +104,35 @@ if ($meetingWhen) { - $template->addBodyListItem($meetingWhen, $l10n->t('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); + $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)){ ++ if (trim($selectedtimestart)==trim($parenttimestart) && trim($selectedtimeend)==trim($parenttimeend)) { + $template->addBodyListItem($meetingWhen, $l10n->t('Time:'), + $this->getAbsoluteImagePath('caldav/time.png'),'','',self::IMIP_INDENT); -+ }else{ ++ } 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)){ ++ if (trim($selectedEvent->LOCATION) == trim($parentevent->LOCATION)) { + if (filter_var(trim($selectedEvent->LOCATION), FILTER_VALIDATE_URL)) { + $template->addBodyListItem($selectedEvent->LOCATION, $l10n->t('Location:'), + $this->getAbsoluteImagePath('caldav/videocall.png'),'','',self::IMIP_INDENT); -+ }else{ ++ } else { + $template->addBodyListItem($selectedEvent->LOCATION, $l10n->t('Location:'), + $this->getAbsoluteImagePath('caldav/location.png'),'','',self::IMIP_INDENT); + } -+ }else{ ++ } else { + if (filter_var(trim($selectedEvent->LOCATION), FILTER_VALIDATE_URL)) { + $template->addBodyListItemModified($selectedEvent->LOCATION, $l10n->t('Updated Location:'), + $this->getAbsoluteImagePath('caldav/videocall.png'),'','',self::IMIP_INDENT); -+ }else{ ++ } else { + $template->addBodyListItemModified($selectedEvent->LOCATION, $l10n->t('Updated Location:'), + $this->getAbsoluteImagePath('caldav/location.png'),'','',self::IMIP_INDENT); + } @@ -159,20 +158,20 @@ - $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)){ ++ if (trim($selectedEvent->DESCRIPTION)==trim($parentevent->DESCRIPTION)) { + $template->addBodyListItem($selectedEvent->DESCRIPTION->getValue(), $l10n->t('Description:'), + $this->getAbsoluteImagePath('caldav/description.png'),'','',self::IMIP_INDENT); -+ }else{ ++ } else { + $template->addBodyListItemModified($selectedEvent->DESCRIPTION, $l10n->t('Updated Description:'), + $this->getAbsoluteImagePath('caldav/description.png'),'','',self::IMIP_INDENT); + } } } - + @@ -662,7 +733,7 @@ Message $iTipMessage, $lastOccurrence) { $token = $this->createInvitationToken($iTipMessage, $lastOccurrence); - + - $template->addBodyButtonGroup( + $template->addBodyButtonGroupTentative( $l10n->t('Accept'), @@ -198,5 +197,5 @@ - - $template->addBodyText($html, $text); } - + /** -- GitLab From 05915f42c3de42a5041ca2748c63ad7ae651f8d4 Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Wed, 26 Oct 2022 15:35:48 +0530 Subject: [PATCH 7/7] version bump --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index cf073cbc..d6abb495 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,7 @@ ARG GOOGLE_INTEGRATION_VERSION="1.0.8" ARG LDAP_WRITE_SUPPORT_VERSION="1.4.0" ARG OIDC_LOGIN_VERSION="2.3.3" -RUN sed -i 's/23,0,9,1/23,0,9,18/' ${BASE_DIR}/version.php +RUN sed -i 's/23,0,9,1/23,0,9,19/' ${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