From 354f1615394d9624ed373d431bc6291557fd98de Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Thu, 30 Jun 2022 12:30:14 +0530 Subject: [PATCH 1/9] recurring event fix --- patches/015-email-mail-template.patch | 58 +++++++++++++++++++++++++-- 1 file changed, 55 insertions(+), 3 deletions(-) diff --git a/patches/015-email-mail-template.patch b/patches/015-email-mail-template.patch index 9b88a215..ed7b2722 100644 --- a/patches/015-email-mail-template.patch +++ b/patches/015-email-mail-template.patch @@ -3,7 +3,7 @@ @@ -659,7 +659,7 @@ Message $iTipMessage, $lastOccurrence) { $token = $this->createInvitationToken($iTipMessage, $lastOccurrence); - + - $template->addBodyButtonGroup( + $template->addBodyButtonGroupTentative( $l10n->t('Accept'), @@ -18,7 +18,7 @@ + $l10n->t('Maybe'), + $this->urlGenerator->getAbsoluteUrl('apps/calendar/invitation/tentative/'.$token) ); - + - $moreOptionsURL = $this->urlGenerator->linkToRouteAbsolute('dav.invitation_response.options', [ - 'token' => $token, - ]); @@ -29,5 +29,57 @@ - - $template->addBodyText($html, $text); } - + /** + + +--- ./apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 2022-06-30 10:22:42.346419100 +0530 ++++ ./apps/dav/lib/CalDAV/Schedule/IMipPlugin-new.php 2022-06-30 10:23:55.506419100 +0530 +@@ -419,23 +419,34 @@ + * @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; ++ $lastmodified=0; ++ foreach( $vevent as $vevent1){ ++ $dtstamp= $vevent1->{'LAST-MODIFIED'}; ++ $dtstampTime = strtotime($dtstamp); ++ if($dtstampTime>$lastmodified){ ++ $lastmodified=$dtstampTime; ++ $dtStartFinal= $vevent1->DTSTART; ++ $dtEndtFinal= $vevent1->DTEND; ++ $durationFinal= $vevent1->DURATION; ++ } ++ } ++ $dtstart = $dtStartFinal; ++ if (isset($dtEndtFinal)) { ++ $dtend = $dtEndtFinal; ++ } elseif (isset($durationFinal)) { ++ $isFloating = $dtStartFinal->isFloating(); ++ $dtend = clone $dtStartFinal; + $endDateTime = $dtend->getDateTime(); +- $endDateTime = $endDateTime->add(DateTimeParser::parse($vevent->DURATION->getValue())); ++ $endDateTime = $endDateTime->add(DateTimeParser::parse($durationFinal->getValue())); + $dtend->setDateTime($endDateTime, $isFloating); +- } elseif (!$vevent->DTSTART->hasTime()) { +- $isFloating = $vevent->DTSTART->isFloating(); +- $dtend = clone $vevent->DTSTART; ++ } elseif (!$dtStartFinal->hasTime()) { ++ $isFloating = $dtStartFinal->isFloating(); ++ $dtend = clone $dtStartFinal; + $endDateTime = $dtend->getDateTime(); + $endDateTime = $endDateTime->modify('+1 day'); + $dtend->setDateTime($endDateTime, $isFloating); + } else { +- $dtend = clone $vevent->DTSTART; ++ $dtend = clone $dtStartFinal; + } + + $isAllDay = $dtstart instanceof Property\ICalendar\Date; + + -- GitLab From 1d3233fe1e6d1e901f81c2a7ec3dc6ca563bea5e Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Thu, 30 Jun 2022 12:59:15 +0530 Subject: [PATCH 2/9] recurring event fix --- Dockerfile | 2 +- patches/015-email-mail-template.patch | 52 --------------------------- 2 files changed, 1 insertion(+), 53 deletions(-) diff --git a/Dockerfile b/Dockerfile index 67742499..34bceab8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,7 +17,7 @@ ARG ECLOUD_LAUNCHER_JOB_ID="318040" ARG GOOGLE_INTEGRATION_VERSION="1.0.6" ARG LDAP_WRITE_SUPPORT_VERSION="1.4.0" -RUN sed -i 's/22,2,8,1/22,2,8,20/' ${BASE_DIR}/version.php +RUN sed -i 's/22,2,8,1/22,2,8,21/' ${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 ed7b2722..fc5eb71c 100644 --- a/patches/015-email-mail-template.patch +++ b/patches/015-email-mail-template.patch @@ -31,55 +31,3 @@ } /** - - ---- ./apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 2022-06-30 10:22:42.346419100 +0530 -+++ ./apps/dav/lib/CalDAV/Schedule/IMipPlugin-new.php 2022-06-30 10:23:55.506419100 +0530 -@@ -419,23 +419,34 @@ - * @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; -+ $lastmodified=0; -+ foreach( $vevent as $vevent1){ -+ $dtstamp= $vevent1->{'LAST-MODIFIED'}; -+ $dtstampTime = strtotime($dtstamp); -+ if($dtstampTime>$lastmodified){ -+ $lastmodified=$dtstampTime; -+ $dtStartFinal= $vevent1->DTSTART; -+ $dtEndtFinal= $vevent1->DTEND; -+ $durationFinal= $vevent1->DURATION; -+ } -+ } -+ $dtstart = $dtStartFinal; -+ if (isset($dtEndtFinal)) { -+ $dtend = $dtEndtFinal; -+ } elseif (isset($durationFinal)) { -+ $isFloating = $dtStartFinal->isFloating(); -+ $dtend = clone $dtStartFinal; - $endDateTime = $dtend->getDateTime(); -- $endDateTime = $endDateTime->add(DateTimeParser::parse($vevent->DURATION->getValue())); -+ $endDateTime = $endDateTime->add(DateTimeParser::parse($durationFinal->getValue())); - $dtend->setDateTime($endDateTime, $isFloating); -- } elseif (!$vevent->DTSTART->hasTime()) { -- $isFloating = $vevent->DTSTART->isFloating(); -- $dtend = clone $vevent->DTSTART; -+ } elseif (!$dtStartFinal->hasTime()) { -+ $isFloating = $dtStartFinal->isFloating(); -+ $dtend = clone $dtStartFinal; - $endDateTime = $dtend->getDateTime(); - $endDateTime = $endDateTime->modify('+1 day'); - $dtend->setDateTime($endDateTime, $isFloating); - } else { -- $dtend = clone $vevent->DTSTART; -+ $dtend = clone $dtStartFinal; - } - - $isAllDay = $dtstart instanceof Property\ICalendar\Date; - - -- GitLab From 2d19313fc10c0343651b24393d815862fdf0f5ae Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Thu, 30 Jun 2022 14:29:43 +0530 Subject: [PATCH 3/9] recurring event fix --- patches/015-email-mail-template.patch | 50 +++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/patches/015-email-mail-template.patch b/patches/015-email-mail-template.patch index fc5eb71c..47f992d6 100644 --- a/patches/015-email-mail-template.patch +++ b/patches/015-email-mail-template.patch @@ -31,3 +31,53 @@ } /** + +--- ./apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 2022-06-30 10:22:42.346419100 +0530 ++++ ./apps/dav/lib/CalDAV/Schedule/IMipPlugin-new.php 2022-06-30 10:23:55.506419100 +0530 +@@ -419,23 +419,34 @@ + * @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; ++ $lastmodified=0; ++ foreach( $vevent as $vevent1){ ++ $dtstamp= $vevent1->{'LAST-MODIFIED'}; ++ $dtstampTime = strtotime($dtstamp); ++ if($dtstampTime>$lastmodified){ ++ $lastmodified=$dtstampTime; ++ $dtStartFinal= $vevent1->DTSTART; ++ $dtEndtFinal= $vevent1->DTEND; ++ $durationFinal= $vevent1->DURATION; ++ } ++ } ++ $dtstart = $dtStartFinal; ++ if (isset($dtEndtFinal)) { ++ $dtend = $dtEndtFinal; ++ } elseif (isset($durationFinal)) { ++ $isFloating = $dtStartFinal->isFloating(); ++ $dtend = clone $dtStartFinal; + $endDateTime = $dtend->getDateTime(); +- $endDateTime = $endDateTime->add(DateTimeParser::parse($vevent->DURATION->getValue())); ++ $endDateTime = $endDateTime->add(DateTimeParser::parse($durationFinal->getValue())); + $dtend->setDateTime($endDateTime, $isFloating); +- } elseif (!$vevent->DTSTART->hasTime()) { +- $isFloating = $vevent->DTSTART->isFloating(); +- $dtend = clone $vevent->DTSTART; ++ } elseif (!$dtStartFinal->hasTime()) { ++ $isFloating = $dtStartFinal->isFloating(); ++ $dtend = clone $dtStartFinal; + $endDateTime = $dtend->getDateTime(); + $endDateTime = $endDateTime->modify('+1 day'); + $dtend->setDateTime($endDateTime, $isFloating); + } else { +- $dtend = clone $vevent->DTSTART; ++ $dtend = clone $dtStartFinal; + } + + $isAllDay = $dtstart instanceof Property\ICalendar\Date; + -- GitLab From f8b2a81ee1ef35c35666b038b2c853fb46ccf8dc Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Thu, 30 Jun 2022 14:43:58 +0530 Subject: [PATCH 4/9] bump version --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 34bceab8..c875fb14 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,7 +17,7 @@ ARG ECLOUD_LAUNCHER_JOB_ID="318040" ARG GOOGLE_INTEGRATION_VERSION="1.0.6" ARG LDAP_WRITE_SUPPORT_VERSION="1.4.0" -RUN sed -i 's/22,2,8,1/22,2,8,21/' ${BASE_DIR}/version.php +RUN sed -i 's/22,2,8,1/22,2,8,22/' ${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 87fa94c2fe5cd8aa46407e3d9c1d88ebcbb59394 Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Fri, 1 Jul 2022 09:18:41 +0530 Subject: [PATCH 5/9] variable deifned --- patches/015-email-mail-template.patch | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/patches/015-email-mail-template.patch b/patches/015-email-mail-template.patch index 47f992d6..b6d9bdd3 100644 --- a/patches/015-email-mail-template.patch +++ b/patches/015-email-mail-template.patch @@ -33,8 +33,8 @@ /** --- ./apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 2022-06-30 10:22:42.346419100 +0530 -+++ ./apps/dav/lib/CalDAV/Schedule/IMipPlugin-new.php 2022-06-30 10:23:55.506419100 +0530 -@@ -419,23 +419,34 @@ ++++ ./apps/dav/lib/CalDAV/Schedule/IMipPlugin-new.php 2022-07-01 09:03:16.414034600 +0530 +@@ -419,23 +419,37 @@ * @param VEvent $vevent */ private function generateWhenString(IL10N $l10n, VEvent $vevent) { @@ -45,6 +45,9 @@ - $isFloating = $vevent->DTSTART->isFloating(); - $dtend = clone $vevent->DTSTART; + $lastmodified=0; ++ $dtStartFinal= $vevent->DTSTART; ++ $dtEndtFinal= $vevent->DTEND; ++ $durationFinal= $vevent->DURATION; + foreach( $vevent as $vevent1){ + $dtstamp= $vevent1->{'LAST-MODIFIED'}; + $dtstampTime = strtotime($dtstamp); @@ -80,4 +83,3 @@ } $isAllDay = $dtstart instanceof Property\ICalendar\Date; - -- GitLab From a97c206222fe09844d2758fad7b32172e3113228 Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Fri, 1 Jul 2022 09:32:31 +0530 Subject: [PATCH 6/9] version bumped --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index c875fb14..bdc00b3f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,7 +17,7 @@ ARG ECLOUD_LAUNCHER_JOB_ID="318040" ARG GOOGLE_INTEGRATION_VERSION="1.0.6" ARG LDAP_WRITE_SUPPORT_VERSION="1.4.0" -RUN sed -i 's/22,2,8,1/22,2,8,22/' ${BASE_DIR}/version.php +RUN sed -i 's/22,2,8,1/22,2,8,23/' ${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 515796a211a8e7cd529223cde0b11b04d31aa66d Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Mon, 4 Jul 2022 12:43:50 +0530 Subject: [PATCH 7/9] code optimized --- patches/015-email-mail-template.patch | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/patches/015-email-mail-template.patch b/patches/015-email-mail-template.patch index b6d9bdd3..8d5b9565 100644 --- a/patches/015-email-mail-template.patch +++ b/patches/015-email-mail-template.patch @@ -32,9 +32,9 @@ /** ---- ./apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 2022-06-30 10:22:42.346419100 +0530 -+++ ./apps/dav/lib/CalDAV/Schedule/IMipPlugin-new.php 2022-07-01 09:03:16.414034600 +0530 -@@ -419,23 +419,37 @@ +--- ./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 12:31:43.728533600 +0530 +@@ -419,23 +419,34 @@ * @param VEvent $vevent */ private function generateWhenString(IL10N $l10n, VEvent $vevent) { @@ -45,17 +45,14 @@ - $isFloating = $vevent->DTSTART->isFloating(); - $dtend = clone $vevent->DTSTART; + $lastmodified=0; -+ $dtStartFinal= $vevent->DTSTART; -+ $dtEndtFinal= $vevent->DTEND; -+ $durationFinal= $vevent->DURATION; -+ foreach( $vevent as $vevent1){ -+ $dtstamp= $vevent1->{'LAST-MODIFIED'}; ++ foreach( $vevent as $currentevent){ ++ $dtstamp= $currentevent->{'LAST-MODIFIED'}; + $dtstampTime = strtotime($dtstamp); + if($dtstampTime>$lastmodified){ + $lastmodified=$dtstampTime; -+ $dtStartFinal= $vevent1->DTSTART; -+ $dtEndtFinal= $vevent1->DTEND; -+ $durationFinal= $vevent1->DURATION; ++ $dtStartFinal= $currentevent->DTSTART; ++ $dtEndtFinal= $currentevent->DTEND; ++ $durationFinal= $currentevent->DURATION; + } + } + $dtstart = $dtStartFinal; @@ -83,3 +80,4 @@ } $isAllDay = $dtstart instanceof Property\ICalendar\Date; + -- GitLab From 61430269124167b359c0b67d3160c2cda981ae5c Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Mon, 4 Jul 2022 14:44:20 +0530 Subject: [PATCH 8/9] code optimized --- patches/015-email-mail-template.patch | 32 +++++++++++++-------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/patches/015-email-mail-template.patch b/patches/015-email-mail-template.patch index 8d5b9565..6db695c7 100644 --- a/patches/015-email-mail-template.patch +++ b/patches/015-email-mail-template.patch @@ -33,8 +33,8 @@ /** --- ./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 12:31:43.728533600 +0530 -@@ -419,23 +419,34 @@ ++++ ./apps/dav/lib/CalDAV/Schedule/IMipPlugin-new.php 2022-07-04 14:42:56.208533600 +0530 +@@ -419,23 +419,33 @@ * @param VEvent $vevent */ private function generateWhenString(IL10N $l10n, VEvent $vevent) { @@ -45,39 +45,39 @@ - $isFloating = $vevent->DTSTART->isFloating(); - $dtend = clone $vevent->DTSTART; + $lastmodified=0; ++ $selectedEvent = $vevent; + foreach( $vevent as $currentevent){ + $dtstamp= $currentevent->{'LAST-MODIFIED'}; + $dtstampTime = strtotime($dtstamp); + if($dtstampTime>$lastmodified){ + $lastmodified=$dtstampTime; -+ $dtStartFinal= $currentevent->DTSTART; -+ $dtEndtFinal= $currentevent->DTEND; -+ $durationFinal= $currentevent->DURATION; ++ $selectedEvent = $currentevent; + } + } -+ $dtstart = $dtStartFinal; -+ if (isset($dtEndtFinal)) { -+ $dtend = $dtEndtFinal; -+ } elseif (isset($durationFinal)) { -+ $isFloating = $dtStartFinal->isFloating(); -+ $dtend = clone $dtStartFinal; ++ $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($durationFinal->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 (!$dtStartFinal->hasTime()) { -+ $isFloating = $dtStartFinal->isFloating(); -+ $dtend = clone $dtStartFinal; ++ } 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 $dtStartFinal; ++ $dtend = clone $selectedEvent->DTSTART; } $isAllDay = $dtstart instanceof Property\ICalendar\Date; + -- GitLab From 9d127bded2a59caba97fe81ac1cdac460f234c88 Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Mon, 4 Jul 2022 14:51:55 +0530 Subject: [PATCH 9/9] version bump --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index bdc00b3f..c5b00c3c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,7 +17,7 @@ ARG ECLOUD_LAUNCHER_JOB_ID="318040" ARG GOOGLE_INTEGRATION_VERSION="1.0.6" ARG LDAP_WRITE_SUPPORT_VERSION="1.4.0" -RUN sed -i 's/22,2,8,1/22,2,8,23/' ${BASE_DIR}/version.php +RUN sed -i 's/22,2,8,1/22,2,8,24/' ${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