if (!$error) {
$notification->push(sprintf(_("%s file successfully imported"),
$file_types[$_SESSION['import_data']['format']]), 'horde.success');
+ if (Horde_Util::getFormData('import_ajax')) {
+ Horde::addInlineScript('window.parent.KronolithCore.loadCalendar(\'internal\', \'' . $_SESSION['import_data']['import_cal'] . '\');');
+ }
}
$next_step = $data->cleanup();
}
$stack = $notification->notify(array('listeners' => 'status', 'raw' => true));
if ($stack) {
Horde::addInlineScript('window.parent.KronolithCore.showNotifications(window.parent.$A(' . Horde_Serialize::serialize($stack, Horde_Serialize::JSON, Horde_Nls::getCharset()) . '));');
- Horde::addInlineScript('window.parent.$(window.name).remove();');
- Horde::outputInlineScript();
}
+ Horde::addInlineScript('window.parent.$(window.name).remove();');
+ Horde::outputInlineScript();
exit;
}
},
/**
+ * Loads a certain calendar, if the current view is still a calendar view.
+ *
+ * @param string type The calendar type.
+ * @param string calendar The calendar id.
+ */
+ loadCalendar: function(type, calendar)
+ {
+ if (Kronolith.conf.calendars[type][calendar].show &&
+ $w('day week month year').include(this.view)) {
+ var dates = this.viewDates(this.date, this.view);
+ this.deleteCache(null, [type, calendar]);
+ this.loadEvents(dates[0], dates[1], this.view, [[type, calendar]]);
+ }
+ },
+
+ /**
* Toggles a calendars visibility.
*
* @param string type The calendar type.
if (this.view == 'year' ||
Object.isUndefined(this.ecache.get(type)) ||
Object.isUndefined(this.ecache.get(type).get(calendar))) {
- var dates = this.viewDates(this.date, this.view);
- this.loadEvents(dates[0], dates[1], this.view, [[type, calendar]]);
+ this.loadCalendar(type, calendar);
} else {
$('kronolithBody').select('div').findAll(function(el) {
return el.retrieve('calendar') == type + '|' + calendar;