use of org.olat.group.ui.wizard.BGMailNotificationEditController in project OpenOLAT by OpenOLAT.
the class AbstractBusinessGroupListController method confirmUserManagementEmail.
private void confirmUserManagementEmail(UserRequest ureq, MembershipModification mod, List<BusinessGroup> groups) {
removeAsListenerAndDispose(cmc);
removeAsListenerAndDispose(userManagementSendMailController);
MailTemplate defaultTemplate = null;
int totalModification = (mod.size() * groups.size());
if (totalModification == 1) {
MailType type = BusinessGroupMailing.getDefaultTemplateType(mod);
if (type != null) {
defaultTemplate = BusinessGroupMailing.getDefaultTemplate(type, groups.get(0), ureq.getIdentity());
}
}
MailTemplate template = new BGUserMailTemplate(groups, mod, defaultTemplate);
boolean mandatoryEmail = !mod.getAddParticipants().isEmpty() && groupModule.isMandatoryEnrolmentEmail(ureq.getUserSession().getRoles());
userManagementSendMailController = new BGMailNotificationEditController(getWindowControl(), ureq, template, totalModification == 1, totalModification == 1, false, mandatoryEmail);
Component cmp = userManagementSendMailController.getInitialComponent();
listenTo(userManagementSendMailController);
cmc = new CloseableModalController(getWindowControl(), translate("close"), cmp, true, translate("users.group"));
cmc.activate();
listenTo(cmc);
}
use of org.olat.group.ui.wizard.BGMailNotificationEditController in project openolat by klemens.
the class AbstractBusinessGroupListController method confirmUserManagementEmail.
private void confirmUserManagementEmail(UserRequest ureq, MembershipModification mod, List<BusinessGroup> groups) {
removeAsListenerAndDispose(cmc);
removeAsListenerAndDispose(userManagementSendMailController);
MailTemplate defaultTemplate = null;
int totalModification = (mod.size() * groups.size());
if (totalModification == 1) {
MailType type = BusinessGroupMailing.getDefaultTemplateType(mod);
if (type != null) {
defaultTemplate = BusinessGroupMailing.getDefaultTemplate(type, groups.get(0), ureq.getIdentity());
}
}
MailTemplate template = new BGUserMailTemplate(groups, mod, defaultTemplate);
boolean mandatoryEmail = !mod.getAddParticipants().isEmpty() && groupModule.isMandatoryEnrolmentEmail(ureq.getUserSession().getRoles());
userManagementSendMailController = new BGMailNotificationEditController(getWindowControl(), ureq, template, totalModification == 1, totalModification == 1, false, mandatoryEmail);
Component cmp = userManagementSendMailController.getInitialComponent();
listenTo(userManagementSendMailController);
cmc = new CloseableModalController(getWindowControl(), translate("close"), cmp, true, translate("users.group"));
cmc.activate();
listenTo(cmc);
}
Aggregations