//valid selection to be deleted.
if (removeUserMailDefaultTempl == null) {
doBuildConfirmDeleteDialog(ureq);
} else {
if (addUserMailCtr != null) addUserMailCtr.dispose();
removeUserMailCtr = new MailNotificationEditController(getWindowControl(), ureq, removeUserMailDefaultTempl, true);
this.listenTo(removeUserMailCtr);
cmc = new CloseableModalController(getWindowControl(), translate("close"), removeUserMailCtr.getInitialComponent());
cmc.activate();
}
}
}
}
} else if (sourceController == removeUserMailCtr) {
if (event == Event.DONE_EVENT) {
removeUserMailCustomTempl = removeUserMailCtr.getMailTemplate();
cmc.deactivate();
doBuildConfirmDeleteDialog(ureq);
} else if (event == Event.CANCELLED_EVENT) {
cmc.deactivate();
} else {
throw new RuntimeException("unknown event ::" + event.getCommand());
}
} else if (sourceController == usc) {
if (event == Event.CANCELLED_EVENT) {
cmc.deactivate();
} else {
if (event instanceof SingleIdentityChosenEvent) {
SingleIdentityChosenEvent singleEvent = (SingleIdentityChosenEvent) event;
Identity choosenIdentity = singleEvent.getChosenIdentity();
if (choosenIdentity == null) {
showError("msg.selectionempty");
return;
}
toAdd = new ArrayList<Identity>();
toAdd.add(choosenIdentity);
} else if (event instanceof MultiIdentityChosenEvent) {
MultiIdentityChosenEvent multiEvent = (MultiIdentityChosenEvent) event;
toAdd = multiEvent.getChosenIdentities();
if (toAdd.size() == 0) {
showError("msg.selectionempty");
return;
}
} else {
throw new RuntimeException("unknown event ::" + event.getCommand());
}
// in both cases continue adding the users or asking for the mail
// template if available (=not null)
cmc.deactivate();
if (addUserMailDefaultTempl == null) {
doAddIdentitiesToGroup(ureq, toAdd, null);
} else {
if (addUserMailCtr != null) addUserMailCtr.dispose();
addUserMailCtr = new MailNotificationEditController(getWindowControl(), ureq, addUserMailDefaultTempl, true);
this.listenTo(addUserMailCtr);
cmc = new CloseableModalController(getWindowControl(), translate("close"), addUserMailCtr.getInitialComponent());
cmc.activate();
}
}