gunnar: server/patches/horde-webmail/1.2.0/tg t_kronolith_HK_GW_FixWeeklyRecurringEvents.diff, 1.1.2.2, 1.1.2.3
cvs at kolab.org
cvs at kolab.org
Thu Dec 3 10:52:28 CET 2009
Author: gunnar
Update of /kolabrepository/server/patches/horde-webmail/1.2.0/tg
In directory doto:/tmp/cvs-serv7108/patches/horde-webmail/1.2.0/tg
Modified Files:
Tag: kolab_2_2_branch
t_kronolith_HK_GW_FixWeeklyRecurringEvents.diff
Log Message:
kolab/issue3846 (fix recurring events that are counted per week and not per incident)
Index: t_kronolith_HK_GW_FixWeeklyRecurringEvents.diff
===================================================================
RCS file: /kolabrepository/server/patches/horde-webmail/1.2.0/tg/Attic/t_kronolith_HK_GW_FixWeeklyRecurringEvents.diff,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -d -r1.1.2.2 -r1.1.2.3
--- t_kronolith_HK_GW_FixWeeklyRecurringEvents.diff 27 Nov 2009 18:51:50 -0000 1.1.2.2
+++ t_kronolith_HK_GW_FixWeeklyRecurringEvents.diff 3 Dec 2009 09:52:26 -0000 1.1.2.3
@@ -12,15 +12,15 @@
Signed-off-by: Gunnar Wrobel <p at rdus.de>
---
- horde-webmail/kronolith/lib/Recurrence.php | 58 ++++++++++++++++++++++++--
- horde-webmail/lib/Horde/Date/Recurrence.php | 58 ++++++++++++++++++++++++--
- 2 files changed, 106 insertions(+), 10 deletions(-)
+ horde-webmail/kronolith/lib/Recurrence.php | 56 +++++++++++++++++++++++++--
+ horde-webmail/lib/Horde/Date/Recurrence.php | 56 +++++++++++++++++++++++++--
+ 2 files changed, 104 insertions(+), 8 deletions(-)
diff --git a/horde-webmail/kronolith/lib/Recurrence.php b/horde-webmail/kronolith/lib/Recurrence.php
-index f22351d..409063f 100644
+index f22351d..63dcb34 100644
--- a/horde-webmail/kronolith/lib/Recurrence.php
+++ b/horde-webmail/kronolith/lib/Recurrence.php
-@@ -374,18 +374,66 @@ class Horde_Date_Recurrence {
+@@ -374,19 +374,67 @@ class Horde_Date_Recurrence {
$diff = Date_Calc::dateDiff($start_week->mday, $start_week->month, $start_week->year,
$after_week->mday, $after_week->month, $after_week->year);
@@ -42,7 +42,7 @@
+ * first week.
+ */
+ $recur = $interval * ($repeats + 1);
-+ }
+ }
+
+ if ($this->hasRecurCount()) {
+ $recurrences = 0;
@@ -70,33 +70,33 @@
+ }
+ $recurrences += $total_recurrences_per_week * $repeats;
+ }
- }
++ }
+
$next = $start_week;
-- list($next->mday, $next->month, $next->year) = explode('/', Date_Calc::daysToDate(Date_Calc::dateToDays($next->mday, $next->month, $next->year) + $recur, '%e/%m/%Y'));
-+ list($next->mday, $next->month, $next->year) = explode('/', Date_Calc::daysToDate(Date_Calc::dateToDays($next->mday, $next->month, $next->year) + $recur - 1, '%e/%m/%Y'));
+ list($next->mday, $next->month, $next->year) = explode('/', Date_Calc::daysToDate(Date_Calc::dateToDays($next->mday, $next->month, $next->year) + $recur, '%e/%m/%Y'));
$next = new Horde_Date($next);
while ($next->compareDateTime($after) < 0 &&
$next->compareDateTime($after_week_end) < 0) {
- ++$next->mday;
- $next->correct();
+ if ($this->hasRecurCount()
+ && $next->compareDateTime($after) < 0
+ && $this->recurOnDay((int)pow(2, $next->dayOfWeek()))) {
+ $recurrences++;
+ }
-+ }
+ ++$next->mday;
+ $next->correct();
+ }
+ if ($this->hasRecurCount() &&
+ $recurrences >= $this->recurCount) {
+ return false;
- }
++ }
if (!$this->hasRecurEnd() ||
$next->compareDateTime($this->recurEnd) <= 0) {
+ if ($next->compareDateTime($after_week_end) >= 0) {
diff --git a/horde-webmail/lib/Horde/Date/Recurrence.php b/horde-webmail/lib/Horde/Date/Recurrence.php
-index 9dbf057..c11624b 100644
+index 9dbf057..0d6aba4 100644
--- a/horde-webmail/lib/Horde/Date/Recurrence.php
+++ b/horde-webmail/lib/Horde/Date/Recurrence.php
-@@ -374,18 +374,66 @@ class Horde_Date_Recurrence {
+@@ -374,19 +374,67 @@ class Horde_Date_Recurrence {
$diff = Date_Calc::dateDiff($start_week->mday, $start_week->month, $start_week->year,
$after_week->mday, $after_week->month, $after_week->year);
@@ -118,7 +118,7 @@
+ * first week.
+ */
+ $recur = $interval * ($repeats + 1);
-+ }
+ }
+
+ if ($this->hasRecurCount()) {
+ $recurrences = 0;
@@ -146,33 +146,39 @@
+ }
+ $recurrences += $total_recurrences_per_week * $repeats;
+ }
- }
++ }
+
$next = $start_week;
-- list($next->mday, $next->month, $next->year) = explode('/', Date_Calc::daysToDate(Date_Calc::dateToDays($next->mday, $next->month, $next->year) + $recur, '%e/%m/%Y'));
-+ list($next->mday, $next->month, $next->year) = explode('/', Date_Calc::daysToDate(Date_Calc::dateToDays($next->mday, $next->month, $next->year) + $recur - 1, '%e/%m/%Y'));
+ list($next->mday, $next->month, $next->year) = explode('/', Date_Calc::daysToDate(Date_Calc::dateToDays($next->mday, $next->month, $next->year) + $recur, '%e/%m/%Y'));
$next = new Horde_Date($next);
while ($next->compareDateTime($after) < 0 &&
$next->compareDateTime($after_week_end) < 0) {
- ++$next->mday;
- $next->correct();
+ if ($this->hasRecurCount()
+ && $next->compareDateTime($after) < 0
+ && $this->recurOnDay((int)pow(2, $next->dayOfWeek()))) {
+ $recurrences++;
+ }
-+ }
+ ++$next->mday;
+ $next->correct();
+ }
+ if ($this->hasRecurCount() &&
+ $recurrences >= $this->recurCount) {
+ return false;
- }
++ }
if (!$this->hasRecurEnd() ||
$next->compareDateTime($this->recurEnd) <= 0) {
+ if ($next->compareDateTime($after_week_end) >= 0) {
--
tg: (1f477b1..) t/kronolith/HK/GW/FixWeeklyRecurringEvents (depends on: t/kronolith/HK/UV/dateInputFieldOrder)
--
TOPGIT patch commit log
=======================
+
+commit 5d178150de61ceac66f978563ddd105f1cafeae9
+Author: Gunnar Wrobel <p at rdus.de>
+Date: Thu Dec 3 10:02:11 2009 +0100
+
+ Fixed biweekly sunday events.
commit 2b3d01e220c0a2f5a80f68e5ac7eb759d6090fe3
Author: root <Gunnar Wrobel wrobel at pardus.de>
More information about the commits
mailing list