Search in sources :

Example 1 with NewAreaController

use of org.olat.group.ui.NewAreaController in project OpenOLAT by OpenOLAT.

the class CourseAreasController method event.

@Override
protected void event(UserRequest ureq, Component source, Event event) {
    if (source == createAreaLink) {
        removeAsListenerAndDispose(newAreaController);
        newAreaController = new NewAreaController(ureq, getWindowControl(), resource, false, null);
        listenTo(newAreaController);
        // wrap in velocity container to add help, title
        createVC = createVelocityContainer("area_create");
        createVC.put("areaForm", newAreaController.getInitialComponent());
        mainPanel.pushContent(createVC);
    }
}
Also used : NewAreaController(org.olat.group.ui.NewAreaController)

Example 2 with NewAreaController

use of org.olat.group.ui.NewAreaController in project OpenOLAT by OpenOLAT.

the class ConditionConfigEasyController method formInnerEvent.

@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
    if (source == chooseGroupsLink) {
        removeAsListenerAndDispose(cmc);
        removeAsListenerAndDispose(groupChooseC);
        List<Long> groupKeys = getKeys(easyGroupList);
        groupChooseC = new GroupSelectionController(ureq, getWindowControl(), true, courseEditorEnv.getCourseGroupManager(), groupKeys);
        listenTo(groupChooseC);
        cmc = new CloseableModalController(getWindowControl(), "close", groupChooseC.getInitialComponent(), true, getTranslator().translate("popupchoosegroups"));
        listenTo(cmc);
        cmc.activate();
    } else if (source == createGroupsLink) {
        removeAsListenerAndDispose(cmc);
        removeAsListenerAndDispose(groupCreateCtlr);
        OLATResource courseResource = courseEditorEnv.getCourseGroupManager().getCourseResource();
        RepositoryEntry courseRe = RepositoryManager.getInstance().lookupRepositoryEntry(courseResource, false);
        groupCreateCtlr = new NewBGController(ureq, getWindowControl(), courseRe, true, null);
        listenTo(groupCreateCtlr);
        cmc = new CloseableModalController(getWindowControl(), "close", groupCreateCtlr.getInitialComponent());
        listenTo(cmc);
        cmc.activate();
    } else if (source == chooseAreasLink) {
        removeAsListenerAndDispose(cmc);
        removeAsListenerAndDispose(areaChooseC);
        areaChooseC = new AreaSelectionController(ureq, getWindowControl(), true, courseEditorEnv.getCourseGroupManager(), getKeys(easyAreaList));
        listenTo(areaChooseC);
        cmc = new CloseableModalController(getWindowControl(), "close", areaChooseC.getInitialComponent(), true, getTranslator().translate("popupchooseareas"));
        listenTo(cmc);
        cmc.activate();
    } else if (source == createAreasLink) {
        removeAsListenerAndDispose(cmc);
        removeAsListenerAndDispose(areaCreateCtlr);
        OLATResource courseResource = courseEditorEnv.getCourseGroupManager().getCourseResource();
        areaCreateCtlr = new NewAreaController(ureq, getWindowControl(), courseResource, true, null);
        listenTo(areaCreateCtlr);
        cmc = new CloseableModalController(getWindowControl(), "close", areaCreateCtlr.getInitialComponent());
        listenTo(cmc);
        cmc.activate();
    } else if (source == fixGroupError) {
        // user wants to fix problem with fixing group error link e.g. create one
        // or more group at once.
        String[] csvGroupName = (String[]) fixGroupError.getUserObject();
        OLATResource courseResource = courseEditorEnv.getCourseGroupManager().getCourseResource();
        RepositoryEntry courseRe = RepositoryManager.getInstance().lookupRepositoryEntry(courseResource, false);
        removeAsListenerAndDispose(groupCreateCtlr);
        groupCreateCtlr = new NewBGController(ureq, getWindowControl(), courseRe, true, csvGroupName[0]);
        listenTo(groupCreateCtlr);
        removeAsListenerAndDispose(cmc);
        cmc = new CloseableModalController(getWindowControl(), "close", groupCreateCtlr.getInitialComponent());
        listenTo(cmc);
        cmc.activate();
    } else if (source == fixAreaError) {
        /*
			 * user wants to fix problem with fixing area error link e.g. create one
			 * or more areas at once.
			 */
        String[] csvAreaName = (String[]) fixAreaError.getUserObject();
        OLATResource courseResource = courseEditorEnv.getCourseGroupManager().getCourseResource();
        removeAsListenerAndDispose(areaCreateCtlr);
        areaCreateCtlr = new NewAreaController(ureq, getWindowControl(), courseResource, true, csvAreaName[0]);
        listenTo(areaCreateCtlr);
        removeAsListenerAndDispose(cmc);
        cmc = new CloseableModalController(getWindowControl(), "close", areaCreateCtlr.getInitialComponent());
        listenTo(cmc);
        cmc.activate();
    }
}
Also used : CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) OLATResource(org.olat.resource.OLATResource) NewAreaController(org.olat.group.ui.NewAreaController) RepositoryEntry(org.olat.repository.RepositoryEntry) NewBGController(org.olat.group.ui.NewBGController)

Example 3 with NewAreaController

use of org.olat.group.ui.NewAreaController in project OpenOLAT by OpenOLAT.

the class ENEditGroupAreaFormController method formInnerEvent.

@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
    if (source == allowMultipleEnroll) {
        if (allowMultipleEnroll.isSelected(0)) {
            multipleEnrollCount.setVisible(true);
        } else {
            multipleEnrollCount.setVisible(false);
        }
    } else if (source == chooseGroupsLink) {
        removeAsListenerAndDispose(groupChooseC);
        groupChooseC = new GroupSelectionController(ureq, getWindowControl(), true, cev.getCourseGroupManager(), getKeys(easyGroupList));
        listenTo(groupChooseC);
        removeAsListenerAndDispose(cmc);
        cmc = new CloseableModalController(getWindowControl(), "close", groupChooseC.getInitialComponent());
        listenTo(cmc);
        cmc.activate();
        subm.setEnabled(false);
    } else if (source == chooseAreasLink) {
        removeAsListenerAndDispose(cmc);
        removeAsListenerAndDispose(areaChooseC);
        // already areas -> choose areas
        areaChooseC = new AreaSelectionController(ureq, getWindowControl(), true, cev.getCourseGroupManager(), getKeys(easyAreaList));
        listenTo(areaChooseC);
        cmc = new CloseableModalController(getWindowControl(), "close", areaChooseC.getInitialComponent());
        listenTo(cmc);
        cmc.activate();
        subm.setEnabled(false);
    } else if (source == fixGroupError) {
        /*
			 * user wants to fix problem with fixing group error link e.g. create one
			 * or more group at once.
			 */
        String[] csvGroupName = (String[]) fixGroupError.getUserObject();
        easyGroupList.setEnabled(false);
        removeAsListenerAndDispose(groupCreateCntrllr);
        OLATResource courseResource = this.cev.getCourseGroupManager().getCourseResource();
        RepositoryEntry courseRe = RepositoryManager.getInstance().lookupRepositoryEntry(courseResource, false);
        groupCreateCntrllr = new NewBGController(ureq, getWindowControl(), courseRe, true, csvGroupName[0]);
        listenTo(groupCreateCntrllr);
        removeAsListenerAndDispose(cmc);
        cmc = new CloseableModalController(getWindowControl(), "close", groupCreateCntrllr.getInitialComponent());
        listenTo(cmc);
        cmc.activate();
        subm.setEnabled(false);
    } else if (source == fixAreaError) {
        /*
			 * user wants to fix problem with fixing area error link e.g. create one
			 * or more areas at once.
			 */
        String[] csvAreaName = (String[]) fixAreaError.getUserObject();
        easyAreaList.setEnabled(false);
        removeAsListenerAndDispose(areaCreateCntrllr);
        OLATResource courseResource = this.cev.getCourseGroupManager().getCourseResource();
        areaCreateCntrllr = new NewAreaController(ureq, getWindowControl(), courseResource, true, csvAreaName[0]);
        listenTo(areaCreateCntrllr);
        removeAsListenerAndDispose(cmc);
        cmc = new CloseableModalController(getWindowControl(), "close", areaCreateCntrllr.getInitialComponent());
        listenTo(cmc);
        cmc.activate();
        subm.setEnabled(false);
    }
}
Also used : GroupSelectionController(org.olat.course.condition.GroupSelectionController) CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) OLATResource(org.olat.resource.OLATResource) NewAreaController(org.olat.group.ui.NewAreaController) RepositoryEntry(org.olat.repository.RepositoryEntry) NewBGController(org.olat.group.ui.NewBGController) AreaSelectionController(org.olat.course.condition.AreaSelectionController)

Example 4 with NewAreaController

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

the class ENEditGroupAreaFormController method formInnerEvent.

@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
    if (source == allowMultipleEnroll) {
        if (allowMultipleEnroll.isSelected(0)) {
            multipleEnrollCount.setVisible(true);
        } else {
            multipleEnrollCount.setVisible(false);
        }
    } else if (source == chooseGroupsLink) {
        removeAsListenerAndDispose(groupChooseC);
        groupChooseC = new GroupSelectionController(ureq, getWindowControl(), true, cev.getCourseGroupManager(), getKeys(easyGroupList));
        listenTo(groupChooseC);
        removeAsListenerAndDispose(cmc);
        cmc = new CloseableModalController(getWindowControl(), "close", groupChooseC.getInitialComponent());
        listenTo(cmc);
        cmc.activate();
        subm.setEnabled(false);
    } else if (source == chooseAreasLink) {
        removeAsListenerAndDispose(cmc);
        removeAsListenerAndDispose(areaChooseC);
        // already areas -> choose areas
        areaChooseC = new AreaSelectionController(ureq, getWindowControl(), true, cev.getCourseGroupManager(), getKeys(easyAreaList));
        listenTo(areaChooseC);
        cmc = new CloseableModalController(getWindowControl(), "close", areaChooseC.getInitialComponent());
        listenTo(cmc);
        cmc.activate();
        subm.setEnabled(false);
    } else if (source == fixGroupError) {
        /*
			 * user wants to fix problem with fixing group error link e.g. create one
			 * or more group at once.
			 */
        String[] csvGroupName = (String[]) fixGroupError.getUserObject();
        easyGroupList.setEnabled(false);
        removeAsListenerAndDispose(groupCreateCntrllr);
        OLATResource courseResource = this.cev.getCourseGroupManager().getCourseResource();
        RepositoryEntry courseRe = RepositoryManager.getInstance().lookupRepositoryEntry(courseResource, false);
        groupCreateCntrllr = new NewBGController(ureq, getWindowControl(), courseRe, true, csvGroupName[0]);
        listenTo(groupCreateCntrllr);
        removeAsListenerAndDispose(cmc);
        cmc = new CloseableModalController(getWindowControl(), "close", groupCreateCntrllr.getInitialComponent());
        listenTo(cmc);
        cmc.activate();
        subm.setEnabled(false);
    } else if (source == fixAreaError) {
        /*
			 * user wants to fix problem with fixing area error link e.g. create one
			 * or more areas at once.
			 */
        String[] csvAreaName = (String[]) fixAreaError.getUserObject();
        easyAreaList.setEnabled(false);
        removeAsListenerAndDispose(areaCreateCntrllr);
        OLATResource courseResource = this.cev.getCourseGroupManager().getCourseResource();
        areaCreateCntrllr = new NewAreaController(ureq, getWindowControl(), courseResource, true, csvAreaName[0]);
        listenTo(areaCreateCntrllr);
        removeAsListenerAndDispose(cmc);
        cmc = new CloseableModalController(getWindowControl(), "close", areaCreateCntrllr.getInitialComponent());
        listenTo(cmc);
        cmc.activate();
        subm.setEnabled(false);
    }
}
Also used : GroupSelectionController(org.olat.course.condition.GroupSelectionController) CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) OLATResource(org.olat.resource.OLATResource) NewAreaController(org.olat.group.ui.NewAreaController) RepositoryEntry(org.olat.repository.RepositoryEntry) NewBGController(org.olat.group.ui.NewBGController) AreaSelectionController(org.olat.course.condition.AreaSelectionController)

Example 5 with NewAreaController

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

the class CourseAreasController method event.

@Override
protected void event(UserRequest ureq, Component source, Event event) {
    if (source == createAreaLink) {
        removeAsListenerAndDispose(newAreaController);
        newAreaController = new NewAreaController(ureq, getWindowControl(), resource, false, null);
        listenTo(newAreaController);
        // wrap in velocity container to add help, title
        createVC = createVelocityContainer("area_create");
        createVC.put("areaForm", newAreaController.getInitialComponent());
        mainPanel.pushContent(createVC);
    }
}
Also used : NewAreaController(org.olat.group.ui.NewAreaController)

Aggregations

NewAreaController (org.olat.group.ui.NewAreaController)8 CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)6 NewBGController (org.olat.group.ui.NewBGController)4 RepositoryEntry (org.olat.repository.RepositoryEntry)4 OLATResource (org.olat.resource.OLATResource)4 AreaSelectionController (org.olat.course.condition.AreaSelectionController)2 GroupSelectionController (org.olat.course.condition.GroupSelectionController)2