mapMarker: null,
map: null,
mapInitialized: false,
+ search: 'future',
doActionOpts: {
onException: function(parentfunc, r, e)
break;
case 'search':
- var cals = [], term = locParts[0],
+ var cals = [], time = locParts[0], term = locParts[1],
query = Object.toJSON({ title: term });
+
+ if (!($w('all past future').include(time))) {
+ return;
+ }
+
+ this.search = time;
+ $w('All Past Future').each(function(time) {
+ $('kronolithSearch' + time).up().removeClassName('activeTab');
+ });
+ $('kronolithSearch' + this.search.capitalize()).up().addClassName('activeTab');
this.closeView('agenda');
this.updateView(null, 'search', term);
$H(Kronolith.conf.calendars).each(function(type) {
});
this.startLoading('search', query);
this.doAction('searchEvents',
- { cals: cals.toJSON(), query: query },
+ { cals: cals.toJSON(), query: query, time: this.search },
function(r) {
// Hide spinner.
this.loading--;
day = dates[0].clone();
$('kronolithAgendaDate')
.update(this.setTitle(Kronolith.text.agenda + ' ' + dates[0].toString('d') + ' - ' + dates[1].toString('d')));
+ $('kronolithAgendaNavigation').show();
+ $('kronolithSearchNavigation').hide();
} else {
$('kronolithAgendaDate')
.update(this.setTitle(Kronolith.text.searching.interpolate({ term: data })));
+ $('kronolithAgendaNavigation').hide();
+ $('kronolithSearchNavigation').show();
}
// Remove old rows. Maybe we should only rebuild the calendars if
break;
case 'kronolithSearchForm':
- this.go('search:' + $F('kronolithSearchTerm'))
+ this.go('search:' + this.search + ':' + $F('kronolithSearchTerm'))
e.stop();
break;
return;
case 'kronolithSearchButton':
- this.go('search:' + $F('kronolithSearchTerm'))
+ this.go('search:' + this.search + ':' + $F('kronolithSearchTerm'));
+ e.stop();
+ break;
+
+ case 'kronolithSearchFuture':
+ if (this.search != 'future') {
+ this.go('search:future:' + $F('kronolithSearchTerm'));
+ }
+ e.stop();
+ break;
+
+ case 'kronolithSearchPast':
+ if (this.search != 'past') {
+ this.go('search:past:' + $F('kronolithSearchTerm'));
+ }
+ e.stop();
+ break;
+
+ case 'kronolithSearchAll':
+ if (this.search != 'all') {
+ this.go('search:all:' + $F('kronolithSearchTerm'));
+ }
e.stop();
break;
$event = $this->getEvent($eventId);
$showRecurrence = true;
if ($event->recurs()) {
- if (empty($query->end)) {
- $eventEnd = $event->recurrence->nextRecurrence($now);
- if (!$eventEnd) {
- continue;
- }
- } else {
- $eventEnd = $query->end;
- }
- if (empty($query->start)) {
+ if (empty($query->start) && empty($query->end)) {
$eventStart = $event->start;
- $showRecurrence = false;
+ $eventEnd = $event->end;
} else {
- $eventStart = $query->start;
+ if (empty($query->end)) {
+ $eventEnd = $event->recurrence->nextRecurrence($now);
+ if (!$eventEnd) {
+ continue;
+ }
+ } else {
+ $eventEnd = $query->end;
+ }
+ if (empty($query->start)) {
+ $eventStart = $event->start;
+ $showRecurrence = false;
+ } else {
+ $eventStart = $query->start;
+ }
}
} else {
$eventStart = $event->start;
<div id="kronolithViewAgenda" style="display:none">
<table class="kronolithView">
- <caption>
+ <caption class="tabset">
<span id="kronolithLoadingagenda" class="kronolithLoading"></span>
<span id="kronolithAgendaDate"></span>
<span class="kronolithNavigation">
- <a title="<?php echo _("Previous") ?>" class="kronolithPrev"><</a>
- <a class="kronolithGotoToday"><?php echo Horde::highlightAccessKey(_("_Today"), $todayAccessKey) ?></a>
- <a title="<?php echo _("Next") ?>" class="kronolithNext">></a>
+ <span id="kronolithAgendaNavigation">
+ <a title="<?php echo _("Previous") ?>" class="kronolithPrev"><</a>
+ <a class="kronolithGotoToday"><?php echo Horde::highlightAccessKey(_("_Today"), $todayAccessKey) ?></a>
+ <a title="<?php echo _("Next") ?>" class="kronolithNext">></a>
+ </span>
+ <ul id="kronolithSearchNavigation" style="display:none">
+ <li><a id="kronolithSearchAll"><?php echo _("All") ?></a></li>
+ <li><a id="kronolithSearchPast"><?php echo _("Past") ?></a></li>
+ <li class="activeTab"><a id="kronolithSearchFuture"><?php echo _("Future") ?></a></li>
+ </ul>
<a class="kronolithPrint" onclick="print()" title="<?php echo _("Print") ?>"><span><?php echo _("Print") ?></span></a>
</span>
</caption>