} else if (source == dbcSequence) {
if(event != Event.CANCELLED_EVENT) {
int pos = DialogBoxUIFactory.getButtonPos(event);
KalendarGUIEditEvent guiEvent = (KalendarGUIEditEvent)dbcSequence.getUserObject();
KalendarRenderWrapper kalendarWrapper = guiEvent.getKalendarRenderWrapper();
KalendarEvent kalendarEvent = guiEvent.getKalendarEvent();
if(pos == 0) { // edit the sequence
// load the parent event of this sequence
KalendarEvent parentEvent = kalendarWrapper.getKalendar().getEvent(kalendarEvent.getID());
pushEditEventController(ureq, parentEvent, kalendarWrapper);
} else if(pos == 1) { // delete a single event of the sequence
deleteSingleYesNoController = activateYesNoDialog(ureq, null, translator.translate("cal.delete.dialogtext"), deleteSingleYesNoController);
deleteSingleYesNoController.setUserObject(kalendarEvent);
} else if(pos == 2) { // delete the whole sequence
deleteSequenceYesNoController = activateYesNoDialog(ureq, null, translator.translate("cal.delete.dialogtext.sequence"), deleteSequenceYesNoController);
deleteSequenceYesNoController.setUserObject(kalendarEvent);
}
}
dbcSequence.dispose();
} else if (source == deleteSingleYesNoController) {
if (DialogBoxUIFactory.isYesEvent(event)) {
KalendarEvent kalendarEvent = (KalendarEvent)deleteSingleYesNoController.getUserObject();
affectedCal = kalendarEvent.getCalendar();
KalendarEvent kEvent = affectedCal.getEvent(kalendarEvent.getID());
kEvent.addRecurrenceExc(kalendarEvent.getBegin());
CalendarManagerFactory.getInstance().getCalendarManager().updateEventFrom(affectedCal, kEvent);
deleteSingleYesNoController.dispose();
weeklyCalendar.setDirty(true);
vcMain.setDirty(true);
}
} else if (source == deleteSequenceYesNoController) {
if (DialogBoxUIFactory.isYesEvent(event)) {
KalendarEvent kalendarEvent = (KalendarEvent)deleteSequenceYesNoController.getUserObject();
affectedCal = kalendarEvent.getCalendar();
CalendarManagerFactory.getInstance().getCalendarManager().removeEventFrom(affectedCal, kalendarEvent);
deleteSequenceYesNoController.dispose();
weeklyCalendar.setDirty(true);
vcMain.setDirty(true);
}