From 57fe1f966416198eb9e88ce4a7661359703247b2 Mon Sep 17 00:00:00 2001 From: bison-paolo Date: Wed, 2 Nov 2016 15:42:05 +0100 Subject: [PATCH] vilesci/personen/leistungsstipendium.php: - Selects the current studiensemester in the studiensemester drop-down list - Checks if the student is also present in the previous studiensemester to the posted one --- vilesci/personen/leistungsstipendium.php | 31 +++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/vilesci/personen/leistungsstipendium.php b/vilesci/personen/leistungsstipendium.php index a63427ebb..4b1d02fc1 100755 --- a/vilesci/personen/leistungsstipendium.php +++ b/vilesci/personen/leistungsstipendium.php @@ -46,6 +46,12 @@ if ($studiensemester->getAll("desc") === false) die("Error: " . $studiensemester->errormsg); } +// Gets current studiensemester +if (($currentStudiensemester = $studiensemester->getakt()) === false) +{ + die("Error: " . $studiensemester->errormsg); +} + // Gets all activ studiengang $studiengang = new studiengang(); if ($studiengang->getAll("kurzbzlang", true) === false) @@ -217,6 +223,12 @@ if (!$errorOccurred && $dataPosted) $student = new student(); // Object that represents a student $fileRow = false; // Contains a single file row $lineNumber = 0; // lines number counter + + // Gets the previous studiensemester to the posted one + if (($previousStudiensemester = $studiensemester->getPreviousFrom($postStudiensemester)) === false) + { + die("Error: " . $studiensemester->errormsg); + } // Loops on file rows do @@ -250,8 +262,10 @@ if (!$errorOccurred && $dataPosted) $uid = $rowCode; $student->errormsg = ""; // Clean errors messages } - // Looking for a person by uid that is valid for that studiensemester - if ($student->load($uid, $postStudiensemester) === true) + // Looking for a person by uid that is valid for the posted studiensemester + // or for the previous one + if ($student->load($uid, $postStudiensemester) === true + || $student->load($uid, $previousStudiensemester) === true) { // If the student is valid for that studiengang // and checks if the studiengang present in the file is @@ -379,10 +393,21 @@ if (!$errorOccurred && $dataPosted)