diff --git a/content/student/studentrolledialog.js.php b/content/student/studentrolledialog.js.php index ef0291fe4..6f058f526 100644 --- a/content/student/studentrolledialog.js.php +++ b/content/student/studentrolledialog.js.php @@ -118,7 +118,11 @@ function StudentRolleLoadStatusgrund(status_kurzbz, statusgrund_id) { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); var menulistgrund = document.getElementById('student-rolle-menulist-statusgrund'); - url='rdf/statusgrund.rdf.php?status_kurzbz='+status_kurzbz+'&include_id='+statusgrund_id+'&ts'+gettimestamp(); + + if (typeof statusgrund_id !== 'undefined') + url='rdf/statusgrund.rdf.php?status_kurzbz='+status_kurzbz+'&include_id='+statusgrund_id+'&ts'+gettimestamp(); + else + url='rdf/statusgrund.rdf.php?status_kurzbz='+status_kurzbz+'&ts'+gettimestamp(); try { diff --git a/include/statusgrund.class.php b/include/statusgrund.class.php index aa084b8c6..c0a2aa3a0 100644 --- a/include/statusgrund.class.php +++ b/include/statusgrund.class.php @@ -179,5 +179,19 @@ class statusgrund extends basis_db return true; } + + public function getByBezeichnung($beschreibung) + { + $qry = " + SELECT + * + FROM + public.tbl_status_grund + WHERE beschreibung[1] = '" . $beschreibung . "' + + "; + $this->db_query($qry); + return $this->db_fetch_object(); + } } ?> diff --git a/vilesci/personen/student_vorrueckung.php b/vilesci/personen/student_vorrueckung.php index 960413c2a..25f1dcbb6 100644 --- a/vilesci/personen/student_vorrueckung.php +++ b/vilesci/personen/student_vorrueckung.php @@ -32,6 +32,7 @@ require_once('../../include/benutzerberechtigung.class.php'); require_once('../../include/lehrverband.class.php'); require_once('../../include/studienordnung.class.php'); require_once('../../include/studienplan.class.php'); +require_once('../../include/statusgrund.class.php'); if (!$db = new basis_db()) die('Es konnte keine Verbindung zum Server aufgebaut werden.'); @@ -301,6 +302,15 @@ if (isset($_POST['vorr'])) } } + $statusgrundObj = new statusgrund($row_status->statusgrund_id); + $newStatusgrund = null; + if ($statusgrundObj->bezeichnung_mehrsprachig[DEFAULT_LANGUAGE] === "Pre-Wiederholer" && $row_status->ausbildungssemester > 1) + { + $s = $row->semester_stlv - 1; + $ausbildungssemester = $row_status->ausbildungssemester - 1; + $newStatusgrund = $statusgrundObj->getByBezeichnung('Wiederholer')->statusgrund_id; + } + $lvb = new lehrverband(); //Lehrverbandgruppe anlegen, wenn noch nicht vorhanden @@ -364,14 +374,15 @@ if (isset($_POST['vorr'])) //Eintragen des neuen Status $sql .= "INSERT INTO public.tbl_prestudentstatus (prestudent_id, status_kurzbz, studiensemester_kurzbz, ausbildungssemester, datum, insertamum, - insertvon, updateamum, updatevon, ext_id, orgform_kurzbz, studienplan_id) + insertvon, updateamum, updatevon, ext_id, orgform_kurzbz, studienplan_id, statusgrund_id) VALUES (".$db->db_add_param($row->prestudent_id).", ". $db->db_add_param($row_status->status_kurzbz).", ". $db->db_add_param($next_ss).", ". $db->db_add_param($ausbildungssemester).", now(), now(), ". $db->db_add_param($user).", NULL, NULL, NULL, ". $db->db_add_param($row_status->orgform_kurzbz).", ". - $db->db_add_param($studienplan_id).");"; + $db->db_add_param($studienplan_id).", ". + $db->db_add_param($newStatusgrund).");"; } if ($sql != '') { @@ -408,7 +419,7 @@ $outp .= '