this._addHistory(fullloc);
break;
+ case 'task':
+ this._addHistory(fullloc);
+ break;
+
case 'options':
//this.highlightSidebar('appoptions');
this._addHistory(loc);
event.value.nodeId = 'kronolithEvent' + view + event.value.calendar + date + event.key;
_createElement = function(event) {
- return new Element('DIV', {
+ var el = new Element('DIV', {
'id': event.value.nodeId,
- 'calendar': event.value.calendar,
- 'eventid' : event.key,
+ 'calendar': event.value.calendar.replace(/:/, '^'),
+ 'eventid' : event.key.replace(/:/, '^'),
'class': 'kronolithEvent'
});
+ if (!Object.isUndefined(event.value.aj)) {
+ el.writeAttribute('ajax', event.value.aj);
+ }
+ return el;
};
switch (view) {
case 'kronolithNavWeek':
case 'kronolithNavMonth':
case 'kronolithNavYear':
- case 'kronolithNavTasks':
case 'kronolithNavAgenda':
this.go(id.substring(12).toLowerCase() + ':' + this.date.dateString());
e.stop();
return;
+ case 'kronolithNavTasks':
+ this.go('tasks');
+ e.stop();
+ return;
+
case 'kronolithMinicalDate':
this.go('month:' + orig.readAttribute('date'));
e.stop();
}
if (elt.hasClassName('kronolithEvent')) {
- this.go('event:' + elt.readAttribute('calendar') + ':' + elt.readAttribute('eventid'));
+ if (elt.hasAttribute('ajax')) {
+ this.go(elt.readAttribute('ajax'));
+ } else {
+ this.go('event:' + elt.readAttribute('calendar') + ':' + elt.readAttribute('eventid'));
+ }
e.stop();
return;
} else if (elt.hasClassName('kronolithWeekDay')) {
this.doAction('ListTopTags', {}, this._topTags);
if (id) {
RedBox.loading();
- this.doAction('GetEvent', { 'cal': calendar, 'id': id }, this._editEvent.bind(this));
+ this.doAction('GetEvent', { 'cal': calendar.replace(/\^/, ':'), 'id': id.replace(/\^/, ':') }, this._editEvent.bind(this));
} else {
var d = date ? this.parseDate(date) : new Date();
$('kronolithEventId').value = '';
*
* @var string
*/
- private $_api;
+ protected $_api;
+
+ /**
+ * The link to this event in the ajax interface.
+ *
+ * @var string
+ */
+ public $ajax_link;
/**
* Constructor.
$this->external_params = $event['params'];
$this->external_icon = !empty($event['icon']) ? $event['icon'] : null;
$this->external_link = !empty($event['link']) ? $event['link'] : null;
+ $this->ajax_link = !empty($event['ajax_link']) ? $event['ajax_link'] : null;
$this->title = $event['title'];
$this->description = isset($event['description']) ? $event['description'] : '';
$this->start = $eventStart;
{
$json = parent::toJson($allDay, $full, $time_format);
$json->ic = $this->external_icon;
- // @TODO: What is expected for external calendar links? This is currently
- // broken in the UI.
- //$json->ln = $this->getLink();
+ if ($this->ajax_link) {
+ $json->aj = $this->ajax_link;
+ } else {
+ $json->ln = $this->getLink();
+ }
return $json;
}