Index: lams_central/src/java/org/lamsfoundation/lams/web/OrganisationGroupAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/web/OrganisationGroupAction.java,v diff -u -r1.9.2.10 -r1.9.2.11 --- lams_central/src/java/org/lamsfoundation/lams/web/OrganisationGroupAction.java 11 Oct 2016 10:34:01 -0000 1.9.2.10 +++ lams_central/src/java/org/lamsfoundation/lams/web/OrganisationGroupAction.java 3 Nov 2016 16:04:03 -0000 1.9.2.11 @@ -455,7 +455,6 @@ /** * Fetches course and branching so they can get matched by user. */ - @SuppressWarnings("unchecked") public ActionForward getGroupsForMapping(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, JSONException { Long orgGroupingId = WebUtil.readLongParam(request, "groupingId"); @@ -471,11 +470,10 @@ groupJSON.put("name", group.getName()); groupsJSON.put(groupJSON); } + Activity branchingActivity = (Activity) getUserManagementService().findById(Activity.class, activityID); + Grouping grouping = branchingActivity.getGrouping(); - GroupingActivity branchingGrouping = (GroupingActivity) getUserManagementService().findById(Activity.class, - activityID); JSONArray branchesJSON = new JSONArray(); - Grouping grouping = branchingGrouping.getCreateGrouping(); SortedSet groups = new TreeSet(grouping.getGroups()); for (Group group : groups) { JSONObject groupJSON = new JSONObject(); @@ -593,7 +591,6 @@ /** * Checks if lesson-level groups exist for the given activity. */ - @SuppressWarnings("unchecked") private Grouping getLessonGrouping(HttpServletRequest request, Long activityID, boolean allowDefault) { if (activityID != null) { // we need to fetch real objects instead of stubs/proxies @@ -608,7 +605,6 @@ boolean isUsedForBranching = grouping.isUsedForBranching(); request.setAttribute(GroupingAJAXAction.PARAM_USED_FOR_BRANCHING, isUsedForBranching); - // check if it is immutable (for branching) or default groups are allowed return !groups.isEmpty() && (allowDefault || !isDefaultChosenGrouping(grouping)) ? grouping : null; } } @@ -620,18 +616,17 @@ * Check if the given groups are default for chosen grouping. There is actually no good way to detect this, but even * if a custom grouping is mistaken for the default one, it should bring little harm. */ - @SuppressWarnings("unchecked") private boolean isDefaultChosenGrouping(Grouping grouping) { Set groups = grouping.getGroups(); - if ((groups == null) || (grouping.getMaxNumberOfGroups() == null) - || !grouping.getMaxNumberOfGroups().equals(groups.size())) { - return false; - } for (Group group : groups) { if (!group.getUsers().isEmpty()) { return false; } } + if (groups == null || (grouping.getMaxNumberOfGroups() != null + && !grouping.getMaxNumberOfGroups().equals(groups.size()))) { + return false; + } return true; } Index: lams_central/web/orgGroup.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/orgGroup.jsp,v diff -u -r1.4.2.8 -r1.4.2.9 --- lams_central/web/orgGroup.jsp 31 Oct 2016 16:16:34 -0000 1.4.2.8 +++ lams_central/web/orgGroup.jsp 3 Nov 2016 16:04:03 -0000 1.4.2.9 @@ -50,43 +50,33 @@ -
- - - - - - - - - readonly="readonly" - - /> - - - - - - - + +
+ + + readonly="readonly" - - - -
+
+ +
+
Index: lams_central/web/orgGrouping.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/orgGrouping.jsp,v diff -u -r1.3.2.7 -r1.3.2.8 --- lams_central/web/orgGrouping.jsp 31 Oct 2016 16:16:34 -0000 1.3.2.7 +++ lams_central/web/orgGrouping.jsp 3 Nov 2016 16:04:03 -0000 1.3.2.8 @@ -8,59 +8,21 @@ + - + +