-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
187 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
From 1c245cedd72ab45ccc0de956cabb27f9e203195d Mon Sep 17 00:00:00 2001 | ||
From: Michael J Rubinsky <mrubinsk@horde.org> | ||
Date: Sun, 11 Feb 2018 12:01:29 -0500 | ||
Subject: [PATCH 1/2] Allow to optionally specify endDate for calendar feed. | ||
|
||
--- | ||
This comment has been minimized.
Sorry, something went wrong. |
||
feed/index.php | 26 ++++++++++++++++++++------ | ||
1 file changed, 20 insertions(+), 6 deletions(-) | ||
|
||
diff --git a/feed/index.php b/feed/index.php | ||
index a3d2cddf..6d6c9022 100644 | ||
--- a/feed/index.php | ||
+++ b/feed/index.php | ||
@@ -25,6 +25,8 @@ require_once __DIR__ . '/../lib/Application.php'; | ||
Horde_Registry::appInit('kronolith', array('authentication' => 'none', 'session_control' => 'readonly')); | ||
|
||
$calendar = Horde_Util::getFormData('c'); | ||
+$endDate = Horde_Util::getFormData('e'); | ||
+ | ||
try { | ||
$share = $injector->getInstance('Kronolith_Shares')->getShare($calendar); | ||
} catch (Exception $e) { | ||
@@ -66,13 +68,25 @@ if (empty($feed_type)) { | ||
$feed_type = 'atom'; | ||
} | ||
|
||
-$startDate = new Horde_Date(array('year' => date('Y'), | ||
- 'month' => date('n'), | ||
- 'mday' => date('j'))); | ||
+$startDate = new Horde_Date(array( | ||
+ 'year' => date('Y'), | ||
+ 'month' => date('n'), | ||
+ 'mday' => date('j')) | ||
+); | ||
+if ($endDate) { | ||
+ try { | ||
+ $endDate = new Horde_Date($endDate); | ||
+ } catch (Horde_Date_Exception $e) { | ||
+ $endDate = new Horde_Date($startDate); | ||
+ } | ||
+} else { | ||
+ $endDate = new Horde_Date($startDate); | ||
+} | ||
+ | ||
try { | ||
- $events = Kronolith::listEvents($startDate, | ||
- new Horde_Date($startDate), | ||
- array($calendar)); | ||
+ $events = Kronolith::listEvents( | ||
+ $startDate, $endDate, array($calendar) | ||
+ ); | ||
} catch (Exception $e) { | ||
Horde::log($e, 'ERR'); | ||
$events = array(); | ||
-- | ||
2.15.1 | ||
|
||
|
||
From f9466ad5c6e1a9f39a9413b4c05b3690e4bea0bc Mon Sep 17 00:00:00 2001 | ||
From: Jan Schneider <jan@horde.org> | ||
Date: Fri, 11 May 2018 18:22:43 +0200 | ||
Subject: [PATCH 2/2] Fix incorrectly displayed recurring events in calendar | ||
feeds. | ||
|
||
--- | ||
feed/index.php | 21 ++++++++++----------- | ||
1 file changed, 10 insertions(+), 11 deletions(-) | ||
|
||
diff --git a/feed/index.php b/feed/index.php | ||
index 6d6c9022..ff19fe22 100644 | ||
--- a/feed/index.php | ||
+++ b/feed/index.php | ||
@@ -68,11 +68,7 @@ if (empty($feed_type)) { | ||
$feed_type = 'atom'; | ||
} | ||
|
||
-$startDate = new Horde_Date(array( | ||
- 'year' => date('Y'), | ||
- 'month' => date('n'), | ||
- 'mday' => date('j')) | ||
-); | ||
+$startDate = new Horde_Date(time()); | ||
if ($endDate) { | ||
try { | ||
$endDate = new Horde_Date($endDate); | ||
@@ -85,7 +81,10 @@ if ($endDate) { | ||
|
||
try { | ||
$events = Kronolith::listEvents( | ||
- $startDate, $endDate, array($calendar) | ||
+ $startDate, | ||
+ $endDate, | ||
+ array($calendar), | ||
+ array('show_recurrence' => true, 'cover_dates' => false) | ||
); | ||
} catch (Exception $e) { | ||
Horde::log($e, 'ERR'); | ||
@@ -119,7 +118,7 @@ $template->set('self_url', $self_url); | ||
|
||
$twentyFour = $prefs->getValue('twentyFor'); | ||
$entries = array(); | ||
-foreach ($events as $day_events) { | ||
+foreach ($events as $date => $day_events) { | ||
foreach ($day_events as $id => $event) { | ||
/* Modification date. */ | ||
$modified = $history->getActionTimestamp('kronolith:' . $calendar . ':' | ||
@@ -153,10 +152,10 @@ foreach ($events as $day_events) { | ||
} | ||
$desc .= '<br />' . _("Event Status:") . ' ' . Kronolith::statusToString($event->status); | ||
|
||
- $entries[$id]['title'] = htmlspecialchars($event->getTitle()); | ||
- $entries[$id]['desc'] = htmlspecialchars($desc); | ||
- $entries[$id]['url'] = htmlspecialchars(Horde::url($event->getViewUrl(), true, -1)); | ||
- $entries[$id]['modified'] = $modified->format(DATE_ATOM); | ||
+ $entries[$id . $date]['title'] = htmlspecialchars($event->getTitle()); | ||
+ $entries[$id . $date]['desc'] = htmlspecialchars($desc); | ||
+ $entries[$id . $date]['url'] = htmlspecialchars(Horde::url($event->getViewUrl(), true, -1)); | ||
+ $entries[$id . $date]['modified'] = $modified->format(DATE_ATOM); | ||
} | ||
} | ||
$template->set('entries', $entries, true); | ||
-- | ||
2.15.1 | ||
|
Oops, something went wrong.
Obviously, this file should not be there.