Add event exporting.
authorJan Schneider <jan@horde.org>
Fri, 19 Feb 2010 23:12:49 +0000 (00:12 +0100)
committerJan Schneider <jan@horde.org>
Fri, 19 Feb 2010 23:18:10 +0000 (00:18 +0100)
kronolith/js/kronolith.js
kronolith/lib/Kronolith.php
kronolith/templates/index/edit.inc

index 4efc3f0..23873e1 100644 (file)
@@ -3330,6 +3330,7 @@ KronolithCore = {
             d.add(1).hour();
             $('kronolithEventEndDate').setValue(d.toString(Kronolith.conf.date_format));
             $('kronolithEventEndTime').setValue(d.toString(Kronolith.conf.time_format));
+            $('kronolithEventLinkExport').up().hide();
             RedBox.showHtml($('kronolithEventDialog').show());
         }
     },
@@ -3444,6 +3445,8 @@ KronolithCore = {
         $('kronolithEventEndDate').setValue(ev.ed);
         $('kronolithEventEndTime').setValue(ev.et);
         $('kronolithEventDescription').setValue(ev.d);
+        $('kronolithEventLinkExport').up().show();
+        $('kronolithEventExport').href = Kronolith.conf.URI_EVENT_EXPORT.interpolate({ id: ev.id, calendar: ev.c, type: ev.ty });
 
         /* Alarm */
         if (ev.a) {
index 6b78aed..8d003f5 100644 (file)
@@ -188,6 +188,7 @@ class Kronolith
             'URI_IMG' => $registry->getImageDir() . '/',
             'URI_SNOOZE' => (string)Horde::url($registry->get('webroot', 'horde') . '/services/snooze.php', true, -1),
             'URI_CALENDAR_EXPORT' => (string)Horde::url('data.php', true)->add(array('actionID' => 'export', 'all_events' => 1, 'exportID' => Horde_Data::EXPORT_ICALENDAR, 'exportCal' => '')),
+            'URI_EVENT_EXPORT' => str_replace(array('%23', '%7B', '%7D'), array('#', '{', '}'), Horde::url('event.php', true)->add(array('view' => 'ExportEvent', 'eventID' => '#{id}', 'calendar' => '#{calendar}', 'type' => '#{type}'))),
             'SESSION_ID' => defined('SID') ? SID : '',
             'user' => Horde_Auth::getAuth(),
             'prefs_url' => str_replace('&amp;', '&', Horde::getServiceLink('options', 'kronolith')),
index d07254f..43ace61 100644 (file)
@@ -76,6 +76,7 @@
 <?php if ($GLOBALS['conf']['maps']['driver']): ?>
     <li><a href="#" class="kronolithTabLink" id="kronolithEventLinkMap"><?php echo _("Map") ?></a></li>
 <?php endif; ?>
+    <li><a href="#" class="kronolithTabLink" id="kronolithEventLinkExport"><?php echo _("Export") ?></a></li>
   </ul>
 </div>
 <br class="clear" />
   <div id="kronolithEventMap"></div>
 </div>
 
+<div id="kronolithEventTabExport" class="kronolithTabsOption" style="display:none">
+  <div class="kronolithTabInfo"><?php echo _("iCalendar is a computer file format which allows internet users to send meeting requests and tasks to other internet users, via email, or sharing files with an extension of .ics. Recipients of the iCalendar data file (with supporting software, such as an email client or calendar application) can respond to the sender easily or counter propose another meeting date/time.") ?></div>
+  <label><?php echo _("Export ICS file") ?>:</label>
+  <a id="kronolithEventExport"><?php echo _("Event ICS file") ?></a>
+</div>
+
 <div class="kronolithFormActions">
   <input id="kronolithEventSave" type="button" value="<?php echo _("Save") ?>" class="button ok" />
   <input id="kronolithEventDelete" type="button" value="<?php echo _("Delete") ?>" class="button ko" />