diff --git a/src/main/java/org/olat/modules/lecture/ui/EditLectureBlockController.java b/src/main/java/org/olat/modules/lecture/ui/EditLectureBlockController.java index 78dc0bf43ae7bb44a50d3049e80b442c4018183c..b7e1471cfed3885c207ce0bbd59368981bac4c4f 100644 --- a/src/main/java/org/olat/modules/lecture/ui/EditLectureBlockController.java +++ b/src/main/java/org/olat/modules/lecture/ui/EditLectureBlockController.java @@ -41,6 +41,7 @@ import org.olat.core.gui.components.form.flexible.elements.TextElement; import org.olat.core.gui.components.form.flexible.impl.FormBasicController; import org.olat.core.gui.components.form.flexible.impl.FormEvent; import org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer; +import org.olat.core.gui.components.util.KeyValues; import org.olat.core.gui.control.Controller; import org.olat.core.gui.control.Event; import org.olat.core.gui.control.WindowControl; @@ -85,7 +86,6 @@ import org.springframework.beans.factory.annotation.Autowired; public class EditLectureBlockController extends FormBasicController { private static final String[] onKeys = new String[] { "on" }; - private static final String[] plannedLecturesKeys = new String[] { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12" }; private TextElement titleEl; private TextElement descriptionEl; @@ -161,12 +161,19 @@ public class EditLectureBlockController extends FormBasicController { if(!StringHelper.containsNonWhitespace(title)) { titleEl.setFocus(true); } - + + int plannedNumOfLectures = lectureBlock == null ? 4 : lectureBlock.getPlannedLecturesNumber(); + int maxNumOfLectures = Math.max(12, plannedNumOfLectures); + KeyValues plannedLecturesKeys = new KeyValues(); + for(int i=1; i<=maxNumOfLectures; i++) { + String num = String.valueOf(i); + plannedLecturesKeys.add(KeyValues.entry(num, num)); + } plannedLecturesEl = uifactory.addDropdownSingleselect("planned.lectures", "planned.lectures", formLayout, - plannedLecturesKeys, plannedLecturesKeys, null); + plannedLecturesKeys.keys(), plannedLecturesKeys.values(), null); plannedLecturesEl.setMandatory(true); String plannedlectures = lectureBlock == null ? "4" : Integer.toString(lectureBlock.getPlannedLecturesNumber()); - for(String plannedLecturesKey:plannedLecturesKeys) { + for(String plannedLecturesKey:plannedLecturesKeys.keys()) { if(plannedlectures.equals(plannedLecturesKey)) { plannedLecturesEl.select(plannedLecturesKey, true); break; 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 736806738d013f76c7a3a5387d3a30b3c666432f..2e07cae198fa18c7370400c2d21192285208c68e 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 @@ -421,8 +421,30 @@ table.header.lecture.11=11 table.header.lecture.12=12 table.header.lecture.13=13 table.header.lecture.14=14 +table.header.lecture.15=15 +table.header.lecture.16=16 +table.header.lecture.17=17 +table.header.lecture.18=18 +table.header.lecture.19=19 table.header.lecture.2=2 +table.header.lecture.20=20 +table.header.lecture.21=21 +table.header.lecture.22=22 +table.header.lecture.23=23 +table.header.lecture.24=24 +table.header.lecture.25=25 +table.header.lecture.26=26 +table.header.lecture.27=27 +table.header.lecture.28=28 +table.header.lecture.29=29 table.header.lecture.3=3 +table.header.lecture.30=30 +table.header.lecture.31=31 +table.header.lecture.32=32 +table.header.lecture.33=33 +table.header.lecture.34=34 +table.header.lecture.35=35 +table.header.lecture.36=36 table.header.lecture.4=4 table.header.lecture.5=5 table.header.lecture.6=6 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 87aef9093b459fb69635b185de90ef9105ed689e..8d48047292331b55846a1d518ba480df068aabcc 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 @@ -420,8 +420,30 @@ table.header.lecture.11=11 table.header.lecture.12=12 table.header.lecture.13=13 table.header.lecture.14=14 +table.header.lecture.15=15 +table.header.lecture.16=16 +table.header.lecture.17=17 +table.header.lecture.18=18 +table.header.lecture.19=19 table.header.lecture.2=2 +table.header.lecture.20=20 +table.header.lecture.21=21 +table.header.lecture.22=22 +table.header.lecture.23=23 +table.header.lecture.24=24 +table.header.lecture.25=25 +table.header.lecture.26=26 +table.header.lecture.27=27 +table.header.lecture.28=28 +table.header.lecture.29=29 table.header.lecture.3=3 +table.header.lecture.30=30 +table.header.lecture.31=31 +table.header.lecture.32=32 +table.header.lecture.33=33 +table.header.lecture.34=34 +table.header.lecture.35=35 +table.header.lecture.36=36 table.header.lecture.4=4 table.header.lecture.5=5 table.header.lecture.6=6 diff --git a/src/main/java/org/olat/modules/lecture/ui/_i18n/LocalStrings_fr.properties b/src/main/java/org/olat/modules/lecture/ui/_i18n/LocalStrings_fr.properties index d2a6f0e2141a1ef7e6838466bed772152c01a781..aed031f61b3df6b59c44709b2d0914e37c5f55f9 100644 --- a/src/main/java/org/olat/modules/lecture/ui/_i18n/LocalStrings_fr.properties +++ b/src/main/java/org/olat/modules/lecture/ui/_i18n/LocalStrings_fr.properties @@ -421,8 +421,30 @@ table.header.lecture.11=11 table.header.lecture.12=12 table.header.lecture.13=13 table.header.lecture.14=14 +table.header.lecture.15=15 +table.header.lecture.16=16 +table.header.lecture.17=17 +table.header.lecture.18=18 +table.header.lecture.19=19 table.header.lecture.2=2 +table.header.lecture.20=20 +table.header.lecture.21=21 +table.header.lecture.22=22 +table.header.lecture.23=23 +table.header.lecture.24=24 +table.header.lecture.25=25 +table.header.lecture.26=26 +table.header.lecture.27=27 +table.header.lecture.28=28 +table.header.lecture.29=29 table.header.lecture.3=3 +table.header.lecture.30=30 +table.header.lecture.31=31 +table.header.lecture.32=32 +table.header.lecture.33=33 +table.header.lecture.34=34 +table.header.lecture.35=35 +table.header.lecture.36=36 table.header.lecture.4=4 table.header.lecture.5=5 table.header.lecture.6=6 diff --git a/src/main/java/org/olat/modules/lecture/ui/_i18n/LocalStrings_pt_BR.properties b/src/main/java/org/olat/modules/lecture/ui/_i18n/LocalStrings_pt_BR.properties index 9463566df014aa630064a1878fdb5033a0b36b2d..7ef393757cf5907297396b0d9aca35d2b3265f96 100644 --- a/src/main/java/org/olat/modules/lecture/ui/_i18n/LocalStrings_pt_BR.properties +++ b/src/main/java/org/olat/modules/lecture/ui/_i18n/LocalStrings_pt_BR.properties @@ -290,8 +290,30 @@ table.header.lecture.11=11 table.header.lecture.12=12 table.header.lecture.13=13 table.header.lecture.14=14 +table.header.lecture.15=15 +table.header.lecture.16=16 +table.header.lecture.17=17 +table.header.lecture.18=18 +table.header.lecture.19=19 table.header.lecture.2=2 +table.header.lecture.20=20 +table.header.lecture.21=21 +table.header.lecture.22=22 +table.header.lecture.23=23 +table.header.lecture.24=24 +table.header.lecture.25=25 +table.header.lecture.26=26 +table.header.lecture.27=27 +table.header.lecture.28=28 +table.header.lecture.29=29 table.header.lecture.3=3 +table.header.lecture.30=30 +table.header.lecture.31=31 +table.header.lecture.32=32 +table.header.lecture.33=33 +table.header.lecture.34=34 +table.header.lecture.35=35 +table.header.lecture.36=36 table.header.lecture.4=4 table.header.lecture.5=5 table.header.lecture.6=6