mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-18 15:32:17 +00:00
This commit is contained in:
@@ -304,7 +304,8 @@ class benutzerberechtigung
|
||||
//Wenn Fachbereichs oder Adminberechtigung
|
||||
if(($berechtigung == $b->berechtigung_kurzbz || $b->berechtigung_kurzbz == 'admin')
|
||||
&& ($b->fachbereich_kurzbz==$fachbereich_kurzbz || is_null($b->fachbereich_kurzbz))
|
||||
&& (is_null($b->studiengang_kz) || $b->studiengang_kz==$studiengang_kz))
|
||||
&& (is_null($b->studiengang_kz) || $b->studiengang_kz==$studiengang_kz)
|
||||
&& ($art==null || strstr($b->art, $art)))
|
||||
{
|
||||
if ($b->starttimestamp!=null && $b->endetimestamp!=null)
|
||||
{
|
||||
|
||||
@@ -296,4 +296,33 @@ INSERT INTO public.tbl_buchungstyp VALUES ('Lehrmittelbeitrag', 'Lehrmittelbeitr
|
||||
INSERT INTO public.tbl_buchungstyp VALUES ('Studiengebuehr', 'Studiengebühr');
|
||||
INSERT INTO public.tbl_buchungstyp VALUES ('Sonstiges', 'Sonstiges');
|
||||
INSERT INTO public.tbl_buchungstyp VALUES ('Unkostenbeitrag', 'Unkostenbeitrag');
|
||||
INSERT INTO public.tbl_buchungstyp VALUES ('Kaution', 'Kaution');
|
||||
INSERT INTO public.tbl_buchungstyp VALUES ('Kaution', 'Kaution');
|
||||
|
||||
-- bis.tbl_mobilitaetsprogramm
|
||||
INSERT INTO bis.tbl_mobilitaetsprogramm VALUES (6, 'CEEPUS', 'CEEPUS');
|
||||
INSERT INTO bis.tbl_mobilitaetsprogramm VALUES (7, 'ERASMUS', 'ERASMUS');
|
||||
INSERT INTO bis.tbl_mobilitaetsprogramm VALUES (9, 'LEONARDO', 'LEONARDO da VINCI');
|
||||
INSERT INTO bis.tbl_mobilitaetsprogramm VALUES (10, 'supranat', 'Praktikum bei einer internationalen oder supranationalen Organisation');
|
||||
INSERT INTO bis.tbl_mobilitaetsprogramm VALUES (11, 'DAF', 'Deutsch als Fremdsprache - Praktikum (DAF)');
|
||||
INSERT INTO bis.tbl_mobilitaetsprogramm VALUES (12, 'Postgrad', 'Postgraduate - Stipendium (Fulbright, Bundesministerium für Bildung, Wissenschaft und Kultur');
|
||||
INSERT INTO bis.tbl_mobilitaetsprogramm VALUES (13, 'Austausch', 'Austauschstipendium (z.B. Kulturabkommen, Aktionen Österreich-...)');
|
||||
INSERT INTO bis.tbl_mobilitaetsprogramm VALUES (14, 'Ausland', 'Auslandstipendium für Studierende von Universitäten der Künste');
|
||||
INSERT INTO bis.tbl_mobilitaetsprogramm VALUES (20, 'Gödel', 'Kurt Gödl - Stipendium');
|
||||
INSERT INTO bis.tbl_mobilitaetsprogramm VALUES (22, 'ALektorat', 'Auslandslektorat');
|
||||
INSERT INTO bis.tbl_mobilitaetsprogramm VALUES (30, 'so.Stip.', 'sonstiges Stipendium');
|
||||
INSERT INTO bis.tbl_mobilitaetsprogramm VALUES (31, 'EZusS', 'Stipendium der österreichischen Entwicklungszusammenarbeit');
|
||||
INSERT INTO bis.tbl_mobilitaetsprogramm VALUES (32, 'ÖStip', 'Österreich - Stipendium');
|
||||
INSERT INTO bis.tbl_mobilitaetsprogramm VALUES (33, 'Mach', 'Erst Mach - Stipendium');
|
||||
INSERT INTO bis.tbl_mobilitaetsprogramm VALUES (34, 'Werfel', 'Franz Werfel - Stipendium');
|
||||
INSERT INTO bis.tbl_mobilitaetsprogramm VALUES (35, 'Suttner', 'Bertha von Suttner - Stipendium');
|
||||
INSERT INTO bis.tbl_mobilitaetsprogramm VALUES (37, 'APART', 'APART - Stipendium der Österreichischen Akademie der Wissenschaften');
|
||||
INSERT INTO bis.tbl_mobilitaetsprogramm VALUES (41, 'EU3Prog.', 'EU-Drittstaatenprogramm (EU-China, EU-USA, EU-Kanada, usw.)');
|
||||
INSERT INTO bis.tbl_mobilitaetsprogramm VALUES (42, 'EUPrak', 'EU-Praktikumstipendium (EU-Kommission, EU-Rat, EU_Parlament)');
|
||||
INSERT INTO bis.tbl_mobilitaetsprogramm VALUES (201, 'FH-Mob', 'Von der FH organisierte/r Mobilitätsvereinbarung (Partnerschaftsabkommen, udgl.) bzw. Aufenthalt');
|
||||
INSERT INTO bis.tbl_mobilitaetsprogramm VALUES (202, 'selbst', 'Vom Studierenden selbst organisierte/r Mobilitätsvereinbarung bzw. Aufenthalt');
|
||||
INSERT INTO bis.tbl_mobilitaetsprogramm VALUES (203, 'FHspez.', 'FH-spezifisches Mobilitätsprogramm mit einem anderen österreichischen FH-Studiengang');
|
||||
|
||||
-- bis.tbl_zweck
|
||||
INSERT INTO bis.tbl_zweck VALUES ('1', 'S', 'Studium');
|
||||
INSERT INTO bis.tbl_zweck VALUES ('2', 'P', 'Praktikum');
|
||||
INSERT INTO bis.tbl_zweck VALUES ('3', 'SP', 'Studium und Praktikum');
|
||||
|
||||
@@ -0,0 +1,157 @@
|
||||
<?php
|
||||
// **************************************
|
||||
// Syncronisiert alle Mobilitaetsprogramme
|
||||
// StPoelten -> VILESCI
|
||||
// setzt vorraus: - tbl_student
|
||||
// - tbl_nation
|
||||
// - tbl_zweck
|
||||
// - tbl_mobilitaetsprogramm
|
||||
//
|
||||
// Beschreibung:
|
||||
// Syncronisiert alle Eintraege aus der Tabelle StudIO nach bis.tbl_bisio
|
||||
// **************************************
|
||||
require_once('sync_config.inc.php');
|
||||
require_once('../../../include/bisio.class.php');
|
||||
|
||||
//$conn=pg_connect(CONN_STRING);
|
||||
if (!$conn_ext=mssql_connect (STPDB_SERVER, STPDB_USER, STPDB_PASSWD))
|
||||
die('Fehler beim Verbindungsaufbau!');
|
||||
mssql_select_db(STPDB_DB, $conn_ext);
|
||||
|
||||
if(!$conn = pg_pconnect(CONN_STRING))
|
||||
die('Fehler beim Verbindungsaufbau!');
|
||||
|
||||
echo '
|
||||
<html>
|
||||
<head>
|
||||
<title>STP - VILESCI (BisIO)</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
</head>
|
||||
<body>';
|
||||
|
||||
echo 'Starte BisIO Syncronisation '.date('H:i:s').'<br>';
|
||||
flush();
|
||||
|
||||
$gesamt=0;
|
||||
$statistik='';
|
||||
$error=0;
|
||||
$anzahl_insert=0;
|
||||
$head_text="Dies ist eine automatische Mail!\n\nFolgende Fehler sind bei der Synchronisation des BisIO aufgetreten:\n\n";
|
||||
$text='';
|
||||
|
||||
// ******** SYNC START ********** //
|
||||
|
||||
$qry = "SELECT __id, _person, _mobiprg, _gastland, von, bis, _zweck, chkurzbez FROM studio JOIN staat on(_gastland=__staat)";
|
||||
|
||||
if($result_ext = mssql_query($qry, $conn_ext))
|
||||
{
|
||||
while($row_ext=mssql_fetch_object($result_ext))
|
||||
{
|
||||
$gesamt++;
|
||||
|
||||
//Eintrag suchen
|
||||
$qry = "SELECT * FROM bis.tbl_bisio WHERE ext_id='$row_ext->__id'";
|
||||
if($result = pg_query($conn, $qry))
|
||||
{
|
||||
if($row = pg_fetch_object($result))
|
||||
{
|
||||
$bisio_id = $row->bisio_id;
|
||||
//Kein Update - Datensatz ueberpringen
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$text.="Fehler beim Ermitteln der ExtID: ".pg_last_error($conn)."\n";
|
||||
$error++;
|
||||
continue;
|
||||
}
|
||||
|
||||
//Person suchen
|
||||
$qry = "SELECT student_uid FROM public.tbl_student WHERE ext_id='$row_ext->_person'";
|
||||
if($result = pg_query($conn, $qry))
|
||||
{
|
||||
if($row = pg_fetch_object($result))
|
||||
{
|
||||
$student_uid = $row->student_uid;
|
||||
}
|
||||
else
|
||||
{
|
||||
$text.="Person $row_ext->_person wurde nicht gefunden\n";
|
||||
$error++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$text.="Fehler beim Ermitteln der Person: ".pg_last_error($conn)."\n";
|
||||
$error++;
|
||||
continue;
|
||||
}
|
||||
|
||||
$qry = "SELECT * FROM bis.tbl_nation WHERE nation_code='$row_ext->chkurzbez'";
|
||||
if($result = pg_query($conn, $qry))
|
||||
{
|
||||
if($row = pg_fetch_object($result))
|
||||
{
|
||||
//Nation ist vorhanden
|
||||
}
|
||||
else
|
||||
{
|
||||
$text.="Nation $row_ext->chkurzbez wurde nicht gefunden\n";
|
||||
$error++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$text.="Fehler beim Ermitteln der Nation: ".pg_last_error($conn)."\n";
|
||||
$error++;
|
||||
continue;
|
||||
}
|
||||
|
||||
$bisio = new bisio($conn);
|
||||
$bisio->mobilitaetsprogramm_code = $row_ext->_mobiprg;
|
||||
$bisio->nation_code = $row_ext->chkurzbez;
|
||||
$bisio->von = ($row_ext->von!=''?date('Y-m-d', strtotime($row_ext->von)):'');
|
||||
$bisio->bis = ($row_ext->bis!=''?date('Y-m-d', strtotime($row_ext->bis)):'');
|
||||
$bisio->zweck_code = $row_ext->_zweck;
|
||||
$bisio->student_uid = $student_uid;
|
||||
$bisio->updateamum = date('Y-m-d H:i:s');
|
||||
$bisio->updatevon = 'sync';
|
||||
$bisio->insertamum = date('Y-m-d H:i:s');
|
||||
$bisio->insertvon = 'sync';
|
||||
$bisio->ext_id = $row_ext->__id;
|
||||
|
||||
if($bisio->save(true))
|
||||
{
|
||||
$text.="Eintrag fuer $student_uid wurde angelegt\n";
|
||||
$anzahl_insert++;
|
||||
}
|
||||
else
|
||||
{
|
||||
$text.="Fehler beim Anlegen: $bisio->errormsg\n";
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
$text.= "Fehler beim Laden des Kontos\n\n";
|
||||
|
||||
$statistik .="Gesamt: $gesamt\n";
|
||||
$statistik .="Eingefuegt: $anzahl_insert\n";
|
||||
$statistik .="Fehler: $error\n";
|
||||
|
||||
$text = $statistik."\n\n".$text;
|
||||
$to = 'oesi@technikum-wien.at';
|
||||
//$to = $adress_ext;
|
||||
|
||||
if(mail($to, 'SYNC BisIO',$head_text.$text, "From: nsc@fhstp.ac.at"))
|
||||
echo "Mail wurde an $to versandt<br><br>";
|
||||
else
|
||||
echo "Fehler beim Senden an $to<br><br>";
|
||||
|
||||
echo nl2br($text);
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user