mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-25 08:34:29 +00:00
Neue Spalte bpk zu Tabelle public.tbl_person hinzugefügt
Cronjob für automatische Abfrage von Matrikelnummern hinzugefügt Script für import der Matriklenummer Clearing Daten hinzugefügt
This commit is contained in:
+13
-1
@@ -2235,6 +2235,18 @@ if ($result = $db->db_query("SELECT * FROM system.tbl_webservicetyp WHERE webser
|
||||
}
|
||||
}
|
||||
|
||||
//Spalte bpk in public.tbl_person
|
||||
if(!$result = @$db->db_query("SELECT bpk FROM public.tbl_person LIMIT 1"))
|
||||
{
|
||||
$qry = "ALTER TABLE public.tbl_person ADD COLUMN bpk varchar(255);
|
||||
COMMENT ON COLUMN public.tbl_person.bpk IS 'Bereichsspezifisches Personenkennzeichen';";
|
||||
|
||||
if(!$db->db_query($qry))
|
||||
echo '<strong>public.tbl_person: '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo '<br>public.tbl_person: Spalte bpk hinzugefuegt';
|
||||
}
|
||||
|
||||
// *** Pruefung und hinzufuegen der neuen Attribute und Tabellen
|
||||
echo '<H2>Pruefe Tabellen und Attribute!</H2>';
|
||||
|
||||
@@ -2428,7 +2440,7 @@ $tabellen=array(
|
||||
"public.tbl_ortraumtyp" => array("ort_kurzbz","hierarchie","raumtyp_kurzbz"),
|
||||
"public.tbl_organisationseinheit" => array("oe_kurzbz", "oe_parent_kurzbz", "bezeichnung","organisationseinheittyp_kurzbz", "aktiv","mailverteiler","freigabegrenze","kurzzeichen","lehre","standort","warn_semesterstunden_frei","warn_semesterstunden_fix","standort_id"),
|
||||
"public.tbl_organisationseinheittyp" => array("organisationseinheittyp_kurzbz", "bezeichnung", "beschreibung"),
|
||||
"public.tbl_person" => array("person_id","staatsbuergerschaft","geburtsnation","sprache","anrede","titelpost","titelpre","nachname","vorname","vornamen","gebdatum","gebort","gebzeit","foto","anmerkung","homepage","svnr","ersatzkennzeichen","familienstand","geschlecht","anzahlkinder","aktiv","insertamum","insertvon","updateamum","updatevon","ext_id","bundesland_code","kompetenzen","kurzbeschreibung","zugangscode", "foto_sperre","matr_nr","zugangscode_timestamp","udf_values"),
|
||||
"public.tbl_person" => array("person_id","staatsbuergerschaft","geburtsnation","sprache","anrede","titelpost","titelpre","nachname","vorname","vornamen","gebdatum","gebort","gebzeit","foto","anmerkung","homepage","svnr","ersatzkennzeichen","familienstand","geschlecht","anzahlkinder","aktiv","insertamum","insertvon","updateamum","updatevon","ext_id","bundesland_code","kompetenzen","kurzbeschreibung","zugangscode", "foto_sperre","matr_nr","zugangscode_timestamp","udf_values","bpk"),
|
||||
"public.tbl_person_fotostatus" => array("person_fotostatus_id","person_id","fotostatus_kurzbz","datum","insertamum","insertvon","updateamum","updatevon"),
|
||||
"public.tbl_personfunktionstandort" => array("personfunktionstandort_id","funktion_kurzbz","person_id","standort_id","position","anrede"),
|
||||
"public.tbl_preincoming" => array("preincoming_id","person_id","mobilitaetsprogramm_code","zweck_code","firma_id","universitaet","aktiv","bachelorthesis","masterthesis","von","bis","uebernommen","insertamum","insertvon","updateamum","updatevon","anmerkung","zgv","zgv_ort","zgv_datum","zgv_name","zgvmaster","zgvmaster_datum","zgvmaster_ort","zgvmaster_name","program_name","bachelor","master","jahre","person_id_emergency","person_id_coordinator_dep","person_id_coordinator_int","code","deutschkurs1","deutschkurs2","research_area","deutschkurs3","ext_id"),
|
||||
|
||||
@@ -0,0 +1,152 @@
|
||||
<?php
|
||||
/* Copyright (C) 2018 fhcomplete.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors: Andreas Oesterreicher <[email protected]>,
|
||||
*/
|
||||
/**
|
||||
* Clearing Import
|
||||
* Importiert Daten aus dem Matrikelnummer Clearing
|
||||
*/
|
||||
require_once('../config/vilesci.config.inc.php');
|
||||
require_once('../include/functions.inc.php');
|
||||
require_once('../include/benutzerberechtigung.class.php');
|
||||
require_once('../include/person.class.php');
|
||||
|
||||
$uid = get_uid();
|
||||
$rechte = new benutzerberechtigung();
|
||||
$rechte->getBerechtigungen($uid);
|
||||
if(!$rechte->isBerechtigt('admin', null, 'suid'))
|
||||
die($rechte->errormsg);
|
||||
|
||||
echo '<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Matrikelnummer Clearing Import</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Matrikelnummer Clearing Import</h1>
|
||||
Über diese Seite kann das Ergebnis des Matrikelnummer Clearings importiert werden.
|
||||
Wähle dazu das Antwort-XML des Matrikelnummer clearings aus, das importiert werden soll.
|
||||
Matrikelnummer und BPK wird aus dem XML importiert.<br><br>';
|
||||
echo '<form method="POST" enctype="multipart/form-data">
|
||||
<input type="file" name="datei">
|
||||
<input type="submit" value="Importieren" />';
|
||||
|
||||
if(isset($_FILES['datei']))
|
||||
{
|
||||
$db = new basis_db();
|
||||
$dom = new DOMDocument();
|
||||
$dom->load($_FILES['datei']['tmp_name']);
|
||||
$studierende = $dom->getElementsByTagName('studierende');
|
||||
if(isset($studierende[0]))
|
||||
{
|
||||
$domnodes_personen = $studierende[0]->getElementsByTagName('personen');
|
||||
foreach($domnodes_personen as $row_person)
|
||||
{
|
||||
$personid_node = $row_person->getElementsByTagName('personId');
|
||||
if(isset($personid_node[0]))
|
||||
{
|
||||
$node_bpk = $personid_node[0]->getElementsByTagName('bpk');
|
||||
$node_personenkennzeichen = $personid_node[0]->getElementsByTagName('personenkennzeichen');
|
||||
$node_matrikelnr = $personid_node[0]->getElementsByTagName('matrikelnummer');
|
||||
|
||||
$bpk = '';
|
||||
$personenkennzeichen = '';
|
||||
$matrikelnr = '';
|
||||
|
||||
if (isset($node_bpk[0]))
|
||||
$bpk = $node_bpk[0]->textContent;
|
||||
if (isset($node_personenkennzeichen[0]))
|
||||
$personenkennzeichen = $node_personenkennzeichen[0]->textContent;
|
||||
if (isset($node_matrikelnr[0]))
|
||||
$matrikelnr = $node_matrikelnr[0]->textContent;
|
||||
|
||||
if($personenkennzeichen != '')
|
||||
{
|
||||
$qry = "
|
||||
SELECT
|
||||
person_id
|
||||
FROM
|
||||
campus.vw_student
|
||||
WHERE
|
||||
matrikelnr=".$db->db_add_param($personenkennzeichen);
|
||||
|
||||
if($result = $db->db_query($qry))
|
||||
{
|
||||
if($db->db_num_rows($result) == 1)
|
||||
{
|
||||
if($row = $db->db_fetch_object($result))
|
||||
{
|
||||
$person_id = $row->person_id;
|
||||
$person = new person();
|
||||
if($person->load($person_id))
|
||||
{
|
||||
$person->matr_nr = $matrikelnr;
|
||||
|
||||
if($bpk != '' && $bpk != '****************************')
|
||||
$person->bpk = $bpk;
|
||||
|
||||
if($person->save())
|
||||
{
|
||||
echo '<br>Daten von '.$personenkennzeichen.' importiert';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<br>Fehler beim Import von '.$personenkennzeichen.':'.$person->errormsg;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<br>Person mit PersonID '.$person_id.' konnte nicht geladen werden';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<br>Failed to get Results';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo 'Person mit Perskz: '.$personenkennzeichen.' konnte nicht eindeutig gefunden werden';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo 'Fehler beim Laden der Person mit Perskz: '.$personenkennzeichen.'';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<br>Failed to get Personenkennzeichen';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<br>personID Tag no present -> wrong xml?';
|
||||
}
|
||||
}
|
||||
echo '<br>Import abgeschlossen';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<br>studierende Tag not present -> wrong xml?';
|
||||
}
|
||||
}
|
||||
|
||||
echo '</body>
|
||||
</html>';
|
||||
Reference in New Issue
Block a user