Uploaded image for project: 'OpenOLAT'
  1. OpenOLAT
  2. OO-1891

Better sorting of roles in member management

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.4.6
    • Fix Version/s: 10.4.7
    • Component/s: None
    • Labels:
      None

      Description

      The sorting of course members by roles shows not the expected result. It's not possible to bundle up course members which are also group members and only course members. This is because the main attribute for sorting is "course membership". I think it would be better to compare at first group memberships and after that course memberships because in most cases the group membership implies course membership.

      This is my suggestion for a better sorting:

      diff --git a/src/main/java/org/olat/group/ui/main/CourseMembershipComparator.java b/src/main/java/org/olat/group/ui/main/CourseMembershipComparator.java
      --- a/src/main/java/org/olat/group/ui/main/CourseMembershipComparator.java
      +++ b/src/main/java/org/olat/group/ui/main/CourseMembershipComparator.java
      @@ -41,21 +41,21 @@
       			return -1;
       		}
       		
      -		if(m1.isRepoTutor() || m1.isGroupTutor()) {
      -			if(m2.isRepoTutor() || m2.isGroupTutor()) {
      +		if(m1.isGroupTutor()) {
      +			if(m2.isGroupTutor()) {
       				return 0;
       			}
       			return 1;
      -		} else if(m2.isRepoTutor() || m2.isGroupTutor()) {
      +		} else if(m2.isGroupTutor()) {
       			return -1;
       		}
       		
      -		if(m1.isRepoParticipant() || m1.isGroupParticipant()) {
      -			if(m2.isRepoParticipant() || m2.isGroupParticipant()) {
      +		if(m1.isRepoTutor()) {
      +			if(m2.isRepoTutor()) {
       				return 0;
       			}
       			return 1;
      -		} else if(m2.isRepoParticipant() || m2.isGroupParticipant()) {
      +		} else if(m2.isRepoTutor()) {
       			return -1;
       		}
       		
      @@ -67,6 +67,24 @@
       		} else if(m2.isGroupWaiting()) {
       			return -1;
       		}
      +		
      +		if(m1.isGroupParticipant()) {
      +			if(m2.isGroupParticipant()) {
      +				return 0;
      +			}
      +			return 1;
      +		} else if(m2.isGroupParticipant()) {
      +			return -1;
      +		}
      +		
      +		if(m1.isRepoParticipant()) {
      +			if(m2.isRepoParticipant()) {
      +				return 0;
      +			}
      +			return 1;
      +		} else if(m2.isRepoParticipant()) {
      +			return -1;
      +		}
       		return 0;
       	}
       }
      

        Attachments

          Activity

            People

            • Assignee:
              srosse Stéphane Rossé
              Reporter:
              stephan Stephan Clemenz
              Tester:
              Stephan Clemenz
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 20 minutes
                20m