aboutsummaryrefslogtreecommitdiff
path: root/lib/classes/coursewizardsteps/LVGroupsWizardStep.php
diff options
context:
space:
mode:
authorMoritz Strohm <strohm@data-quest.de>2024-09-18 08:33:26 +0000
committerMoritz Strohm <strohm@data-quest.de>2024-09-18 08:33:26 +0000
commitfbf008efa11f009d2b89109e99c213c44c62e024 (patch)
treeee3379b5b28c6ebf4389a3809700b25a4bfa7626 /lib/classes/coursewizardsteps/LVGroupsWizardStep.php
parent1efacbf3fd32325da48d09eabaf4a8d34d4e0de5 (diff)
TIC 4391, closes #4391
Closes #4391 Merge request studip/studip!3211
Diffstat (limited to 'lib/classes/coursewizardsteps/LVGroupsWizardStep.php')
-rw-r--r--lib/classes/coursewizardsteps/LVGroupsWizardStep.php26
1 files changed, 13 insertions, 13 deletions
diff --git a/lib/classes/coursewizardsteps/LVGroupsWizardStep.php b/lib/classes/coursewizardsteps/LVGroupsWizardStep.php
index c651714..a901b6c 100644
--- a/lib/classes/coursewizardsteps/LVGroupsWizardStep.php
+++ b/lib/classes/coursewizardsteps/LVGroupsWizardStep.php
@@ -33,7 +33,7 @@ class LVGroupsWizardStep implements CourseWizardStep
->classname;
// store start time of semester selected in first step
- $course_start_time = $values[$step_one_class]['start_time'];
+ $course_start_semester = $values[$step_one_class]['start_semester'];
// We only need our own stored values here.
$values = $values[__CLASS__] ?? [];
@@ -56,8 +56,8 @@ class LVGroupsWizardStep implements CourseWizardStep
$selection_details = $values['lvgruppe_selection']['area_details'] ?? null;
if (
- isset($_SESSION[__CLASS__]['course_start_time'])
- && $_SESSION[__CLASS__]['course_start_time'] != $course_start_time
+ isset($_SESSION[__CLASS__]['course_start_semester'])
+ && $_SESSION[__CLASS__]['course_start_semester'] != $course_start_semester
) {
// don't store previously opened nodes
// because we get in trouble if the semester has changed
@@ -66,7 +66,7 @@ class LVGroupsWizardStep implements CourseWizardStep
$open_nodes = !empty($values['open_lvg_nodes']) ? $values['open_lvg_nodes'] : [];
}
- $_SESSION[__CLASS__]['course_start_time'] = $course_start_time;
+ $_SESSION[__CLASS__]['course_start_semester'] = $course_start_semester;
$tpl->open_lvg_nodes = $open_nodes;
$tpl->selection = $selection;
@@ -124,10 +124,10 @@ class LVGroupsWizardStep implements CourseWizardStep
$course = Course::findCurrent();
if ($course) {
- $course_start = $course->start_time;
- $course_end = ($course->end_time < 0 || is_null($course->end_time)) ? PHP_INT_MAX : $course->end_time;
+ $course_start = $course->start_semester?->beginn ?? 0;
+ $course_end = $course->end_semester?->ende ?? PHP_INT_MAX;
} else {
- $semester = Semester::findByTimestamp($_SESSION[__CLASS__]['course_start_time']);
+ $semester = Semester::find($_SESSION[__CLASS__]['course_start_semester']);
$course_start = $semester->beginn;
$course_end = $semester->ende;
}
@@ -192,10 +192,10 @@ class LVGroupsWizardStep implements CourseWizardStep
$course = Course::findCurrent();
if ($course) {
- $course_start = $course->start_time;
- $course_end = ($course->end_time < 0 || is_null($course->end_time)) ? PHP_INT_MAX : $course->end_time;
+ $course_start = $course->start_semester?->beginn ?? 0;
+ $course_end = $course->end_semester?->ende ?? PHP_INT_MAX;
} else {
- $semester = Semester::findByTimestamp($_SESSION[__CLASS__]['course_start_time']);
+ $semester = Semester::find($_SESSION[__CLASS__]['course_start_semester']);
$course_start = $semester->beginn;
$course_end = $semester->ende;
}
@@ -243,10 +243,10 @@ class LVGroupsWizardStep implements CourseWizardStep
$course = Course::findCurrent();
if ($course) {
- $course_start = $course->start_time;
- $course_end = ($course->end_time < 0 || is_null($course->end_time)) ? PHP_INT_MAX : $course->end_time;
+ $course_start = $course->start_semester?->beginn ?? 0;
+ $course_end = $course->end_semester?->ende ?? PHP_INT_MAX;
} else {
- $semester = Semester::findByTimestamp($_SESSION[__CLASS__]['course_start_time']);
+ $semester = Semester::find($_SESSION[__CLASS__]['course_start_semester']);
$course_start = $semester->beginn;
$course_end = $semester->ende;
}