Skip to content
Snippets Groups Projects
Commit bd89198e authored by David Siegfried's avatar David Siegfried
Browse files

prevent php-warnings, closes #2280

Closes #2280

Merge request studip/studip!1506
parent 57746e90
No related branches found
No related tags found
1 merge request!4Draft: Icon creation
......@@ -108,6 +108,8 @@ class Course_WizardController extends AuthenticatedController
*/
public function process_action($step_number, $temp_id)
{
$stop = false;
$next_step = 0;
$this->temp_id = $temp_id;
// Get request data and store it in session.
$iterator = Request::getInstance()->getIterator();
......@@ -230,7 +232,7 @@ class Course_WizardController extends AuthenticatedController
}
if (!$stop) {
// We are after the last step -> all done, show summary.
if ($next_step >= sizeof($this->steps)) {
if ($next_step >= count($this->steps)) {
$this->redirect($this->url_for('course/wizard/summary', $next_step, $temp_id));
// Redirect to next step.
} else {
......@@ -246,6 +248,7 @@ class Course_WizardController extends AuthenticatedController
{
$this->stepnumber = $stepnumber;
$this->temp_id = $temp_id;
$this->source_course = null;
if (!$this->getValues()) {
PageLayout::postError(_('Ihre Session ist abgelaufen, bitte erneut anfangen.'));
$this->redirect('course/wizard');
......
......@@ -16,7 +16,7 @@
<footer data-dialog-button>
<input type="hidden" name="step" value="<?= $stepnumber ?>">
<? if (!$first_step): ?>
<? if (empty($first_step)): ?>
<?= Studip\Button::create(
_('Zurück'),
'back',
......
<?php if (empty($search_result) || in_array($node->id, $search_result)) : ?>
<li class="sem-tree-<?= htmlReady($node->id) ?> keep-node" data-id="<?= $node->id ?>">
<?php if ($node->isAssignable()) : ?>
<?= Icon::create('arr_2left', 'sort')->asInput(["name" => 'assign['.$node->id.']', "onclick" => "return STUDIP.CourseWizard.assignNode('".$node->id."')", "class" => in_array($node->id,$values['studyareas']?:[])?'hidden-no-js':'', "style" => in_array($node->id,$values['studyareas']?:[])?'display:none':false]) ?>
<?= Icon::create('arr_2left', 'sort')->asInput(["name" => 'assign['.$node->id.']', "onclick" => "return STUDIP.CourseWizard.assignNode('".$node->id."')", "class" => in_array($node->id, $values['studyareas'] ??[])?'hidden-no-js':'', "style" => in_array($node->id, $values['studyareas'] ?? [])?'display:none':false]) ?>
<?php endif ?>
<?php if ($node->hasChildren()) : ?>
<input type="checkbox" id="<?= htmlReady($node->id) ?>"<?= (in_array($node->id, $open_nodes) && $node->parent_id != $values['open_node']) ? ' checked="checked"' : '' ?>/>
......
......@@ -40,7 +40,7 @@
</fieldset>
<footer data-dialog-button>
<? if ($_SESSION['coursewizard'][$this->temp_id]['batchcreate']) : ?>
<? if (isset($_SESSION['coursewizard'][$this->temp_id]['batchcreate'])) : ?>
<? foreach ($_SESSION['coursewizard'][$this->temp_id]['batchcreate'] as $key => $value) : ?>
<input type="hidden" name="batchcreate[<?= $key ?>]" value="<?= $value ?>">
<? endforeach ?>
......
......@@ -143,7 +143,7 @@ class StudyAreasWizardStep implements CourseWizardStep
$values = $values[get_class($this)];
$ok = true;
$errors = [];
if (!$values['studyareas']) {
if (empty($values['studyareas'])) {
$ok = false;
$errors[] = _('Die Veranstaltung muss mindestens einem Studienbereich zugeordnet sein.');
}
......
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