From: Jan Schneider Date: Mon, 9 Nov 2009 22:46:53 +0000 (+0100) Subject: Support links to timeobjects and load them in an iframe. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=fe87f0cc6337b225e5eb3c84ef14908d39cc3182;p=horde.git Support links to timeobjects and load them in an iframe. --- diff --git a/kronolith/js/kronolith.js b/kronolith/js/kronolith.js index 127e3a802..72d351af1 100644 --- a/kronolith/js/kronolith.js +++ b/kronolith/js/kronolith.js @@ -302,19 +302,24 @@ KronolithCore = { break; case 'event': + // Load view first if necessary. if (!this.view) { this.go(Kronolith.conf.login_view); this.go.bind(this, fullloc, data).defer(); return; } + switch (locParts.length) { case 0: + // New event. this.editEvent(); break; case 1: + // New event on a certain date. this.editEvent(null, null, locParts[0]); break; case 2: + // Editing event. this.editEvent(locParts[0], locParts[1]); break; } @@ -455,6 +460,7 @@ KronolithCore = { if (this.view && this.view != loc) { $('kronolithView' + this.view.capitalize()).fade({ 'queue': 'end' }); } + this.view = null; }, /** @@ -1846,6 +1852,8 @@ KronolithCore = { iframeContent: function(name, loc) { + this.closeView(); + if (name === null) { name = loc; } @@ -1858,8 +1866,8 @@ KronolithCore = { $('kronolithViewIframe').insert(iframe); } - this.view = null; $('kronolithViewIframe').appear({ 'queue': 'end' }); + this.view = 'iframe'; }, onResize: function(noupdate, nowait) @@ -2400,6 +2408,13 @@ KronolithCore = { } var ev = r.response.event; + + if (!Object.isUndefined(ev.ln)) { + this.iframeContent('event', ev.ln); + this._closeRedBox(); + return; + } + $('kronolithEventId').value = ev.id; $('kronolithEventCalendar').value = ev.ty + '|' + ev.c; $('kronolithEventTitle').value = ev.t; diff --git a/kronolith/lib/Event.php b/kronolith/lib/Event.php index 4bc9f4196..cca42cc63 100644 --- a/kronolith/lib/Event.php +++ b/kronolith/lib/Event.php @@ -2225,6 +2225,8 @@ abstract class Kronolith_Event } elseif ($this->remoteCal) { $params['calendar'] = '**remote'; $params['remoteCal'] = $this->remoteCal; + } elseif (!empty($this->external_link)) { + return $this->external_link; } else { $params['calendar'] = $this->getCalendar(); } diff --git a/kronolith/lib/Event/Horde.php b/kronolith/lib/Event/Horde.php index 354efcf82..4e308b0c8 100644 --- a/kronolith/lib/Event/Horde.php +++ b/kronolith/lib/Event/Horde.php @@ -96,7 +96,7 @@ class Kronolith_Event_Horde extends Kronolith_Event if ($this->ajax_link) { $json->aj = $this->ajax_link; } else { - $json->ln = $this->getLink(); + $json->ln = $this->getViewUrl(array(), true); } return $json; }