diff --git a/src/main/java/org/olat/modules/lecture/ui/_i18n/LocalStrings_de.properties b/src/main/java/org/olat/modules/lecture/ui/_i18n/LocalStrings_de.properties index 2fabc696a2123cd8e55c5f58062251b88bd4eeb1..4dbbc6cfd7075a56b6236ab51ad16b88c54bc674 100644 --- a/src/main/java/org/olat/modules/lecture/ui/_i18n/LocalStrings_de.properties +++ b/src/main/java/org/olat/modules/lecture/ui/_i18n/LocalStrings_de.properties @@ -81,8 +81,8 @@ cockpit.lectures=Lektionen cockpit.lectures.day.list=Sie haben keine Lektionen an diesem Tag. cockpit.pending.day={0} {1} ({2} Lektion) cockpit.pending.day.plural={0} {1} ({2} Lektion(en)) -cockpit.pending.days=Es wurden nicht abgeschlossene Lektionen gefunden. Bitte erfassen Sie die Absenzen auch f\u00FCr den n\u00E4chsten Tag\: -cockpit.pending.days.plural=Es wurden nicht abgeschlossene Lektionen gefunden. Bitte erfassen Sie die Absenzen auch f\u00FCr die n\u00E4chsten Tage\: +cockpit.pending.days=Es wurden nicht abgeschlossene Lektionen gefunden. Bitte erfassen Sie die Absenzen auch f\u00FCr den vergangenen Tag\: +cockpit.pending.days.plural=Es wurden nicht abgeschlossene Lektionen gefunden. Bitte erfassen Sie die Absenzen auch f\u00FCr die vergangenen Tage\: config.calculate.attendance.rate=Anwesenheitsquote berechnen config.override=Standard Konfiguration \u00FCberschreiben zulassen config.override.no=Nein diff --git a/src/main/java/org/olat/modules/lecture/ui/_i18n/LocalStrings_en.properties b/src/main/java/org/olat/modules/lecture/ui/_i18n/LocalStrings_en.properties index 8d48047292331b55846a1d518ba480df068aabcc..65dbaeffe7b442bca62439c2252dc9c2448a699a 100644 --- a/src/main/java/org/olat/modules/lecture/ui/_i18n/LocalStrings_en.properties +++ b/src/main/java/org/olat/modules/lecture/ui/_i18n/LocalStrings_en.properties @@ -81,8 +81,8 @@ cockpit.lectures=Lectures cockpit.lectures.day.list=You don't have any lectures this day. cockpit.pending.day={0} {1} ({2} lectures) cockpit.pending.day.plural={0} {1} ({2} lectures) -cockpit.pending.days=There is some lectures which are not already closed. Please record the absences for the following day\: -cockpit.pending.days.plural=There is some lectures which are not already closed. Please record the absences for the following days\: +cockpit.pending.days=There is some lectures which are not already closed. Please record the absences for the past day\: +cockpit.pending.days.plural=There is some lectures which are not already closed. Please record the absences for the past days\: config.calculate.attendance.rate=Calculate attendance rate config.override=Override default configuration config.override.no=No diff --git a/src/main/java/org/olat/modules/lecture/ui/coach/DailyLectureBlockOverviewController.java b/src/main/java/org/olat/modules/lecture/ui/coach/DailyLectureBlockOverviewController.java index bf99deff1e38ddfb49137324eaa93d9bcd9d02bc..fbc1e6ab1a3a058ae52d9eff15de721d8338a1a4 100644 --- a/src/main/java/org/olat/modules/lecture/ui/coach/DailyLectureBlockOverviewController.java +++ b/src/main/java/org/olat/modules/lecture/ui/coach/DailyLectureBlockOverviewController.java @@ -146,6 +146,11 @@ public class DailyLectureBlockOverviewController extends FormBasicController { public void setCurrentDate(Date date) { this.currentDate = date; + if(closeButton != null) { + String title = translate("close.lecture.blocks.day", new String[] { formatter.formatDate(date) }); + closeButton.setI18nKey(title); + } + loadModel(); updateCanClose(); } diff --git a/src/main/java/org/olat/modules/lecture/ui/coach/DayChooserController.java b/src/main/java/org/olat/modules/lecture/ui/coach/DayChooserController.java index c75d702efab359faaaeced5b75513d4e8601469d..599fd5483f4ac6096f2f3b311649c762aa81ceef 100644 --- a/src/main/java/org/olat/modules/lecture/ui/coach/DayChooserController.java +++ b/src/main/java/org/olat/modules/lecture/ui/coach/DayChooserController.java @@ -79,6 +79,10 @@ public class DayChooserController extends FormBasicController { } return date; } + + public void setDate(Date date) { + dateEl.setDate(date); + } @Override protected void doDispose() { diff --git a/src/main/java/org/olat/modules/lecture/ui/coach/LecturesCockpitController.java b/src/main/java/org/olat/modules/lecture/ui/coach/LecturesCockpitController.java index a4e24c5d37c7a8af5e46f22622065592d47bf6a5..780b7b9620d8b881b9b1cb2c0af56c02aec25551 100644 --- a/src/main/java/org/olat/modules/lecture/ui/coach/LecturesCockpitController.java +++ b/src/main/java/org/olat/modules/lecture/ui/coach/LecturesCockpitController.java @@ -21,6 +21,8 @@ package org.olat.modules.lecture.ui.coach; import java.util.ArrayList; import java.util.Calendar; +import java.util.Collections; +import java.util.Comparator; import java.util.Date; import java.util.HashMap; import java.util.HashSet; @@ -156,10 +158,9 @@ public class LecturesCockpitController extends BasicController implements Activa fireEvent(ureq, event); } } else if(source == rollCallCtrl) { - if(event == Event.DONE_EVENT) { + if(event == Event.DONE_EVENT || event == Event.BACK_EVENT || event == Event.CANCELLED_EVENT) { backToDaily(); } - } else if(event == Event.BACK_EVENT) { backToDaily(); } @@ -243,6 +244,8 @@ public class LecturesCockpitController extends BasicController implements Activa Formatter formatter = Formatter.getInstance(getLocale()); List<LectureBlock> lectureBlocks = lectureService.getLectureBlocks(searchParams); + Collections.sort(lectureBlocks, new LectureBlockComparator()); + List<Link> pendingLinks = new ArrayList<>(); Set<String> deduplicate = new HashSet<>(); for(LectureBlock lectureBlock:lectureBlocks) { @@ -272,10 +275,24 @@ public class LecturesCockpitController extends BasicController implements Activa } private void doChangeCurrentDate(Date date) { + dayChooserCtrl.setDate(date); if(lectureBlocksCtrl != null) { lectureBlocksCtrl.setCurrentDate(date); } absencesListCtrl.setCurrentDate(date); updateCurrentDate(); } + + private static class LectureBlockComparator implements Comparator<LectureBlock> { + + @Override + public int compare(LectureBlock o1, LectureBlock o2) { + Date s1 = o1.getStartDate(); + Date s2 = o2.getStartDate(); + if(s1 == null && s2 == null) return 0; + if(s1 == null) return 1; + if(s2 == null) return -1; + return s1.compareTo(s2); + } + } }