aboutsummaryrefslogtreecommitdiff
path: root/lib/classes/coursewizardsteps
diff options
context:
space:
mode:
authorJan-Hendrik Willms <tleilax+studip@gmail.com>2024-04-04 11:06:11 +0000
committerJan-Hendrik Willms <tleilax+github@gmail.com>2024-04-04 16:12:32 +0200
commitdc5087c80800e641e939f657808a5bd3dd17d5fc (patch)
tree01b80f5bd925206fd12aa9f72d19d7081712e433 /lib/classes/coursewizardsteps
parentbb333e511b9a85794c50bbd802bb59361898feba (diff)
fixes #3890
Closes #3890 Merge request studip/studip!2741
Diffstat (limited to 'lib/classes/coursewizardsteps')
-rw-r--r--lib/classes/coursewizardsteps/BasicDataWizardStep.php4
-rw-r--r--lib/classes/coursewizardsteps/LVGroupsWizardStep.php25
-rw-r--r--lib/classes/coursewizardsteps/StudyAreasWizardStep.php2
3 files changed, 17 insertions, 14 deletions
diff --git a/lib/classes/coursewizardsteps/BasicDataWizardStep.php b/lib/classes/coursewizardsteps/BasicDataWizardStep.php
index 4f424e8..58fb09f 100644
--- a/lib/classes/coursewizardsteps/BasicDataWizardStep.php
+++ b/lib/classes/coursewizardsteps/BasicDataWizardStep.php
@@ -356,9 +356,9 @@ class BasicDataWizardStep implements CourseWizardStep
htmlReady(get_title_for_status('dozent', 1, $values['coursetype']))
);
}
- if (!$values['lecturers'][$GLOBALS['user']->id] && !$GLOBALS['perm']->have_perm('admin')) {
+ if (empty($values['lecturers'][$GLOBALS['user']->id]) && !$GLOBALS['perm']->have_perm('admin')) {
if (Config::get()->DEPUTIES_ENABLE) {
- if (!$values['deputies'][$GLOBALS['user']->id]) {
+ if (empty($values['deputies'][$GLOBALS['user']->id])) {
$errors[] = sprintf(
_('Sie selbst müssen entweder als %s oder als Vertretung eingetragen sein.'),
htmlReady(get_title_for_status('dozent', 1, $values['coursetype']))
diff --git a/lib/classes/coursewizardsteps/LVGroupsWizardStep.php b/lib/classes/coursewizardsteps/LVGroupsWizardStep.php
index 22f11ea..f343730 100644
--- a/lib/classes/coursewizardsteps/LVGroupsWizardStep.php
+++ b/lib/classes/coursewizardsteps/LVGroupsWizardStep.php
@@ -36,7 +36,7 @@ class LVGroupsWizardStep implements CourseWizardStep
$course_start_time = $values[$step_one_class]['start_time'];
// We only need our own stored values here.
- $values = $values[__CLASS__];
+ $values = $values[__CLASS__] ?? [];
// Load template from step template directory.
$factory = new Flexi_TemplateFactory($GLOBALS['STUDIP_BASE_PATH'] . '/app/views/course/wizard/steps');
@@ -53,9 +53,12 @@ class LVGroupsWizardStep implements CourseWizardStep
}
}
- $selection_details = $values['lvgruppe_selection']['area_details'];
+ $selection_details = $values['lvgruppe_selection']['area_details'] ?? null;
- if ($_SESSION[__CLASS__]['course_start_time'] != $course_start_time) {
+ if (
+ isset($_SESSION[__CLASS__]['course_start_time'])
+ && $_SESSION[__CLASS__]['course_start_time'] != $course_start_time
+ ) {
// don't store previously opened nodes
// because we get in trouble if the semester has changed
$open_nodes = [];
@@ -65,15 +68,15 @@ class LVGroupsWizardStep implements CourseWizardStep
$_SESSION[__CLASS__]['course_start_time'] = $course_start_time;
- $tpl->set_attribute('open_lvg_nodes', $open_nodes);
- $tpl->set_attribute('selection', $selection);
- $tpl->set_attribute('selection_details', $selection_details);
- $tpl->set_attribute('tree', $lvgtree->getRootItem()->getChildren());
+ $tpl->open_lvg_nodes = $open_nodes;
+ $tpl->selection = $selection;
+ $tpl->selection_details = $selection_details;
+ $tpl->tree = $lvgtree->getRootItem()->getChildren();
- $tpl->set_attribute('ajax_url', $values['ajax_url'] ?: URLHelper::getLink('dispatch.php/course/wizard/ajax'));
- $tpl->set_attribute('no_js_url', $values['no_js_url'] ?: 'dispatch.php/course/wizard/forward/'.$stepnumber.'/'.$temp_id);
- $tpl->set_attribute('stepnumber', $stepnumber);
- $tpl->set_attribute('temp_id', $temp_id);
+ $tpl->ajax_url = !empty($values['ajax_url']) ? $values['ajax_url'] : URLHelper::getLink('dispatch.php/course/wizard/ajax');
+ $tpl->no_js_url = !empty($values['no_js_url']) ? $values['no_js_url'] : URLHelper::getURL('dispatch.php/course/wizard/forward/'.$stepnumber.'/'.$temp_id);
+ $tpl->stepnumber = $stepnumber;
+ $tpl->temp_id = $temp_id;
return $tpl->render();
}
diff --git a/lib/classes/coursewizardsteps/StudyAreasWizardStep.php b/lib/classes/coursewizardsteps/StudyAreasWizardStep.php
index f81ce41..29de617 100644
--- a/lib/classes/coursewizardsteps/StudyAreasWizardStep.php
+++ b/lib/classes/coursewizardsteps/StudyAreasWizardStep.php
@@ -28,7 +28,7 @@ class StudyAreasWizardStep implements CourseWizardStep
public function getStepTemplate($values, $stepnumber, $temp_id)
{
// We only need our own stored values here.
- $values = $values[get_class($this)];
+ $values = $values[get_class($this)] ?? [];
// Load template from step template directory.
$factory = new Flexi_TemplateFactory($GLOBALS['STUDIP_BASE_PATH'].'/app/views/course/wizard/steps');
$tpl = $factory->open('studyareas/index');