vcMain.contextPut("isSubscribed", new Boolean(calendarSubscription.isSubscribed()));
CoordinatorManager.getCoordinator().getEventBus().fireEventToListenersOf(new KalendarModifiedEvent(), OresHelper.lookupType(CalendarManager.class));
}
} else if (source == weeklyCalendar) {
if (event instanceof KalendarGUIEditEvent) {
KalendarGUIEditEvent guiEvent = (KalendarGUIEditEvent) event;
KalendarEvent kalendarEvent = guiEvent.getKalendarEvent();
if (kalendarEvent == null) {
// event already deleted
getWindowControl().setError(translator.translate("cal.error.eventDeleted"));
return;
}
String recurrence = kalendarEvent.getRecurrenceRule();
boolean isImported = false;
KalendarRenderWrapper kalendarRenderWrapper = guiEvent.getKalendarRenderWrapper();
if (kalendarRenderWrapper!=null) {
isImported = kalendarRenderWrapper.isImported();
}
if( !isImported && recurrence != null && !recurrence.equals("") ) {
List<String> btnLabels = new ArrayList<String>();
btnLabels.add(translator.translate("cal.edit.dialog.sequence"));
btnLabels.add(translator.translate("cal.edit.dialog.delete.single"));
btnLabels.add(translator.translate("cal.edit.dialog.delete.sequence"));
if (dbcSequence != null) dbcSequence.dispose();
dbcSequence = DialogBoxUIFactory.createGenericDialog(ureq, getWindowControl(), translator.translate("cal.edit.dialog.title"), translator.translate("cal.edit.dialog.text"), btnLabels);
dbcSequence.addControllerListener(this);
dbcSequence.setUserObject(guiEvent);
dbcSequence.activate();
return;
}
KalendarRenderWrapper kalendarWrapper = guiEvent.getKalendarRenderWrapper();
pushEditEventController(ureq, kalendarEvent, kalendarWrapper);
} else if (event instanceof KalendarGUIAddEvent) {
pushAddEventController((KalendarGUIAddEvent)event, ureq);
}
}