Search in sources :

Example 1 with GroupsAndRightsController

use of org.olat.course.groupsandrights.GroupsAndRightsController in project OpenOLAT by OpenOLAT.

the class MembersManagementMainController method selectMenuItem.

private Controller selectMenuItem(UserRequest ureq, String cmd) {
    OLATResourceable ores = OresHelper.createOLATResourceableInstance(cmd, 0l);
    ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
    WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ores, null, getWindowControl());
    addToHistory(ureq, bwControl);
    Controller selectedCtrl = null;
    if (CMD_MEMBERS.equals(cmd)) {
        if (entryAdmin || memberManagementRight) {
            if (membersOverviewCtrl == null) {
                membersOverviewCtrl = new MembersOverviewController(ureq, bwControl, toolbarPanel, repoEntry, coachCourseEnv);
                listenTo(membersOverviewCtrl);
            } else if (membersDirty) {
                membersOverviewCtrl.reloadMembers();
            }
            mainVC.put("content", membersOverviewCtrl.getInitialComponent());
            selectedCtrl = membersOverviewCtrl;
        }
    } else if (CMD_GROUPS.equals(cmd)) {
        if (entryAdmin || memberManagementRight || groupManagementRight) {
            if (groupsCtrl == null) {
                groupsCtrl = new CourseBusinessGroupListController(ureq, bwControl, repoEntry, entryAdmin || groupManagementRight, coachCourseEnv.isCourseReadOnly());
                listenTo(groupsCtrl);
            }
            groupsCtrl.reloadModel();
            mainVC.put("content", groupsCtrl.getInitialComponent());
            selectedCtrl = groupsCtrl;
        }
    } else if (CMD_BOOKING.equals(cmd)) {
        if (acModule.isEnabled() && (entryAdmin || memberManagementRight)) {
            if (ordersController == null) {
                ordersController = new OrdersAdminController(ureq, bwControl, toolbarPanel, repoEntry.getOlatResource());
                listenTo(ordersController);
            }
            mainVC.put("content", ordersController.getInitialComponent());
            selectedCtrl = ordersController;
        }
    } else if (CMD_RIGHTS.equals(cmd)) {
        if (entryAdmin) {
            if (rightsController == null) {
                rightsController = new GroupsAndRightsController(ureq, bwControl, repoEntry, coachCourseEnv.isCourseReadOnly());
                listenTo(rightsController);
            }
            mainVC.put("content", rightsController.getInitialComponent());
            selectedCtrl = rightsController;
        }
    }
    TreeNode selTreeNode = TreeHelper.findNodeByUserObject(cmd, menuTree.getTreeModel().getRootNode());
    if (selTreeNode != null && !selTreeNode.getIdent().equals(menuTree.getSelectedNodeId())) {
        menuTree.setSelectedNodeId(selTreeNode.getIdent());
    }
    return selectedCtrl;
}
Also used : OLATResourceable(org.olat.core.id.OLATResourceable) GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode) TreeNode(org.olat.core.gui.components.tree.TreeNode) OrdersAdminController(org.olat.resource.accesscontrol.ui.OrdersAdminController) GroupsAndRightsController(org.olat.course.groupsandrights.GroupsAndRightsController) WindowControl(org.olat.core.gui.control.WindowControl) GroupsAndRightsController(org.olat.course.groupsandrights.GroupsAndRightsController) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) Controller(org.olat.core.gui.control.Controller) MainLayoutBasicController(org.olat.core.gui.control.controller.MainLayoutBasicController) OrdersAdminController(org.olat.resource.accesscontrol.ui.OrdersAdminController)

Example 2 with GroupsAndRightsController

use of org.olat.course.groupsandrights.GroupsAndRightsController in project openolat by klemens.

the class MembersManagementMainController method selectMenuItem.

private Controller selectMenuItem(UserRequest ureq, String cmd) {
    OLATResourceable ores = OresHelper.createOLATResourceableInstance(cmd, 0l);
    ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
    WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ores, null, getWindowControl());
    addToHistory(ureq, bwControl);
    Controller selectedCtrl = null;
    if (CMD_MEMBERS.equals(cmd)) {
        if (entryAdmin || memberManagementRight) {
            if (membersOverviewCtrl == null) {
                membersOverviewCtrl = new MembersOverviewController(ureq, bwControl, toolbarPanel, repoEntry, coachCourseEnv);
                listenTo(membersOverviewCtrl);
            } else if (membersDirty) {
                membersOverviewCtrl.reloadMembers();
            }
            mainVC.put("content", membersOverviewCtrl.getInitialComponent());
            selectedCtrl = membersOverviewCtrl;
        }
    } else if (CMD_GROUPS.equals(cmd)) {
        if (entryAdmin || memberManagementRight || groupManagementRight) {
            if (groupsCtrl == null) {
                groupsCtrl = new CourseBusinessGroupListController(ureq, bwControl, repoEntry, entryAdmin || groupManagementRight, coachCourseEnv.isCourseReadOnly());
                listenTo(groupsCtrl);
            }
            groupsCtrl.reloadModel();
            mainVC.put("content", groupsCtrl.getInitialComponent());
            selectedCtrl = groupsCtrl;
        }
    } else if (CMD_BOOKING.equals(cmd)) {
        if (acModule.isEnabled() && (entryAdmin || memberManagementRight)) {
            if (ordersController == null) {
                ordersController = new OrdersAdminController(ureq, bwControl, toolbarPanel, repoEntry.getOlatResource());
                listenTo(ordersController);
            }
            mainVC.put("content", ordersController.getInitialComponent());
            selectedCtrl = ordersController;
        }
    } else if (CMD_RIGHTS.equals(cmd)) {
        if (entryAdmin) {
            if (rightsController == null) {
                rightsController = new GroupsAndRightsController(ureq, bwControl, repoEntry, coachCourseEnv.isCourseReadOnly());
                listenTo(rightsController);
            }
            mainVC.put("content", rightsController.getInitialComponent());
            selectedCtrl = rightsController;
        }
    }
    TreeNode selTreeNode = TreeHelper.findNodeByUserObject(cmd, menuTree.getTreeModel().getRootNode());
    if (selTreeNode != null && !selTreeNode.getIdent().equals(menuTree.getSelectedNodeId())) {
        menuTree.setSelectedNodeId(selTreeNode.getIdent());
    }
    return selectedCtrl;
}
Also used : OLATResourceable(org.olat.core.id.OLATResourceable) GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode) TreeNode(org.olat.core.gui.components.tree.TreeNode) OrdersAdminController(org.olat.resource.accesscontrol.ui.OrdersAdminController) GroupsAndRightsController(org.olat.course.groupsandrights.GroupsAndRightsController) WindowControl(org.olat.core.gui.control.WindowControl) GroupsAndRightsController(org.olat.course.groupsandrights.GroupsAndRightsController) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) Controller(org.olat.core.gui.control.Controller) MainLayoutBasicController(org.olat.core.gui.control.controller.MainLayoutBasicController) OrdersAdminController(org.olat.resource.accesscontrol.ui.OrdersAdminController)

Aggregations

LayoutMain3ColsController (org.olat.core.commons.fullWebApp.LayoutMain3ColsController)2 GenericTreeNode (org.olat.core.gui.components.tree.GenericTreeNode)2 TreeNode (org.olat.core.gui.components.tree.TreeNode)2 Controller (org.olat.core.gui.control.Controller)2 WindowControl (org.olat.core.gui.control.WindowControl)2 MainLayoutBasicController (org.olat.core.gui.control.controller.MainLayoutBasicController)2 OLATResourceable (org.olat.core.id.OLATResourceable)2 GroupsAndRightsController (org.olat.course.groupsandrights.GroupsAndRightsController)2 OrdersAdminController (org.olat.resource.accesscontrol.ui.OrdersAdminController)2