diff --git a/src/main/java/org/olat/group/ui/main/AbstractMemberListController.java b/src/main/java/org/olat/group/ui/main/AbstractMemberListController.java index 003f4422f4c97e86673d086c3ed0d9403d24c898..a251aa5534e1341f364348073570dbb47e7806c5 100644 --- a/src/main/java/org/olat/group/ui/main/AbstractMemberListController.java +++ b/src/main/java/org/olat/group/ui/main/AbstractMemberListController.java @@ -669,7 +669,12 @@ public abstract class AbstractMemberListController extends FormBasicController i } ContactMessage contactMessage = new ContactMessage(getIdentity()); - String name = repoEntry != null ? repoEntry.getDisplayname() : businessGroup.getName(); + String name; + if(identities.size() == 1) { + name = userManager.getUserDisplayName(identities.get(0)); + } else { + name = repoEntry != null ? repoEntry.getDisplayname() : businessGroup.getName(); + } ContactList contactList = new ContactList(name); contactList.addAllIdentites(identities); contactMessage.addEmailTo(contactList); diff --git a/src/main/java/org/olat/ims/qti21/ui/AssessmentTestDisplayController.java b/src/main/java/org/olat/ims/qti21/ui/AssessmentTestDisplayController.java index e41c3fa70bc769ec30ed7e863ee489b1d2455fd5..3f3914fd35a7d531c8a7032c08b5e10f0d90fc18 100644 --- a/src/main/java/org/olat/ims/qti21/ui/AssessmentTestDisplayController.java +++ b/src/main/java/org/olat/ims/qti21/ui/AssessmentTestDisplayController.java @@ -2356,7 +2356,7 @@ public class AssessmentTestDisplayController extends BasicController implements deliveryOptions.getAssessmentResultsOptions(), false, true, true); listenTo(resultCtrl); flc.add("qtiResults", resultCtrl.getInitialFormItem()); - if(cSession.isAuthorMode()) { + if(cSession.isAuthorMode() && cSession.getTestEntry().equals(cSession.getRepositoryEntry())) { restartTest.setVisible(true); } resultsVisible = true; diff --git a/src/main/java/org/olat/modules/bigbluebutton/BigBlueButtonTemplatePermissions.java b/src/main/java/org/olat/modules/bigbluebutton/BigBlueButtonTemplatePermissions.java index 5bb1ba809382d13b4addfd4d9894c48d62473002..99a561f7120a359e58477f48c25e14ed4875e127 100644 --- a/src/main/java/org/olat/modules/bigbluebutton/BigBlueButtonTemplatePermissions.java +++ b/src/main/java/org/olat/modules/bigbluebutton/BigBlueButtonTemplatePermissions.java @@ -20,12 +20,11 @@ package org.olat.modules.bigbluebutton; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import org.olat.core.util.StringHelper; -import edu.emory.mathcs.backport.java.util.Collections; - /** * * Initial date: 24 mars 2020<br> diff --git a/src/main/java/org/olat/modules/bigbluebutton/ui/BigBlueButtonUIHelper.java b/src/main/java/org/olat/modules/bigbluebutton/ui/BigBlueButtonUIHelper.java index 7ce5fb94cfe52ede0b330de4fe54ff1d8b306de4..d22c4b74676e47f292f67b5bfb1bfa8a2a1aa2bf 100644 --- a/src/main/java/org/olat/modules/bigbluebutton/ui/BigBlueButtonUIHelper.java +++ b/src/main/java/org/olat/modules/bigbluebutton/ui/BigBlueButtonUIHelper.java @@ -25,12 +25,12 @@ import java.util.Date; import java.util.List; import org.olat.core.CoreSpringFactory; -import org.olat.core.gui.components.form.flexible.FormItem; import org.olat.core.gui.components.form.flexible.elements.DateChooser; import org.olat.core.gui.components.form.flexible.elements.SingleSelection; import org.olat.core.gui.components.form.flexible.elements.TextElement; import org.olat.core.gui.components.util.KeyValues; import org.olat.core.gui.translator.Translator; +import org.olat.core.util.CodeHelper; import org.olat.core.util.StringHelper; import org.olat.modules.bigbluebutton.BigBlueButtonDispatcher; import org.olat.modules.bigbluebutton.BigBlueButtonManager; @@ -46,7 +46,7 @@ import org.olat.modules.bigbluebutton.BigBlueButtonMeetingTemplate; */ public class BigBlueButtonUIHelper { - public static void updateTemplateInformations(SingleSelection templateEl, FormItem externalLinkEl, List<BigBlueButtonMeetingTemplate> templates) { + public static void updateTemplateInformations(SingleSelection templateEl, TextElement externalLinkEl, List<BigBlueButtonMeetingTemplate> templates) { templateEl.setExampleKey(null, null); if(templateEl.isOneSelected()) { BigBlueButtonMeetingTemplate template = getSelectedTemplate(templateEl, templates); @@ -60,7 +60,11 @@ public class BigBlueButtonUIHelper { templateEl.setExampleKey("template.explain.max.participants", args); } } - externalLinkEl.setVisible(template != null && template.isExternalUsersAllowed()); + boolean visible = template != null && template.isExternalUsersAllowed(); + externalLinkEl.setVisible(visible); + if(visible && !StringHelper.containsNonWhitespace(externalLinkEl.getValue())) { + externalLinkEl.setValue(Long.toString(CodeHelper.getForeverUniqueID())); + } } else { externalLinkEl.setVisible(false); } diff --git a/src/main/java/org/olat/modules/lecture/ui/AppealListRepositoryDataModel.java b/src/main/java/org/olat/modules/lecture/ui/AppealListRepositoryDataModel.java index 2b017a27526b7b7047ec167db1a0b9298b9ce040..00ca7c6b16cfb629b1d0cce7858f9de1e56c53e9 100644 --- a/src/main/java/org/olat/modules/lecture/ui/AppealListRepositoryDataModel.java +++ b/src/main/java/org/olat/modules/lecture/ui/AppealListRepositoryDataModel.java @@ -44,6 +44,8 @@ import org.olat.modules.lecture.model.LectureBlockAndRollCall; public class AppealListRepositoryDataModel extends DefaultFlexiTableDataModel<AppealRollCallRow> implements SortableFlexiTableDataModel<AppealRollCallRow>, FilterableFlexiTableModel { + private static final AppealCols[] COLS = AppealCols.values(); + private final Locale locale; private final boolean authorizedAbsenceEnabled; private final boolean absenceDefaultAuthorized; @@ -61,7 +63,8 @@ implements SortableFlexiTableDataModel<AppealRollCallRow>, FilterableFlexiTableM @Override public void sort(SortKey orderBy) { if(orderBy != null) { - List<AppealRollCallRow> rows = new AppealListRepositorySortDelegate(orderBy, this, locale).sort(); + List<AppealRollCallRow> rows = new AppealListRepositorySortDelegate(orderBy, this, + authorizedAbsenceEnabled, absenceDefaultAuthorized, locale).sort(); super.setObjects(rows); } } @@ -100,7 +103,7 @@ implements SortableFlexiTableDataModel<AppealRollCallRow>, FilterableFlexiTableM @Override public Object getValueAt(AppealRollCallRow row, int col) { if(col < AppealListRepositoryController.USER_PROPS_OFFSET) { - switch(AppealCols.values()[col]) { + switch(COLS[col]) { case lectureBlockDate: return row.getRollCall().getLectureBlock().getStartDate(); case lectureBlockName: return row.getRollCall().getLectureBlock().getTitle(); case coach: return row.getCoach(); diff --git a/src/main/java/org/olat/modules/lecture/ui/AppealListRepositorySortDelegate.java b/src/main/java/org/olat/modules/lecture/ui/AppealListRepositorySortDelegate.java index f67291dcd347c220c9284ad5d775ab1d03ab25b4..c03873b4e0017ebc9bdad18859990ec51c9bee0e 100644 --- a/src/main/java/org/olat/modules/lecture/ui/AppealListRepositorySortDelegate.java +++ b/src/main/java/org/olat/modules/lecture/ui/AppealListRepositorySortDelegate.java @@ -19,10 +19,17 @@ */ package org.olat.modules.lecture.ui; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; import java.util.Locale; import org.olat.core.commons.persistence.SortKey; import org.olat.core.gui.components.form.flexible.impl.elements.table.SortableFlexiTableModelDelegate; +import org.olat.modules.lecture.LectureBlockStatus; +import org.olat.modules.lecture.LectureRollCallStatus; +import org.olat.modules.lecture.model.LectureBlockAndRollCall; +import org.olat.modules.lecture.ui.AppealListRepositoryDataModel.AppealCols; /** * @@ -31,9 +38,92 @@ import org.olat.core.gui.components.form.flexible.impl.elements.table.SortableFl * */ public class AppealListRepositorySortDelegate extends SortableFlexiTableModelDelegate<AppealRollCallRow> { + + private static final AppealCols[] COLS = AppealCols.values(); - public AppealListRepositorySortDelegate(SortKey orderBy, AppealListRepositoryDataModel tableModel, Locale locale) { + private final boolean authorizedAbsenceEnabled; + private final boolean absenceDefaultAuthorized; + + public AppealListRepositorySortDelegate(SortKey orderBy, AppealListRepositoryDataModel tableModel, + boolean authorizedAbsenceEnabled, boolean absenceDefaultAuthorized, Locale locale) { super(orderBy, tableModel, locale); + this.authorizedAbsenceEnabled = authorizedAbsenceEnabled; + this.absenceDefaultAuthorized = absenceDefaultAuthorized; + } + + @Override + protected void sort(List<AppealRollCallRow> rows) { + int columnIndex = getColumnIndex(); + if(columnIndex < AppealListRepositoryController.USER_PROPS_OFFSET) { + switch(COLS[columnIndex]) { + case lectureBlockStatus: Collections.sort(rows, new StatusComparator()); break; + default: super.sort(rows); break; + } + } else { + super.sort(rows); + } } + + private class StatusComparator implements Comparator<AppealRollCallRow> { + @Override + public int compare(AppealRollCallRow o1, AppealRollCallRow o2) { + if(o1 == null || o2 == null) { + return compareNullObjects(o1, o2); + } + + LectureBlockAndRollCall r1 = o1.getLectureBlockAndRollCall(); + LectureBlockAndRollCall r2 = o2.getLectureBlockAndRollCall(); + if(r1 == null || r2 == null) { + return compareNullObjects(r1, r2); + } + int s1 = stage(r1); + int s2 = stage(r2); + int c = Integer.compare(s1, s2); + if(c == 0) { + c = compareString(r1.getLectureBlockTitle(), r2.getLectureBlockTitle()); + } + return c; + } + + private int stage(LectureBlockAndRollCall rollCall) { + int stage; + if(rollCall.isRollCalled()) { + LectureBlockStatus status = rollCall.getStatus(); + LectureRollCallStatus rollCallStatus = rollCall.getRollCallStatus(); + if(status == LectureBlockStatus.cancelled) { + stage = 0; + } else if(status == LectureBlockStatus.done + && (rollCallStatus == LectureRollCallStatus.closed || rollCallStatus == LectureRollCallStatus.autoclosed)) { + + if(rollCall.isCompulsory()) { + int numOfLectures = rollCall.getPlannedLecturesNumber(); + if(rollCall.getLecturesAttendedNumber() >= numOfLectures) { + stage = 3; + } else if(authorizedAbsenceEnabled) { + if(absenceDefaultAuthorized && rollCall.getLecturesAuthorizedAbsent() == null) { + stage = 3; + } else if(rollCall.getLecturesAuthorizedAbsent() != null && rollCall.getLecturesAuthorizedAbsent().booleanValue()) { + stage = 11; + } else { + stage = 12; + } + } else { + stage = 15; + } + } else { + stage = 2; + } + + } else { + stage = 25; + } + } else if(!rollCall.isCompulsory()) { + stage = 1; + } else { + stage = -1; + } + return stage; + } + } } \ No newline at end of file diff --git a/src/main/java/org/olat/modules/lecture/ui/coach/AbsenceNoticesListTableModel.java b/src/main/java/org/olat/modules/lecture/ui/coach/AbsenceNoticesListTableModel.java index 5b5d274bee682119bca77d57168f6543a3876775..9450a9306af453e3f0f4ebaaca479e2d14f1ae41 100644 --- a/src/main/java/org/olat/modules/lecture/ui/coach/AbsenceNoticesListTableModel.java +++ b/src/main/java/org/olat/modules/lecture/ui/coach/AbsenceNoticesListTableModel.java @@ -27,7 +27,6 @@ import org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFle import org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiSortableColumnDef; import org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel; import org.olat.core.gui.components.form.flexible.impl.elements.table.SortableFlexiTableDataModel; -import org.olat.core.gui.components.form.flexible.impl.elements.table.SortableFlexiTableModelDelegate; import org.olat.core.id.Identity; import org.olat.core.id.User; import org.olat.course.assessment.ui.tool.AssessmentToolConstants; @@ -45,6 +44,8 @@ import org.olat.user.propertyhandlers.UserPropertyHandler; public class AbsenceNoticesListTableModel extends DefaultFlexiTableDataModel<AbsenceNoticeRow> implements SortableFlexiTableDataModel<AbsenceNoticeRow> { + private static final NoticeCols[] COLS = NoticeCols.values(); + private final Locale locale; private final UserManager userManager; private final List<UserPropertyHandler> userPropertyHandlers; @@ -60,7 +61,7 @@ implements SortableFlexiTableDataModel<AbsenceNoticeRow> { @Override public void sort(SortKey orderBy) { if(orderBy != null) { - List<AbsenceNoticeRow> rows = new SortableFlexiTableModelDelegate<>(orderBy, this, locale).sort(); + List<AbsenceNoticeRow> rows = new AbsenceNoticesListTableModelSortDelegate(orderBy, this, locale).sort(); super.setObjects(rows); } } @@ -74,7 +75,7 @@ implements SortableFlexiTableDataModel<AbsenceNoticeRow> { @Override public Object getValueAt(AbsenceNoticeRow row, int col) { if(col < AbsenceNoticesListController.USER_PROPS_OFFSET) { - switch(NoticeCols.values()[col]) { + switch(COLS[col]) { case id: return row.getKey(); case date: return row; case start: return row.getStartDate(); @@ -164,7 +165,7 @@ implements SortableFlexiTableDataModel<AbsenceNoticeRow> { @Override public boolean sortable() { - return true; + return this != details && this != tools; } @Override diff --git a/src/main/java/org/olat/modules/lecture/ui/coach/AbsenceNoticesListTableModelSortDelegate.java b/src/main/java/org/olat/modules/lecture/ui/coach/AbsenceNoticesListTableModelSortDelegate.java new file mode 100644 index 0000000000000000000000000000000000000000..8e4ed0778d7bcea8890fd4edbe48bae6dc4958d1 --- /dev/null +++ b/src/main/java/org/olat/modules/lecture/ui/coach/AbsenceNoticesListTableModelSortDelegate.java @@ -0,0 +1,180 @@ +/** + * <a href="http://www.openolat.org"> + * OpenOLAT - Online Learning and Training</a><br> + * <p> + * Licensed under the Apache License, Version 2.0 (the "License"); <br> + * you may not use this file except in compliance with the License.<br> + * You may obtain a copy of the License at the + * <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache homepage</a> + * <p> + * Unless required by applicable law or agreed to in writing,<br> + * software distributed under the License is distributed on an "AS IS" BASIS, <br> + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br> + * See the License for the specific language governing permissions and <br> + * limitations under the License. + * <p> + * Initial code contributed and copyrighted by<br> + * frentix GmbH, http://www.frentix.com + * <p> + */ +package org.olat.modules.lecture.ui.coach; + +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import java.util.Locale; + +import org.olat.core.commons.persistence.SortKey; +import org.olat.core.gui.components.form.flexible.elements.FormLink; +import org.olat.core.gui.components.form.flexible.impl.elements.table.SortableFlexiTableModelDelegate; +import org.olat.core.id.Identity; +import org.olat.modules.lecture.AbsenceNotice; +import org.olat.modules.lecture.AbsenceNoticeTarget; +import org.olat.modules.lecture.AbsenceNoticeType; +import org.olat.modules.lecture.ui.coach.AbsenceNoticesListTableModel.NoticeCols; + +/** + * + * Initial date: 16 oct. 2020<br> + * @author srosse, stephane.rosse@frentix.com, http://www.frentix.com + * + */ +public class AbsenceNoticesListTableModelSortDelegate extends SortableFlexiTableModelDelegate<AbsenceNoticeRow> { + + private static final NoticeCols[] COLS = NoticeCols.values(); + + public AbsenceNoticesListTableModelSortDelegate(SortKey orderBy, AbsenceNoticesListTableModel tableModel, Locale locale) { + super(orderBy, tableModel, locale); + } + + @Override + protected void sort(List<AbsenceNoticeRow> rows) { + int columnIndex = getColumnIndex(); + if(columnIndex < AbsenceNoticesListController.USER_PROPS_OFFSET) { + switch(COLS[columnIndex]) { + case date: Collections.sort(rows, new DateComparator()); break; + case entry: Collections.sort(rows, new EntriesLinkComparator()); break; + case type: Collections.sort(rows, new TypeComparator()); break; + default: super.sort(rows); break; + } + } else { + super.sort(rows); + } + } + + private int compareNotices(AbsenceNoticeRow o1, AbsenceNoticeRow o2) { + if(o1 == null || o2 == null) { + return compareNullObjects(o1, o2); + } + if(o1.getAbsenceNotice() == null || o2.getAbsenceNotice() == null) { + return compareNullObjects(o1.getAbsenceNotice(), o2.getAbsenceNotice()); + } + + Identity id1 = o1.getAbsenceNotice().getIdentity(); + Identity id2 = o2.getAbsenceNotice().getIdentity(); + if(id1 == null || id2 == null) { + return compareNullObjects(id1, id2); + } + + String l1 = id1.getUser().getLastName(); + String l2 = id2.getUser().getLastName(); + + int c = compareString(l1, l2); + if(c == 0) { + String f1 = id1.getUser().getLastName(); + String f2 = id2.getUser().getLastName(); + c = compareString(f1, f2); + } + if(c == 0) { + c = compareLongs(id1.getKey(), id2.getKey()); + } + if(c == 0) { + c = compareLongs(o1.getAbsenceNotice().getKey(), o2.getAbsenceNotice().getKey()); + } + return c; + } + + + private class DateComparator implements Comparator<AbsenceNoticeRow> { + @Override + public int compare(AbsenceNoticeRow o1, AbsenceNoticeRow o2) { + if(o1 == null || o2 == null) { + return compareNullObjects(o1, o2); + } + + boolean block1 = isRenderLectureBlock(o1); + boolean block2 = isRenderLectureBlock(o2); + + int c = 0; + if(block1 && block2) { + c = compareInts(o1.getLectureBlocks().size(), o2.getLectureBlocks().size()); + } else if(!block1 && block2) { + c = -1; + } else if(block1) { + c = 1; + } + + if(c == 0) { + c = compareDateAndTimestamps(o1.getStartDate(), o2.getStartDate()); + } + if(c == 0) { + c = compareNotices(o1, o2); + } + return c; + } + + private boolean isRenderLectureBlock(AbsenceNoticeRow row) { + return row.getAbsenceNotice().getNoticeTarget() == AbsenceNoticeTarget.lectureblocks + && (row.getLectureBlocks() != null && !row.getLectureBlocks().isEmpty()); + } + } + + private class TypeComparator implements Comparator<AbsenceNoticeRow> { + @Override + public int compare(AbsenceNoticeRow o1, AbsenceNoticeRow o2) { + if(o1 == null || o2 == null) { + return compareNullObjects(o1, o2); + } + + AbsenceNotice a1 = o1.getAbsenceNotice(); + AbsenceNotice a2 = o2.getAbsenceNotice(); + + int c = compareBooleans(a1.getAbsenceAuthorized(), a2.getAbsenceAuthorized()); + if(c == 0) { + AbsenceNoticeType t1 = a1.getNoticeType(); + AbsenceNoticeType t2 = a2.getNoticeType(); + if(t1 == null || t2 == null) { + c = compareNullObjects(o1, o2); + } else { + c = t1.compareTo(t2); + } + } + + if(c == 0) { + c = compareNotices(o1, o2); + } + return c; + } + } + + private class EntriesLinkComparator implements Comparator<AbsenceNoticeRow> { + @Override + public int compare(AbsenceNoticeRow o1, AbsenceNoticeRow o2) { + if(o1 == null || o2 == null) { + return compareNullObjects(o1, o2); + } + + FormLink e1 = o1.getEntriesLink(); + FormLink e2 = o2.getEntriesLink(); + if(e1 == null || e2 == null) { + return compareNullObjects(e1, e2); + } + + int c = compareString(e1.getI18nKey(), e2.getI18nKey()); + if(c == 0) { + c = compareNotices(o1, o2); + } + return c; + } + } +} diff --git a/src/main/java/org/olat/modules/lecture/ui/component/DailyDateCellRenderer.java b/src/main/java/org/olat/modules/lecture/ui/component/DailyDateCellRenderer.java index 2588e9153c5ce76cf2316af7d495e2945c904e32..0a2563de3d69e34d352a992e615595c0451d4a36 100644 --- a/src/main/java/org/olat/modules/lecture/ui/component/DailyDateCellRenderer.java +++ b/src/main/java/org/olat/modules/lecture/ui/component/DailyDateCellRenderer.java @@ -80,7 +80,7 @@ public class DailyDateCellRenderer implements FlexiCellRenderer { } } - private boolean isRenderLectureBlock(AbsenceNotice notice, List<LectureBlock> lectures) { + protected static boolean isRenderLectureBlock(AbsenceNotice notice, List<LectureBlock> lectures) { return notice.getNoticeTarget() == AbsenceNoticeTarget.lectureblocks && (lectures != null && !lectures.isEmpty()); } diff --git a/src/main/java/org/olat/modules/qpool/ui/_i18n/LocalStrings_de.properties b/src/main/java/org/olat/modules/qpool/ui/_i18n/LocalStrings_de.properties index b60279a2cf95ad4928363ceb8e36199548d6ff9d..8144e532cbc53543513c64a20a3adbe839f0df04 100644 --- a/src/main/java/org/olat/modules/qpool/ui/_i18n/LocalStrings_de.properties +++ b/src/main/java/org/olat/modules/qpool/ui/_i18n/LocalStrings_de.properties @@ -6,7 +6,8 @@ admin.menu.title.alt=Fragenpool applications=Anwendung author.item=Autorenrechte bulk.change=Metadaten \u00E4ndern -bulk.change.description=Hier k\u00F6nnen Sie in 1 Schritt mehrere Attributen von mehreren Fragen \u00E4ndern. +bulk.change.description.plural=Sie haben <strong>{0}</strong> Fragen ausgew\u00E4hlt, um die Metadaten zu \u00E4ndern. +bulk.change.description.singular=Sie haben eine Frage ausgew\u00E4hlt, um die Metadaten zu \u00E4ndern. classification.taxonomic.path=Fachbereich Pfad classification.taxonomic.path.incl=Fachbereiche classification.taxonomy.level=Fachbereich diff --git a/src/main/java/org/olat/modules/qpool/ui/_i18n/LocalStrings_en.properties b/src/main/java/org/olat/modules/qpool/ui/_i18n/LocalStrings_en.properties index b4a43717cc0b91a433ae831754e0b97e92227d90..9e4820e9dc30d8cfb278df02c73d933ec23d3476 100644 --- a/src/main/java/org/olat/modules/qpool/ui/_i18n/LocalStrings_en.properties +++ b/src/main/java/org/olat/modules/qpool/ui/_i18n/LocalStrings_en.properties @@ -6,7 +6,8 @@ admin.menu.title.alt=Question pools and configuration applications=Applications author.item=Author rights bulk.change=Change metadata -bulk.change.description=here you can change in a single step severals attributes of several questions. +bulk.change.description.plural=You have selected <strong>{0}</strong> questions to change the metadata. +bulk.change.description.singular=You have selected one question to change the metadata. classification.taxonomic.path=Subject path classification.taxonomic.path.incl=Subjects classification.taxonomy.level=Subject diff --git a/src/main/java/org/olat/modules/qpool/ui/_i18n/LocalStrings_fr.properties b/src/main/java/org/olat/modules/qpool/ui/_i18n/LocalStrings_fr.properties index 864d241606f3fd969e21de40fb85b9e67c3f07f8..dbae1ae0afd114e4660b4c9f23eb0afdea51f278 100644 --- a/src/main/java/org/olat/modules/qpool/ui/_i18n/LocalStrings_fr.properties +++ b/src/main/java/org/olat/modules/qpool/ui/_i18n/LocalStrings_fr.properties @@ -6,7 +6,8 @@ admin.menu.title.alt=Banque de questions applications=Utilisations author.item=Droit d'auteur bulk.change=Changer les m\u00E9tadonn\u00E9es -bulk.change.description=Ici vous pouvez modifier en une seule \u00E9tape les attributs de plusieurs questions \u00E0 la fois. +bulk.change.description.plural=Vous avez choisi <strong>{0}</strong> questions pour en modifier les m\u00E9tadonn\u00E9es. +bulk.change.description.plural=Vous avez choisi une question pour en modifier les m\u00E9tadonn\u00E9es. classification.taxonomic.path=Sujet chemin classification.taxonomic.path.incl=Sujets classification.taxonomy.level=Sujet diff --git a/src/main/java/org/olat/modules/qpool/ui/_i18n/LocalStrings_it.properties b/src/main/java/org/olat/modules/qpool/ui/_i18n/LocalStrings_it.properties index 3fbef1ad098a46f3c1cd7720b3a3ffef71dd22d0..5f9991fddc63fa7e311f4cfb481fa05c97e83855 100644 --- a/src/main/java/org/olat/modules/qpool/ui/_i18n/LocalStrings_it.properties +++ b/src/main/java/org/olat/modules/qpool/ui/_i18n/LocalStrings_it.properties @@ -6,7 +6,6 @@ admin.menu.title.alt=Pool di domande e configurazione applications=Utilizzazioni author.item=Diritti di autore bulk.change=Modificare i metadati -bulk.change.description=Qui puoi modificare gli attributi di pi\u00F9 domande in un solo passo. classification.taxonomic.path=Disciplina percorso classification.taxonomic.path.incl=Soggetti classification.taxonomy.level=Disciplina diff --git a/src/main/java/org/olat/modules/qpool/ui/_i18n/LocalStrings_pt_BR.properties b/src/main/java/org/olat/modules/qpool/ui/_i18n/LocalStrings_pt_BR.properties index a5d569236de5054c7172371468bea832b67b532c..2ef87e374e7d3ca1f2b4d148d4d5e6ccac20ad20 100644 --- a/src/main/java/org/olat/modules/qpool/ui/_i18n/LocalStrings_pt_BR.properties +++ b/src/main/java/org/olat/modules/qpool/ui/_i18n/LocalStrings_pt_BR.properties @@ -7,7 +7,6 @@ admin.menu.title.alt=Reservat\u00F3rios de perguntas e configura\u00E7\u00E3o applications=Aplica\u00E7\u00F5es author.item=Direitos de autor bulk.change=Alterar metadados -bulk.change.description=Aqui voc\u00EA pode mudar em uma \u00FAnica etapa, v\u00E1rios atributos de v\u00E1rias perguntas. classification.taxonomic.path=Assunto caminho classification.taxonomic.path.incl=Assuntos classification.taxonomy.level=Assunto diff --git a/src/main/java/org/olat/modules/qpool/ui/_i18n/LocalStrings_zh_CN.properties b/src/main/java/org/olat/modules/qpool/ui/_i18n/LocalStrings_zh_CN.properties index ec0fc92420da93939530c52dd98743d3e0227699..96b6a6feb98febe71443a947f53f5ac479c623f8 100644 --- a/src/main/java/org/olat/modules/qpool/ui/_i18n/LocalStrings_zh_CN.properties +++ b/src/main/java/org/olat/modules/qpool/ui/_i18n/LocalStrings_zh_CN.properties @@ -4,7 +4,6 @@ add.to.list=\u589E\u52A0\u5230\u5217\u8868 applications=\u5E94\u7528 author.item=\u4F5C\u8005\u6743\u9650 bulk.change=\u6539\u53D8\u5143\u6570\u636E -bulk.change.description=\u8FD9\u91CC\u60A8\u53EF\u4EE51\u6B65\u66F4\u6539\u66F4\u591A\u95EE\u9898\u7684\u5C5E\u6027\u3002 classification.taxonomy.level=\u4E13\u4E1A\u9886\u57DF classification.taxonomy.parents=\u8DEF\u5F84 collection.creationDate=\u521B\u5EFA\u4E8E diff --git a/src/main/java/org/olat/modules/qpool/ui/metadata/MetadataBulkChangeController.java b/src/main/java/org/olat/modules/qpool/ui/metadata/MetadataBulkChangeController.java index f09e38a51774b6a510dd4c63cc245424a85783cb..3fa228f4f02e2e10c39fdb9e850918222e3af350 100644 --- a/src/main/java/org/olat/modules/qpool/ui/metadata/MetadataBulkChangeController.java +++ b/src/main/java/org/olat/modules/qpool/ui/metadata/MetadataBulkChangeController.java @@ -140,7 +140,16 @@ public class MetadataBulkChangeController extends FormBasicController { @Override protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) { - setFormDescription("bulk.change.description"); + if(formLayout instanceof FormLayoutContainer) { + FormLayoutContainer layoutCont = (FormLayoutContainer)formLayout; + if(items.size() == 1) { + layoutCont.contextPut("infosMsg", translate("bulk.change.description.singular")); + } else { + layoutCont.contextPut("infosMsg", translate("bulk.change.description.plural", + new String[] { Integer.toString(items.size()) })); + } + layoutCont.contextPut("infosCss", items.size() > 20 ? "o_warning" :"o_info"); + } initGeneralForm(formLayout); initQuestionForm(formLayout); diff --git a/src/main/java/org/olat/modules/qpool/ui/metadata/_content/bulk_change.html b/src/main/java/org/olat/modules/qpool/ui/metadata/_content/bulk_change.html index ffdcbb48873dbce85ba11cd9a24293c3584c4d82..bf43558a3202eb729ca79fe5292608c5bf026e63 100644 --- a/src/main/java/org/olat/modules/qpool/ui/metadata/_content/bulk_change.html +++ b/src/main/java/org/olat/modules/qpool/ui/metadata/_content/bulk_change.html @@ -1,4 +1,5 @@ -$r.contextHelpWithWrapper("Data Management#qb_change_md")<br/> +$r.contextHelpWithWrapper("Data Management#qb_change_md") +<div class="$infosCss">$infosMsg</div> <fieldset><legend>$r.translate("general")</legend> $r.render("general") </fieldset>