From 283a5d2c22e761b41b5b6f962377cc6994b7c325 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Thu, 22 Oct 2020 17:15:53 +0200 Subject: [PATCH] =?UTF-8?q?BIS-Meldung:=20Angerechnete=20ECTS=20bei=20Ausl?= =?UTF-8?q?andssemester=20wird=20nur=20gerpr=C3=BCft=20wenn=20das=20Auslan?= =?UTF-8?q?dssemester=20vorbei=20ist?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vilesci/bis/studentenmeldung.php | 99 +++++++++++++++++--------------- 1 file changed, 52 insertions(+), 47 deletions(-) diff --git a/vilesci/bis/studentenmeldung.php b/vilesci/bis/studentenmeldung.php index 40c63b7b7..f27d3602f 100644 --- a/vilesci/bis/studentenmeldung.php +++ b/vilesci/bis/studentenmeldung.php @@ -625,7 +625,7 @@ function GenerateXMLStudentBlock($row) $ausserordentlich=true; else $ausserordentlich=false; - + // Pruefen, ob Incoming (3.Stelle in Personenkennzeichen = 0) $incoming = mb_substr($row->matrikelnr,2,1) == '0' ? true : false; @@ -652,7 +652,7 @@ function GenerateXMLStudentBlock($row) $nation=''; $co_name = ''; } - + // Zustelladresse & c/o Name(=abweichender Empfaenger) $qryzustelladr = " SELECT * @@ -661,17 +661,17 @@ function GenerateXMLStudentBlock($row) AND person_id=". $db->db_add_param($row->pers_id). "; "; $results = $db->db_query($qryzustelladr); - + if ($db->db_num_rows($results) != 1) { $error_log1.= "Es sind ".$db->db_num_rows($results)." Zustelladressen eingetragen\n"; } - + $zustell_plz = ''; $zustell_gemeinde = ''; $zustell_strasse = ''; $zustell_nation = ''; - + if ($rowzustelladr = $db->db_fetch_object($results)) { $zustell_plz = $rowzustelladr->plz; @@ -679,14 +679,14 @@ function GenerateXMLStudentBlock($row) $zustell_strasse = $rowzustelladr->strasse; $zustell_nation = $rowzustelladr->nation; } - + // FH eMail-Adresse FH aus UID@Domain $email = ''; if ($row->student_uid != '') { $email = $row->student_uid. '@'. DOMAIN; } - + if($row->gebdatum<'1920-01-01' OR $row->gebdatum==null OR $row->gebdatum=='') { $error_log.=(!empty($error_log)?', ':'')."Geburtsdatum ('".$row->gebdatum."')"; @@ -761,7 +761,7 @@ function GenerateXMLStudentBlock($row) { $error_log.=(!empty($error_log) ? ', ' : ''). "bPK-Zeichenfolge ist ungültig"; } - + if (strlen($row->bpk) != 28) { $error_log.=(!empty($error_log) ? ', ' : ''). "bPK ist nicht 28 Zeichen lang"; @@ -773,29 +773,29 @@ function GenerateXMLStudentBlock($row) { $error_log.=(!empty($error_log)?', ':'')."Zustell-PLZ fehlt"; } - + if ($zustell_gemeinde == '' || $zustell_gemeinde == null) { $error_log.=(!empty($error_log)?', ':'')."Zustell-Gemeinde fehlt"; } - + if ($zustell_strasse == '' || $zustell_strasse == null) { $error_log.=(!empty($error_log)?', ':'')."Zustell-Strasse fehlt"; } - + if ($zustell_nation == '' || $zustell_nation == null) { $error_log.=(!empty($error_log)?', ':'')."Zustell-Nation fehlt"; } - + if ($email == '' || $email == null) { $error_log.=(!empty($error_log)?', ':'')."Studenten-eMail Adresse fehlt (keine Student-UID eingetragen)."; } - + } - + if(!$ausserordentlich) { if($row->zgv_code=='' || $row->zgv_code==null) @@ -1157,36 +1157,36 @@ function GenerateXMLStudentBlock($row) $datei .= " " . trim($row->matrikelnr) . ""; - + $datei .= " " . $row->matr_nr . ""; - + if (!$ausserordentlich) { $datei .= " " . $orgform_code_array[$storgform] . ""; } - + $datei .= " " . date("dmY", $datumobj->mktime_fromdate($row->gebdatum)) . " " . strtoupper($row->geschlecht) . ""; - + if ($row->titelpre != '') { $datei .= " " . $row->titelpre . ""; } - + if ($row->titelpost != '') { $datei .= " " . $row->titelpost . ""; } - + $datei .= " " . $row->vorname . " " . $row->nachname . ""; - + if ($row->svnr != '') { $datei .= " @@ -1197,18 +1197,18 @@ function GenerateXMLStudentBlock($row) $datei .= " " . $row->ersatzkennzeichen . ""; } - + $datei .= " " . $row->bpk . " "; - + $datei .= " " . $row->staatsbuergerschaft . " " . $plz . " " . $gemeinde . " " . $nation . ""; - + if (!$ausserordentlich && !$incoming) { $datei .= " @@ -1217,21 +1217,21 @@ function GenerateXMLStudentBlock($row) " . $zustell_strasse . " " . $zustell_nation . ""; } - + if ($co_name != '') { $datei .= " " . $co_name . " "; } - + if ($email != '') { $datei .= " " . $email . " "; } - + if(!$ausserordentlich) { $datei.=" @@ -1337,12 +1337,12 @@ function GenerateXMLStudentBlock($row) $adauer = (is_null($rowio->von) || is_null($rowio->bis)) ? null : $datumobj->DateDiff($rowio->von, $rowio->bis); - + // Aufenthaltszweckcode -------------------------------------------------------------------------------- $bisio_zweck = new bisio(); $bisio_zweck->getZweck($rowio->bisio_id); $zweck_code_arr = array(); - + // Bei Incomings... if ($aktstatus == 'Incoming') { @@ -1352,7 +1352,7 @@ function GenerateXMLStudentBlock($row) $error_log_io .= (!empty($error_log_io) ? ', ' : ''). "Es sind". count($bisio_zweck->result). " Aufenthaltszwecke eingetragen (max. 1 Zweck für Incomings)"; } - + //...nur Zweck 1, 2 oder 3 erlaubt if (count($bisio_zweck->result) == 1 && empty(array_intersect(array(1, 2, 3), array_column($bisio_zweck->result, 'zweck_code')))) @@ -1361,7 +1361,7 @@ function GenerateXMLStudentBlock($row) $bisio_zweck->result[0]->zweck_code. " (für Incomings ist nur Zweck 1, 2, 3 erlaubt)"; } } - + foreach ($bisio_zweck->result as $row_zweck) { // Nur eindeutige Werte (bei Mehrfachangaben; trifft auf Outgoings zu) @@ -1373,26 +1373,26 @@ function GenerateXMLStudentBlock($row) $error_log_io .= (!empty($error_log_io) ? ', ' : ''). "Aufenthaltzweckcode 1, 2, 3 dürfen nicht gemeinsam gemeldet werden"; } - + $zweck_code_arr []= $row_zweck->zweck_code; } } - + // Aufenthaltfoerderungscode --------------------------------------------------------------------------- $aufenthaltfoerderung_code_arr = array(); - + // Nur bei Outgoings Aufenthaltsfoerderungscode melden if ($aktstatus != 'Incoming') { $bisio_foerderung = new bisio(); $bisio_foerderung->getFoerderungen($rowio->bisio_id); - + // ... mindestens 1 Aufenthaltfoerderung melden, wenn Auslandsaufenthalt >= 29 Tage if ((!$bisio_foerderung->result || count($bisio_foerderung->result) == 0) && $adauer >= 29) { $error_log_io .= (!empty($error_log_io) ? ', ' : '') . "Keine Aufenthaltsfoerderung angegeben (bei Outgoings >= 29 Tage Monat im Ausland muss mind. 1 gemeldet werden)"; } - + foreach ($bisio_foerderung->result as $row_foerderung) { // ...wenn code = 5, nur ein Wert erlaubt (keine Mehrfachangaben) @@ -1401,26 +1401,31 @@ function GenerateXMLStudentBlock($row) $aufenthaltfoerderung_code_arr [] = $row_foerderung->aufenthaltfoerderung_code; break; } - + // nur eindeutige Werte if (!in_array($row_foerderung->aufenthaltfoerderung_code, $aufenthaltfoerderung_code_arr)) { $aufenthaltfoerderung_code_arr [] = $row_foerderung->aufenthaltfoerderung_code; } } - - if ($rowio->ects_erworben == '' && $adauer >= 29) + + if($datumobj->mktime_fromdate($rowio->bis) < $datumobj->mktime_fromdate($bisdatum)) + $aufenthalt_finished = true; + else + $aufenthalt_finished = false; + + if ($rowio->ects_erworben == '' && $adauer >= 29 && $aufenthalt_finished) { $error_log_io .= (!empty($error_log_io) ? ', ' : '') . "Erworbene ECTS fehlen (Meldepflicht bei Outgoings >= 29 Tage Monat im Ausland)"; } - - if ($rowio->ects_angerechnet == '' && $adauer >= 29) + + if ($rowio->ects_angerechnet == '' && $adauer >= 29 && $aufenthalt_finished) { $error_log_io .= (!empty($error_log_io) ? ', ' : '') . "Angerechnete ECTS fehlen (Meldepflicht bei Outgoings >= 29 Tage Monat im Ausland)"; } } - + // Bei validen Daten errorlog ausgeben if($error_log_io != '') { @@ -1446,7 +1451,7 @@ function GenerateXMLStudentBlock($row) $datei.=" ".$abis.""; } - + foreach ($zweck_code_arr as $zweck) { $datei.=" @@ -1467,13 +1472,13 @@ function GenerateXMLStudentBlock($row) $datei.=" ". $aufenthaltfoerderung_code. ""; } - + $datei.=" "; } - - - + + + if($aktstatus!='Incoming') { if(!isset($iosem[$storgform][$sem]))