diff --git a/src/main/java/org/olat/group/ui/main/AbstractBusinessGroupListController.java b/src/main/java/org/olat/group/ui/main/AbstractBusinessGroupListController.java index 19733928c78085566e017ce56ca884fa6f030d75..c5a27dcb7e1513dd5df959db2708481fe92659fa 100644 --- a/src/main/java/org/olat/group/ui/main/AbstractBusinessGroupListController.java +++ b/src/main/java/org/olat/group/ui/main/AbstractBusinessGroupListController.java @@ -651,7 +651,15 @@ public abstract class AbstractBusinessGroupListController extends FormBasicContr return; } - List<BusinessGroup> groups = toBusinessGroups(ureq, items, false); + List<BusinessGroup> groups = toBusinessGroups(ureq, items, true); + if(groups.isEmpty()) { + showWarning("msg.alleastone.editable.group"); + return; + } + if(items.size() != groups.size()) { + showWarning("msg.only.editable.group"); + return; + } boolean enableCoursesCopy = businessGroupService.hasResources(groups); boolean enableAreasCopy = areaManager.countBGAreasOfBusinessGroups(groups) > 0; @@ -717,7 +725,13 @@ public abstract class AbstractBusinessGroupListController extends FormBasicContr if(groups.isEmpty()) { showWarning("msg.alleastone.editable.group"); return; - } else if(CollaborationToolsFactory.getInstance().getAvailableTools() == null) { + } + if(selectedItems.size() != groups.size()) { + showWarning("msg.only.editable.group"); + return; + } + + if(CollaborationToolsFactory.getInstance().getAvailableTools() == null) { //init the available tools CollaborationToolsFactory.getInstance().getOrCreateCollaborationTools(groups.get(0)); } @@ -797,7 +811,15 @@ public abstract class AbstractBusinessGroupListController extends FormBasicContr return; } - List<BusinessGroup> groups = toBusinessGroups(ureq, selectedItems, false); + List<BusinessGroup> groups = toBusinessGroups(ureq, selectedItems, true); + if(groups.isEmpty()) { + showWarning("msg.alleastone.editable.group"); + return; + } + if(selectedItems.size() != groups.size()) { + showWarning("msg.only.editable.group"); + return; + } Step start = new BGEmailSelectReceiversStep(ureq, groups); StepRunnerCallback finish = new StepRunnerCallback() { @@ -831,6 +853,10 @@ public abstract class AbstractBusinessGroupListController extends FormBasicContr showWarning("msg.alleastone.editable.group"); return; } + if(selectedItems.size() != groups.size()) { + showWarning("msg.only.editable.group"); + return; + } StringBuilder managedNames = new StringBuilder(); for(BusinessGroup group:groups) { @@ -943,8 +969,12 @@ public abstract class AbstractBusinessGroupListController extends FormBasicContr } final List<BusinessGroup> groups = toBusinessGroups(ureq, selectedItems, true); - if(groups.isEmpty()) { - showWarning("msg.alleastone.editable.group"); + if(groups.size() < 2) { + showWarning("msg.alleasttwo.editable.group"); + return; + } + if(selectedItems.size() != groups.size()) { + showWarning("msg.only.editable.group"); return; } @@ -990,6 +1020,10 @@ public abstract class AbstractBusinessGroupListController extends FormBasicContr showWarning("msg.alleastone.editable.group"); return; } + if(selectedItems.size() != groups.size()) { + showWarning("msg.only.editable.group"); + return; + } StringBuilder names = new StringBuilder(); StringBuilder managedNames = new StringBuilder(); diff --git a/src/main/java/org/olat/group/ui/main/_i18n/LocalStrings_de.properties b/src/main/java/org/olat/group/ui/main/_i18n/LocalStrings_de.properties index cf56f2dbbd5a0c46e87caea97dc0c3b4256f2e95..67fda2ae7213dcc7b9483e012fe199348af8dd41 100644 --- a/src/main/java/org/olat/group/ui/main/_i18n/LocalStrings_de.properties +++ b/src/main/java/org/olat/group/ui/main/_i18n/LocalStrings_de.properties @@ -44,6 +44,8 @@ open.groups=Ver\u00F6ffentlichte Gruppen open.groups.alt=Arbeitsgruppen in die \u00F6ffentlich sind und an denen ich teilnehmen kann. msg.atleastone=Es muss mindestens ein Betreuer in der Gruppe eingetragen sein. msg.alleastone.editable.group=Sie m\u00FCssen mindestens eine Gruppe w\u00E4hlen, die Sie besitzen. +msg.alleasttwo.editable.group=Sie m\u00FCssen mindestens zwei Gruppe w\u00E4hlen, die Sie besitzen. +msg.only.editable.group=Sie m\u00FCssen Gruppe w\u00E4hlen, die Sie besitzen. user.notfound=Folgende Benutzer wurden nicht gefunden: {0} open.header=\u00F6ffentliche Gruppen diff --git a/src/main/java/org/olat/group/ui/main/_i18n/LocalStrings_en.properties b/src/main/java/org/olat/group/ui/main/_i18n/LocalStrings_en.properties index 8d5c09397ae959f889e022a319915a1f5c9d879f..6b68a76efabb7a4dce00972cdbcde8617dd4a451 100644 --- a/src/main/java/org/olat/group/ui/main/_i18n/LocalStrings_en.properties +++ b/src/main/java/org/olat/group/ui/main/_i18n/LocalStrings_en.properties @@ -66,6 +66,8 @@ menu.index.alt=Work with your groups merge.group=Merge msg.alleastone.editable.group=You must select at least one group you own. msg.atleastone=There must be at least one coach in this group. +msg.alleasttwo.editable.group=You must select at least two groups you own. +msg.only.editable.group=You must select groups you own. my.groups=My groups my.groups.alt=Work with your groups nomembers=No members found that matches the given criteria.