Search in sources :

Example 1 with BGEmailSelectReceiversStep

use of org.olat.group.ui.wizard.BGEmailSelectReceiversStep in project OpenOLAT by OpenOLAT.

the class AbstractBusinessGroupListController method doEmails.

/**
 * @param ureq
 * @param items
 */
private void doEmails(UserRequest ureq, List<? extends BusinessGroupRef> selectedItems) {
    removeAsListenerAndDispose(emailWizard);
    if (selectedItems == null || selectedItems.isEmpty()) {
        showWarning("error.select.one");
        return;
    }
    List<BusinessGroup> groups = toBusinessGroups(ureq, selectedItems, true);
    if (groups.isEmpty()) {
        showWarning("msg.alleastone.editable.group");
        return;
    }
    if (selectedItems.size() != groups.size()) {
        showWarning("msg.only.editable.group");
        return;
    }
    Step start = new BGEmailSelectReceiversStep(ureq, groups);
    StepRunnerCallback finish = new StepRunnerCallback() {

        @Override
        public Step execute(UserRequest uureq, WindowControl wControl, StepsRunContext runContext) {
            // mails are send by the last controller of the wizard
            return StepsMainRunController.DONE_MODIFIED;
        }
    };
    emailWizard = new StepsMainRunController(ureq, getWindowControl(), start, finish, null, translate("email.group"), "o_sel_groups_email_wizard");
    listenTo(emailWizard);
    getWindowControl().pushAsModalDialog(emailWizard.getInitialComponent());
}
Also used : BGCopyBusinessGroup(org.olat.group.ui.wizard.BGCopyBusinessGroup) BGConfigBusinessGroup(org.olat.group.ui.wizard.BGConfigBusinessGroup) BusinessGroup(org.olat.group.BusinessGroup) StepsMainRunController(org.olat.core.gui.control.generic.wizard.StepsMainRunController) Step(org.olat.core.gui.control.generic.wizard.Step) BGCopyPreparationStep(org.olat.group.ui.wizard.BGCopyPreparationStep) BGMergeStep(org.olat.group.ui.wizard.BGMergeStep) BGConfigToolsStep(org.olat.group.ui.wizard.BGConfigToolsStep) BGEmailSelectReceiversStep(org.olat.group.ui.wizard.BGEmailSelectReceiversStep) WindowControl(org.olat.core.gui.control.WindowControl) StepsRunContext(org.olat.core.gui.control.generic.wizard.StepsRunContext) BGEmailSelectReceiversStep(org.olat.group.ui.wizard.BGEmailSelectReceiversStep) StepRunnerCallback(org.olat.core.gui.control.generic.wizard.StepRunnerCallback) UserRequest(org.olat.core.gui.UserRequest)

Example 2 with BGEmailSelectReceiversStep

use of org.olat.group.ui.wizard.BGEmailSelectReceiversStep in project openolat by klemens.

the class AbstractBusinessGroupListController method doEmails.

/**
 * @param ureq
 * @param items
 */
private void doEmails(UserRequest ureq, List<? extends BusinessGroupRef> selectedItems) {
    removeAsListenerAndDispose(emailWizard);
    if (selectedItems == null || selectedItems.isEmpty()) {
        showWarning("error.select.one");
        return;
    }
    List<BusinessGroup> groups = toBusinessGroups(ureq, selectedItems, true);
    if (groups.isEmpty()) {
        showWarning("msg.alleastone.editable.group");
        return;
    }
    if (selectedItems.size() != groups.size()) {
        showWarning("msg.only.editable.group");
        return;
    }
    Step start = new BGEmailSelectReceiversStep(ureq, groups);
    StepRunnerCallback finish = new StepRunnerCallback() {

        @Override
        public Step execute(UserRequest uureq, WindowControl wControl, StepsRunContext runContext) {
            // mails are send by the last controller of the wizard
            return StepsMainRunController.DONE_MODIFIED;
        }
    };
    emailWizard = new StepsMainRunController(ureq, getWindowControl(), start, finish, null, translate("email.group"), "o_sel_groups_email_wizard");
    listenTo(emailWizard);
    getWindowControl().pushAsModalDialog(emailWizard.getInitialComponent());
}
Also used : BGCopyBusinessGroup(org.olat.group.ui.wizard.BGCopyBusinessGroup) BGConfigBusinessGroup(org.olat.group.ui.wizard.BGConfigBusinessGroup) BusinessGroup(org.olat.group.BusinessGroup) StepsMainRunController(org.olat.core.gui.control.generic.wizard.StepsMainRunController) Step(org.olat.core.gui.control.generic.wizard.Step) BGCopyPreparationStep(org.olat.group.ui.wizard.BGCopyPreparationStep) BGMergeStep(org.olat.group.ui.wizard.BGMergeStep) BGConfigToolsStep(org.olat.group.ui.wizard.BGConfigToolsStep) BGEmailSelectReceiversStep(org.olat.group.ui.wizard.BGEmailSelectReceiversStep) WindowControl(org.olat.core.gui.control.WindowControl) StepsRunContext(org.olat.core.gui.control.generic.wizard.StepsRunContext) BGEmailSelectReceiversStep(org.olat.group.ui.wizard.BGEmailSelectReceiversStep) StepRunnerCallback(org.olat.core.gui.control.generic.wizard.StepRunnerCallback) UserRequest(org.olat.core.gui.UserRequest)

Aggregations

UserRequest (org.olat.core.gui.UserRequest)2 WindowControl (org.olat.core.gui.control.WindowControl)2 Step (org.olat.core.gui.control.generic.wizard.Step)2 StepRunnerCallback (org.olat.core.gui.control.generic.wizard.StepRunnerCallback)2 StepsMainRunController (org.olat.core.gui.control.generic.wizard.StepsMainRunController)2 StepsRunContext (org.olat.core.gui.control.generic.wizard.StepsRunContext)2 BusinessGroup (org.olat.group.BusinessGroup)2 BGConfigBusinessGroup (org.olat.group.ui.wizard.BGConfigBusinessGroup)2 BGConfigToolsStep (org.olat.group.ui.wizard.BGConfigToolsStep)2 BGCopyBusinessGroup (org.olat.group.ui.wizard.BGCopyBusinessGroup)2 BGCopyPreparationStep (org.olat.group.ui.wizard.BGCopyPreparationStep)2 BGEmailSelectReceiversStep (org.olat.group.ui.wizard.BGEmailSelectReceiversStep)2 BGMergeStep (org.olat.group.ui.wizard.BGMergeStep)2