diff --git a/src/main/java/org/olat/core/_i18n/LocalStrings_de.properties b/src/main/java/org/olat/core/_i18n/LocalStrings_de.properties index d6c3410951afa46db373549dd4d4f3cca1539272..c3a77774933c33868a80cc7e38b245963b45fdf6 100644 --- a/src/main/java/org/olat/core/_i18n/LocalStrings_de.properties +++ b/src/main/java/org/olat/core/_i18n/LocalStrings_de.properties @@ -110,6 +110,7 @@ toolbox.tools=Werkzeuge top=nach oben top.alt=Zum Anfang der Seite user.guest=Gast +user.fullname.separator=; warn.beta.feature=Achtung\! Diese Funktion befindet sich in einer Versuchsphase. Bitte beachten Sie, dass Fehler auftreten k\u00F6nnen wenn diese Funktion verwendet wird. warn.header=Achtung warn.notdispatched=Diese Seite wurde ver\u00E4ndert. Bitte beachten Sie allf\u00E4llige Meldungen. diff --git a/src/main/java/org/olat/core/_i18n/LocalStrings_en.properties b/src/main/java/org/olat/core/_i18n/LocalStrings_en.properties index c676e293bfcc7fd57d2749f7cb6ea9c3ac3e4b3a..5cb8f61cc9f2a346624ae884d6f3ccd4f29407a4 100644 --- a/src/main/java/org/olat/core/_i18n/LocalStrings_en.properties +++ b/src/main/java/org/olat/core/_i18n/LocalStrings_en.properties @@ -110,6 +110,7 @@ toolbox.tools=Tools top=Go to top top.alt=Go to top of page user.guest=Guest +user.fullname.separator=/ warn.beta.feature=Attention\! This is a beta feature. Be aware that using this feature might result in unexpected behavior. warn.header=Warning warn.notdispatched=This page has been modified. Please consider any new messages. diff --git a/src/main/java/org/olat/core/_i18n/LocalStrings_fr.properties b/src/main/java/org/olat/core/_i18n/LocalStrings_fr.properties index c57a60c8dcba72156d181e11b671379768fb8d8a..e5b77dc24032f9b9ccd03ff4aad47c28f862320e 100644 --- a/src/main/java/org/olat/core/_i18n/LocalStrings_fr.properties +++ b/src/main/java/org/olat/core/_i18n/LocalStrings_fr.properties @@ -110,6 +110,7 @@ toolbox.tools=Outils top=vers le haut top.alt=Vers le d\u00E9but de la page user.guest=invit\u00E9 +user.fullname.separator=/ warn.beta.feature=Attention\! Cette fonction se trouve dans la phase d'essai. Veuillez noter que des erreurs peuvent appara\u00EEtre si cette fonction est utilis\u00E9e. warn.header=Attention warn.notdispatched=Cette page a \u00E9t\u00E9 modifi\u00E9e. Veuillez tenir compte d'\u00E9ventuels messages. diff --git a/src/main/java/org/olat/modules/lecture/LectureService.java b/src/main/java/org/olat/modules/lecture/LectureService.java index cdf7d17df82f98eb09ff8543b942d31145bc3931..14aeb0457bab194c7bb24d04b5205a50b711f597 100644 --- a/src/main/java/org/olat/modules/lecture/LectureService.java +++ b/src/main/java/org/olat/modules/lecture/LectureService.java @@ -503,9 +503,10 @@ public interface LectureService { * * @param entry * @param participant + * @param teacherSeparator The separator between the name of 2 teachers * @return */ - public List<LectureBlockAndRollCall> getParticipantLectureBlocks(RepositoryEntryRef entry, IdentityRef participant); + public List<LectureBlockAndRollCall> getParticipantLectureBlocks(RepositoryEntryRef entry, IdentityRef participant, String teacherSeparator); /** diff --git a/src/main/java/org/olat/modules/lecture/manager/LectureBlockRollCallDAO.java b/src/main/java/org/olat/modules/lecture/manager/LectureBlockRollCallDAO.java index 4680e95f3fa54dd260e2f74b0b04ec9dd85dbeba..e613473802453d47fb233392d56cc424b7e88bfe 100644 --- a/src/main/java/org/olat/modules/lecture/manager/LectureBlockRollCallDAO.java +++ b/src/main/java/org/olat/modules/lecture/manager/LectureBlockRollCallDAO.java @@ -322,7 +322,8 @@ public class LectureBlockRollCallDAO { return query.getResultList(); } - public List<LectureBlockAndRollCall> getParticipantLectureBlockAndRollCalls(RepositoryEntryRef entry, IdentityRef identity) { + public List<LectureBlockAndRollCall> getParticipantLectureBlockAndRollCalls(RepositoryEntryRef entry, IdentityRef identity, + String teacherSeaparator) { StringBuilder sb = new StringBuilder(); sb.append("select block, call, re.displayname") .append(" from lectureblock block") @@ -349,11 +350,11 @@ public class LectureBlockRollCallDAO { blockToRollCallMap.put(block.getKey(), new LectureBlockAndRollCall(displayname, block, rollCall)); } - appendCoaches(entry, blockToRollCallMap); + appendCoaches(entry, blockToRollCallMap, teacherSeaparator); return new ArrayList<>(blockToRollCallMap.values()); } - private void appendCoaches(RepositoryEntryRef entry, Map<Long,LectureBlockAndRollCall> blockToRollCallMap) { + private void appendCoaches(RepositoryEntryRef entry, Map<Long,LectureBlockAndRollCall> blockToRollCallMap, String teacherSeaparator) { // append the coaches StringBuilder sc = new StringBuilder(); sc.append("select block.key, coach") @@ -378,7 +379,7 @@ public class LectureBlockRollCallDAO { if(rollCall.getCoach() == null) { rollCall.setCoach(fullname); } else { - rollCall.setCoach(rollCall.getCoach() + ", " + fullname); + rollCall.setCoach(rollCall.getCoach() + " " + teacherSeaparator + " " + fullname); } } } diff --git a/src/main/java/org/olat/modules/lecture/manager/LectureServiceImpl.java b/src/main/java/org/olat/modules/lecture/manager/LectureServiceImpl.java index 98a8daf5b714dc0e0db3c86f921da722ab8edb0f..c996fc9edf43b9f1b328da80666435f485bba285 100644 --- a/src/main/java/org/olat/modules/lecture/manager/LectureServiceImpl.java +++ b/src/main/java/org/olat/modules/lecture/manager/LectureServiceImpl.java @@ -174,8 +174,7 @@ public class LectureServiceImpl implements LectureService, UserDataDeletable, De @Override public RepositoryEntryLectureConfiguration updateRepositoryEntryLectureConfiguration(RepositoryEntryLectureConfiguration config) { - RepositoryEntryLectureConfiguration updatedConfig = lectureConfigurationDao.update(config); - return updatedConfig; + return lectureConfigurationDao.update(config); } @Override @@ -422,6 +421,7 @@ public class LectureServiceImpl implements LectureService, UserDataDeletable, De return new ArrayList<>(participants); } + @Override public List<Identity> syncParticipantSummaries(LectureBlock lectureBlock) { RepositoryEntry entry = lectureBlock.getEntry(); Date now = new Date(); @@ -841,8 +841,9 @@ public class LectureServiceImpl implements LectureService, UserDataDeletable, De } @Override - public List<LectureBlockAndRollCall> getParticipantLectureBlocks(RepositoryEntryRef entry, IdentityRef participant) { - return lectureBlockRollCallDao.getParticipantLectureBlockAndRollCalls(entry, participant); + public List<LectureBlockAndRollCall> getParticipantLectureBlocks(RepositoryEntryRef entry, IdentityRef participant, + String teacherSeaparator) { + return lectureBlockRollCallDao.getParticipantLectureBlockAndRollCalls(entry, participant, teacherSeaparator); } @Override diff --git a/src/main/java/org/olat/modules/lecture/ui/LectureListRepositoryController.java b/src/main/java/org/olat/modules/lecture/ui/LectureListRepositoryController.java index cc7d2284b08e69ee36b9dffdd7bc375009d81f00..cc87b8ff5ffe8af9efbd1444f80667dffb49daa4 100644 --- a/src/main/java/org/olat/modules/lecture/ui/LectureListRepositoryController.java +++ b/src/main/java/org/olat/modules/lecture/ui/LectureListRepositoryController.java @@ -164,8 +164,9 @@ public class LectureListRepositoryController extends FormBasicController { for(LectureBlockWithTeachers block:blocks) { LectureBlock b = block.getLectureBlock(); StringBuilder teachers = new StringBuilder(); + String separator = translate("user.fullname.separator"); for(Identity teacher:block.getTeachers()) { - if(teachers.length() > 0) teachers.append(", "); + if(teachers.length() > 0) teachers.append(" ").append(separator).append(" "); teachers.append(userManager.getUserDisplayName(teacher)); } @@ -182,7 +183,7 @@ public class LectureListRepositoryController extends FormBasicController { tableModel.setObjects(rows); tableEl.reset(true, true, true); - deleteLecturesButton.setVisible(rows.size() > 0); + deleteLecturesButton.setVisible(!rows.isEmpty()); } @Override @@ -314,7 +315,7 @@ public class LectureListRepositoryController extends FormBasicController { } } - if(blocks.size() == 0) { + if(blocks.isEmpty()) { showWarning("error.atleastone.lecture"); } else { StringBuilder titles = new StringBuilder(); @@ -379,7 +380,9 @@ public class LectureListRepositoryController extends FormBasicController { private class ToolsController extends BasicController { - private Link deleteLink, copyLink, logLink; + private Link deleteLink; + private Link copyLink; + private Link logLink; private final LectureBlockRow row; diff --git a/src/main/java/org/olat/modules/lecture/ui/ParticipantLectureBlocksController.java b/src/main/java/org/olat/modules/lecture/ui/ParticipantLectureBlocksController.java index 886abc2b6c17fd4774df2777895c66ab6fd4dd11..3cf7745d03acb4c962dd1f072b129486141cc9a3 100644 --- a/src/main/java/org/olat/modules/lecture/ui/ParticipantLectureBlocksController.java +++ b/src/main/java/org/olat/modules/lecture/ui/ParticipantLectureBlocksController.java @@ -202,8 +202,9 @@ public class ParticipantLectureBlocksController extends FormBasicController { private void loadModel() { Date now = new Date(); Formatter formatter = Formatter.getInstance(getLocale()); - - List<LectureBlockAndRollCall> rollCalls = lectureService.getParticipantLectureBlocks(entry, assessedIdentity); + + String separator = translate("user.fullname.separator"); + List<LectureBlockAndRollCall> rollCalls = lectureService.getParticipantLectureBlocks(entry, assessedIdentity, separator); List<LectureBlockAuditLog> sendAppealLogs = lectureService.getAuditLog(entry, assessedIdentity, LectureBlockAuditLog.Action.sendAppeal); Map<Long, Date> appealDates = new HashMap<>(); for(LectureBlockAuditLog sendAppealLog:sendAppealLogs) { @@ -385,15 +386,12 @@ public class ParticipantLectureBlocksController extends FormBasicController { } private void doPrint(UserRequest ureq) { - ControllerCreator printControllerCreator = new ControllerCreator() { - @Override - public Controller createController(UserRequest lureq, WindowControl lwControl) { - lwControl.getWindowBackOffice().getChiefController().addBodyCssClass("o_lectures_print"); - Controller printCtrl = new ParticipantLectureBlocksController(lureq, lwControl, entry, assessedIdentity, false, false); - listenTo(printCtrl); - return printCtrl; - } - }; + ControllerCreator printControllerCreator = (lureq, lwControl) -> { + lwControl.getWindowBackOffice().getChiefController().addBodyCssClass("o_lectures_print"); + Controller printCtrl = new ParticipantLectureBlocksController(lureq, lwControl, entry, assessedIdentity, false, false); + listenTo(printCtrl); + return printCtrl; + }; ControllerCreator layoutCtrlr = BaseFullWebappPopupLayoutFactory.createPrintPopupLayout(printControllerCreator); openInNewBrowserWindow(ureq, layoutCtrlr); } diff --git a/src/main/java/org/olat/modules/lecture/ui/TeacherOverviewController.java b/src/main/java/org/olat/modules/lecture/ui/TeacherOverviewController.java index c9878ae05e5a468d7399cf1ca82ddddeb6cc04ca..00ceeba1adaa23d600446a1012643ca068d5cdb6 100644 --- a/src/main/java/org/olat/modules/lecture/ui/TeacherOverviewController.java +++ b/src/main/java/org/olat/modules/lecture/ui/TeacherOverviewController.java @@ -89,11 +89,12 @@ public class TeacherOverviewController extends AbstractTeacherOverviewController for(LectureBlockWithTeachers blockWithTeachers:blocksWithTeachers) { LectureBlock block = blockWithTeachers.getLectureBlock(); - StringBuilder teachers = new StringBuilder(); + StringBuilder teachers = new StringBuilder(32); List<Identity> teacherList = blockWithTeachers.getTeachers(); - + + String separator = translate("user.fullname.separator"); for(Identity teacher:blockWithTeachers.getTeachers()) { - if(teachers.length() > 0) teachers.append(", "); + if(teachers.length() > 0) teachers.append(" ").append(separator).append(" "); teachers.append(userManager.getUserDisplayName(teacher)); }