summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2013-10-03 10:07:02 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2013-10-15 08:09:20 (GMT)
commita604dbd3e47168ea31ca13b73fdce843774c9818 (patch)
tree0c0aca798475bcfb7a2c3897aa5285f1dec045e5 /plugins
parent834e4f66782530d988e4a272557fb7e613f45c58 (diff)
downloadroundcubemail-plugins-kolab-a604dbd3e47168ea31ca13b73fdce843774c9818.tar.gz
Add option to display direct CalDAV urls for calendars in the UI
Diffstat (limited to 'plugins')
-rw-r--r--plugins/calendar/calendar_ui.js8
-rw-r--r--plugins/calendar/config.inc.php.dist7
-rw-r--r--plugins/calendar/drivers/kolab/kolab_calendar.php18
-rw-r--r--plugins/calendar/drivers/kolab/kolab_driver.php1
-rw-r--r--plugins/calendar/localization/de_CH.inc1
-rw-r--r--plugins/calendar/localization/de_DE.inc1
-rw-r--r--plugins/calendar/localization/en_US.inc1
-rw-r--r--plugins/calendar/skins/classic/calendar.css3
-rw-r--r--plugins/calendar/skins/classic/templates/calendar.html4
-rw-r--r--plugins/calendar/skins/larry/calendar.css3
-rw-r--r--plugins/calendar/skins/larry/templates/calendar.html4
11 files changed, 49 insertions, 2 deletions
diff --git a/plugins/calendar/calendar_ui.js b/plugins/calendar/calendar_ui.js
index 2747641..81e350f 100644
--- a/plugins/calendar/calendar_ui.js
+++ b/plugins/calendar/calendar_ui.js
@@ -2009,6 +2009,14 @@ function rcube_calendar_ui(settings)
$dialog.dialog('close');
if (calendar.feedurl) {
+ if (calendar.caldavurl) {
+ $('#caldavurl').val(calendar.caldavurl);
+ $('#calendarcaldavurl').show();
+ }
+ else {
+ $('#calendarcaldavurl').hide();
+ }
+
$dialog.dialog({
resizable: true,
closeOnEscape: true,
diff --git a/plugins/calendar/config.inc.php.dist b/plugins/calendar/config.inc.php.dist
index a8d5da8..56748bf 100644
--- a/plugins/calendar/config.inc.php.dist
+++ b/plugins/calendar/config.inc.php.dist
@@ -119,5 +119,12 @@ $rcmail_config['calendar_itip_smtp_user'] = 'smtpauth';
// SMTP password used to send (anonymous) itip messages
$rcmail_config['calendar_itip_smtp_pass'] = '123456';
+// Base URL to build fully qualified URIs to access calendars via CALDAV
+// The following replacement variables are supported:
+// %h - Current HTTP host
+// %u - Current webmail user name
+// %n - Calendar name
+// %i - Calendar UUID
+// $rcmail_config['calendar_caldav_url'] = 'http://%h/iRony/calendars/%u/%i';
?> \ No newline at end of file
diff --git a/plugins/calendar/drivers/kolab/kolab_calendar.php b/plugins/calendar/drivers/kolab/kolab_calendar.php
index 1cf7107..877c3f5 100644
--- a/plugins/calendar/drivers/kolab/kolab_calendar.php
+++ b/plugins/calendar/drivers/kolab/kolab_calendar.php
@@ -156,6 +156,24 @@ class kolab_calendar
}
/**
+ * Compose an URL for CalDAV access to this calendar (if configured)
+ */
+ public function get_caldav_url()
+ {
+ $url = null;
+ if ($template = $this->cal->rc->config->get('calendar_caldav_url', null)) {
+ return strtr($template, array(
+ '%h' => $_SERVER['HTTP_HOST'],
+ '%u' => urlencode($this->cal->rc->get_user_name()),
+ '%i' => urlencode($this->storage->get_uid()),
+ '%n' => urlencode($this->imap_folder),
+ ));
+ }
+
+ return false;
+ }
+
+ /**
* Return the corresponding kolab_storage_folder instance
*/
public function get_folder()
diff --git a/plugins/calendar/drivers/kolab/kolab_driver.php b/plugins/calendar/drivers/kolab/kolab_driver.php
index 77b6a0a..05fd0e4 100644
--- a/plugins/calendar/drivers/kolab/kolab_driver.php
+++ b/plugins/calendar/drivers/kolab/kolab_driver.php
@@ -123,6 +123,7 @@ class kolab_driver extends calendar_driver
'active' => $cal->storage->is_active(),
'owner' => $cal->get_owner(),
'children' => true, // TODO: determine if that folder indeed has child folders
+ 'caldavurl' => $cal->get_caldav_url(),
);
}
diff --git a/plugins/calendar/localization/de_CH.inc b/plugins/calendar/localization/de_CH.inc
index cd3399f..b580fc2 100644
--- a/plugins/calendar/localization/de_CH.inc
+++ b/plugins/calendar/localization/de_CH.inc
@@ -76,6 +76,7 @@ $labels['onemonthback'] = '1 Monat zurück';
$labels['nmonthsback'] = '$nr Monate zurück';
$labels['showurl'] = 'URL anzeigen';
$labels['showurldescription'] = 'Über die folgende Adresse können Sie mit einem beliebigen Kalenderprogramm Ihren Kalender abrufen (nur lesend), sofern dieses das iCal-Format unterstützt.';
+$labels['caldavurldescription'] = 'Benutzen Sie folgende Addresse in einer <a href="http://de.wikipedia.org/wiki/CalDAV" target="_blank">CalDAV</a>-Anwendung (wie z.B. Evolution oder Mozilla Thunderbird) um diesen spezifischen Kalender mit dem Computer oder Mobiltelefon zu synchronisieren.';
// agenda view
$labels['listrange'] = 'Angezeigter Bereich:';
diff --git a/plugins/calendar/localization/de_DE.inc b/plugins/calendar/localization/de_DE.inc
index cb96b0d..60e6ad2 100644
--- a/plugins/calendar/localization/de_DE.inc
+++ b/plugins/calendar/localization/de_DE.inc
@@ -76,6 +76,7 @@ $labels['onemonthback'] = '1 Monat zurück';
$labels['nmonthsback'] = '$nr Monate zurück';
$labels['showurl'] = 'URL anzeigen';
$labels['showurldescription'] = 'Über die folgende Adresse können Sie mit einem beliebigen Kalenderprogramm Ihren Kalender abrufen (nur lesend), sofern dieses das iCal-Format unterstützt.';
+$labels['caldavurldescription'] = 'Benutzen Sie folgende Addresse in einer <a href="http://de.wikipedia.org/wiki/CalDAV" target="_blank">CalDAV</a>-Anwendung (wie z.B. Evolution oder Mozilla Thunderbird) um diesen spezifischen Kalender mit dem Computer oder Mobiltelefon zu synchronisieren.';
// agenda view
$labels['listrange'] = 'Angezeigter Bereich:';
diff --git a/plugins/calendar/localization/en_US.inc b/plugins/calendar/localization/en_US.inc
index 3bf52ba..9a631b2 100644
--- a/plugins/calendar/localization/en_US.inc
+++ b/plugins/calendar/localization/en_US.inc
@@ -77,6 +77,7 @@ $labels['onemonthback'] = '1 month back';
$labels['nmonthsback'] = '$nr months back';
$labels['showurl'] = 'Show calendar URL';
$labels['showurldescription'] = 'Use the following address to access (read only) your calendar from other applications. You can copy and paste this into any calendar software that supports the iCal format.';
+$labels['caldavurldescription'] = 'Copy this address to a <a href="http://en.wikipedia.org/wiki/CalDAV" target="_blank">CalDAV</a> client application (e.g. Evolution or Mozilla Thunderbird) to fully synchronize this specific calendar with your computer or mobile device.';
// agenda view
$labels['listrange'] = 'Range to display:';
diff --git a/plugins/calendar/skins/classic/calendar.css b/plugins/calendar/skins/classic/calendar.css
index 117c2ce..835bdac 100644
--- a/plugins/calendar/skins/classic/calendar.css
+++ b/plugins/calendar/skins/classic/calendar.css
@@ -164,7 +164,8 @@ pre {
background-position: 0 -92px;
}
-#calfeedurl {
+#calfeedurl,
+#caldavurl {
width: 98%;
background: #fbfbfb;
padding: 4px;
diff --git a/plugins/calendar/skins/classic/templates/calendar.html b/plugins/calendar/skins/classic/templates/calendar.html
index a78e76f..ba80ca3 100644
--- a/plugins/calendar/skins/classic/templates/calendar.html
+++ b/plugins/calendar/skins/classic/templates/calendar.html
@@ -150,6 +150,10 @@
<div id="calendarurlbox" class="uidialog">
<p><roundcube:label name="calendar.showurldescription" /></p>
<textarea id="calfeedurl" rows="2" readonly="readonly"></textarea>
+ <div id="calendarcaldavurl" style="display:none">
+ <p><roundcube:label name="calendar.caldavurldescription" html="yes" /></p>
+ <textarea id="caldavurl" rows="2" readonly="readonly"></textarea>
+ </div>
</div>
<div id="calendartoolbar">
diff --git a/plugins/calendar/skins/larry/calendar.css b/plugins/calendar/skins/larry/calendar.css
index b11abfa..8775b2a 100644
--- a/plugins/calendar/skins/larry/calendar.css
+++ b/plugins/calendar/skins/larry/calendar.css
@@ -225,7 +225,8 @@ pre {
background-position: right -92px;
}
-#calfeedurl {
+#calfeedurl,
+#caldavurl {
width: 98%;
background: #fbfbfb;
padding: 4px;
diff --git a/plugins/calendar/skins/larry/templates/calendar.html b/plugins/calendar/skins/larry/templates/calendar.html
index bc9beca..79ce5ad 100644
--- a/plugins/calendar/skins/larry/templates/calendar.html
+++ b/plugins/calendar/skins/larry/templates/calendar.html
@@ -164,6 +164,10 @@
<div id="calendarurlbox" class="uidialog">
<p><roundcube:label name="calendar.showurldescription" /></p>
<textarea id="calfeedurl" rows="2" readonly="readonly"></textarea>
+ <div id="calendarcaldavurl" style="display:none">
+ <p><roundcube:label name="calendar.caldavurldescription" html="yes" /></p>
+ <textarea id="caldavurl" rows="2" readonly="readonly"></textarea>
+ </div>
</div>
<roundcube:object name="plugin.calendar_css" />