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;
}
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;
}
Aggregations