Skip to content
Snippets Groups Projects
Commit a7d08e01 authored by srosse's avatar srosse
Browse files

OO-4150: more exact daily lectures

parent 50ff4246
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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
......
......@@ -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();
}
......
......@@ -79,6 +79,10 @@ public class DayChooserController extends FormBasicController {
}
return date;
}
public void setDate(Date date) {
dateEl.setDate(date);
}
@Override
protected void doDispose() {
......
......@@ -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);
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment