Search in sources :

Example 1 with BGMailNotificationEditController

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);
}
Also used : CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) MailTemplate(org.olat.core.util.mail.MailTemplate) BGUserMailTemplate(org.olat.group.ui.wizard.BGUserMailTemplate) BGMailNotificationEditController(org.olat.group.ui.wizard.BGMailNotificationEditController) BGUserMailTemplate(org.olat.group.ui.wizard.BGUserMailTemplate) MailType(org.olat.group.manager.BusinessGroupMailing.MailType) Component(org.olat.core.gui.components.Component)

Example 2 with BGMailNotificationEditController

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);
}
Also used : CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) MailTemplate(org.olat.core.util.mail.MailTemplate) BGUserMailTemplate(org.olat.group.ui.wizard.BGUserMailTemplate) BGMailNotificationEditController(org.olat.group.ui.wizard.BGMailNotificationEditController) BGUserMailTemplate(org.olat.group.ui.wizard.BGUserMailTemplate) MailType(org.olat.group.manager.BusinessGroupMailing.MailType) Component(org.olat.core.gui.components.Component)

Aggregations

Component (org.olat.core.gui.components.Component)2 CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)2 MailTemplate (org.olat.core.util.mail.MailTemplate)2 MailType (org.olat.group.manager.BusinessGroupMailing.MailType)2 BGMailNotificationEditController (org.olat.group.ui.wizard.BGMailNotificationEditController)2 BGUserMailTemplate (org.olat.group.ui.wizard.BGUserMailTemplate)2