fue.tbl_ressource.student_uid to uid

This commit is contained in:
Andreas Moik
2016-04-20 11:18:58 +02:00
parent a4b67c5072
commit 3f74f253a7
8 changed files with 1243 additions and 1235 deletions
@@ -1,29 +1,29 @@
<?php
/* Copyright (C) 2006 Technikum-Wien
*
* 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: Christian Paminger <christian.paminger@technikum-wien.at>,
<?php
/* Copyright (C) 2006 Technikum-Wien
*
* 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: Christian Paminger <christian.paminger@technikum-wien.at>,
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at> and
* Gerald Raab <erald.raab@technikum-wien.at> and
* Rudolf Hangl <rudolf.hangl@technikum-wien.at>.
*/
* Gerald Raab <erald.raab@technikum-wien.at> and
* Rudolf Hangl <rudolf.hangl@technikum-wien.at>.
*/
$projekt_ressource_id = $_GET["id"];
require_once('../../config/vilesci.config.inc.php');
require_once('../../config/vilesci.config.inc.php');
require_once('../../include/functions.inc.php');
require_once('../../include/ressource.class.php');
@@ -47,25 +47,25 @@ else
$mitarbeiter_sel = ' selected="true"';
}
header("Cache-Control: no-cache");
header("Cache-Control: post-check=0, pre-check=0",false);
header("Expires Mon, 26 Jul 1997 05:00:00 GMT");
header("Pragma: no-cache");
header("Content-type: application/vnd.mozilla.xul+xml");
require_once('../../config/vilesci.config.inc.php');
echo '<?xml version="1.0" encoding="UTF-8"?>'."\n";
echo '<?xml-stylesheet href="'.APP_ROOT.'skin/tempus.css" type="text/css"?>';
?>
<window id="window-ressource-neu" title="Projektressource verwalten"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
>
<script type="text/javascript" language="JavaScript" src="<?php echo APP_ROOT; ?>include/js/jquery.js"></script>
<script type="text/javascript" language="JavaScript" src="<?php echo APP_ROOT; ?>include/js/jqSOAPClient.js"></script>
<script type="text/javascript" language="JavaScript" src="<?php echo APP_ROOT; ?>include/js/jqXMLUtils.js"></script>
<script type="text/javascript" language="JavaScript" src="<?php echo APP_ROOT; ?>content/functions.js.php"></script>
header("Cache-Control: no-cache");
header("Cache-Control: post-check=0, pre-check=0",false);
header("Expires Mon, 26 Jul 1997 05:00:00 GMT");
header("Pragma: no-cache");
header("Content-type: application/vnd.mozilla.xul+xml");
require_once('../../config/vilesci.config.inc.php');
echo '<?xml version="1.0" encoding="UTF-8"?>'."\n";
echo '<?xml-stylesheet href="'.APP_ROOT.'skin/tempus.css" type="text/css"?>';
?>
<window id="window-ressource-neu" title="Projektressource verwalten"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
>
<script type="text/javascript" language="JavaScript" src="<?php echo APP_ROOT; ?>include/js/jquery.js"></script>
<script type="text/javascript" language="JavaScript" src="<?php echo APP_ROOT; ?>include/js/jqSOAPClient.js"></script>
<script type="text/javascript" language="JavaScript" src="<?php echo APP_ROOT; ?>include/js/jqXMLUtils.js"></script>
<script type="text/javascript" language="JavaScript" src="<?php echo APP_ROOT; ?>content/functions.js.php"></script>
<script type="text/javascript" language="JavaScript" src="<?php echo APP_ROOT; ?>content/projekt/projekt_ressource.window.js.php"></script>
<script type="text/javascript">
var projekt_ressource_id = '<?php echo $projekt_ressource_id ?>';
@@ -76,23 +76,23 @@ echo '<?xml-stylesheet href="'.APP_ROOT.'skin/tempus.css" type="text/css"?>';
var ressource_id = '<?php echo $ressource_id; ?>';
var funktion_kurzbz = '<?php echo $funktion_kurzbz; ?>';
var beschreibung = '<?php echo $beschreibung; ?>';
</script>
<vbox>
<checkbox id="checkbox-ressource-neu" hidden="true"/>
<groupbox id="groupbox-ressource" flex="1">
<caption label="Details"/>
<grid id="grid-ressource-detail" style="overflow:auto;margin:4px;" flex="1">
<columns >
<column flex="1"/>
<column flex="5"/>
</columns>
</script>
<vbox>
<checkbox id="checkbox-ressource-neu" hidden="true"/>
<groupbox id="groupbox-ressource" flex="1">
<caption label="Details"/>
<grid id="grid-ressource-detail" style="overflow:auto;margin:4px;" flex="1">
<columns >
<column flex="1"/>
<column flex="5"/>
</columns>
<rows>
<row>
<row>
<label value="ProjektRessourceID" control="textbox-ressource-projekt_ressource_id"/>
<textbox id="textbox-ressource-projekt_ressource_id" value="<?php echo $projekt_ressource_id; ?>" disabled="true" />
<textbox id="textbox-ressource-projekt_ressource_id" value="<?php echo $projekt_ressource_id; ?>" disabled="true" />
</row>
<row>
<label value="Funktion" control="textbox-ressource-funktionradio"/>
@@ -100,18 +100,18 @@ echo '<?xml-stylesheet href="'.APP_ROOT.'skin/tempus.css" type="text/css"?>';
<radio id="leitung" label="Leitung" <?php echo $leitung_sel; ?>/>
<radio id="mitarbeiter" label="Mitarbeiter" <?php echo $mitarbeiter_sel; ?>/>
</radiogroup>
</row>
<row>
<label value="Aufwand" control="textbox-ressource-aufwand"/>
<textbox id="textbox-ressource-aufwand" value="<?php echo $aufwand; ?>" maxlength="256"/>
</row>
</rows>
</grid>
<hbox>
<spacer flex="1" />
<button id="button-ressource-speichern" oncommand="updateProjektRessource()" label="Speichern" />
</hbox>
</groupbox>
</vbox>
</window>
<row>
<label value="Aufwand" control="textbox-ressource-aufwand"/>
<textbox id="textbox-ressource-aufwand" value="<?php echo $aufwand; ?>" maxlength="256"/>
</row>
</rows>
</grid>
<hbox>
<spacer flex="1" />
<button id="button-ressource-speichern" oncommand="updateProjektRessource()" label="Speichern" />
</hbox>
</groupbox>
</vbox>
</window>
+6 -6
View File
@@ -49,8 +49,8 @@ if(isset($_GET['typ']) && $_GET['typ']=='projekt')
}
elseif(isset($_GET['typ']) && $_GET['typ']=='task')
{
$ressource->getTaskRessoureDatum($datum, $endedatum, $projekt_kurzbz);
$typ = 'task';
$ressource->getTaskRessoureDatum($datum, $endedatum, $projekt_kurzbz);
$typ = 'task';
$anzahl_warnung = 6;
}
else
@@ -138,14 +138,14 @@ foreach($ressource_arr as $bezeichnung)
$title .= $phase->bezeichnung.'('.$phase->projekt_kurzbz.')';
$beistrich=true;
}
elseif($typ=='task' && $row->projekttask_id!='')
{
elseif($typ=='task' && $row->projekttask_id!='')
{
$anzahl++;
$showrow=true;
$task = new projekttask();
$task->load($row->projekttask_id);
$title.=$task->bezeichnung;
$beistrich=true;
$title.=$task->bezeichnung;
$beistrich=true;
}
if($typ!='projekt' && $row->aufwand!='' && $row->aufwand!=0)
{
+5 -4
View File
@@ -16,8 +16,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Authors: Christian Paminger <christian.paminger@technikum-wien.at>,
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at>
* Karl Burkhart <burkhart@technikum-wien.at>.
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at>,
* Karl Burkhart <burkhart@technikum-wien.at> and
* Andreas Moik <moik@technikum-wien.at>.
*/
/**
* DMS Dokumenten Management System
@@ -1174,7 +1175,7 @@ class dms extends basis_db
fue.tbl_ressource
JOIN fue.tbl_projekt_ressource USING(ressource_id)
WHERE
(tbl_ressource.student_uid=".$this->db_add_param($user)."
(tbl_ressource.uid=".$this->db_add_param($user)."
OR tbl_ressource.mitarbeiter_uid=".$this->db_add_param($user).")
AND
(projekt_kurzbz=".$this->db_add_param($row->projekt_kurzbz)."
@@ -1199,7 +1200,7 @@ class dms extends basis_db
fue.tbl_ressource
JOIN fue.tbl_projekt_ressource USING(ressource_id)
WHERE
(tbl_ressource.student_uid=".$this->db_add_param($user)."
(tbl_ressource.uid=".$this->db_add_param($user)."
OR tbl_ressource.mitarbeiter_uid=".$this->db_add_param($user).")
AND
(
File diff suppressed because it is too large Load Diff
+250 -249
View File
@@ -1,252 +1,253 @@
<?php
/* Copyright (C) 2011 Technikum-Wien
*
* 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: Karl Burkhart <burkhart@technikum-wien.at>.
*/
$projekt_kurzbz=(isset($_GET['projekt_kurzbz'])?$_GET['projekt_kurzbz']:null);
<?php
/* Copyright (C) 2011 Technikum-Wien
*
* 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: Karl Burkhart <burkhart@technikum-wien.at> and
* Andreas Moik <moik@technikum-wien.at>.
*/
$projekt_kurzbz=(isset($_GET['projekt_kurzbz'])?$_GET['projekt_kurzbz']:null);
$projekt_phase=(isset($_GET['projekt_phase'])?$_GET['projekt_phase']:null);
if($projekt_phase != null && (is_numeric($projekt_phase) == false ))
die('Ungültige ProjektphasenID');
// header for no cache
header("Cache-Control: no-cache");
header("Cache-Control: post-check=0, pre-check=0",false);
header("Expires Mon, 26 Jul 1997 05:00:00 GMT");
header("Pragma: no-cache");
// content type setzen
header("Content-type: application/xhtml+xml");
require_once('../config/vilesci.config.inc.php');
require_once('../include/functions.inc.php');
require_once('../include/ressource.class.php');
require_once('../include/basis_db.class.php');
$mitarbeiter = '';
$student='';
$betriebsmittel='';
$firma='';
$rdf_url='http://www.technikum-wien.at/ressource/';
echo '
<RDF:RDF
xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:RESSOURCE="'.$rdf_url.'rdf#"
>
';
$optional = '';
$optional_description = '';
if(isset($_GET['optional']))
{
$optional.="\n\t\t\t<RDF:li resource=\"".$rdf_url."opt"."\" />";
$optional_description = '
<RDF:Description about="'.$rdf_url.'opt" >
<RESSOURCE:ressource_id></RESSOURCE:ressource_id>
<RESSOURCE:bezeichnung></RESSOURCE:bezeichnung>
<RESSOURCE:typ><![CDATA[Auswahl]]></RESSOURCE:typ>
<RESSOURCE:beschreibung></RESSOURCE:beschreibung>
<RESSOURCE:mitarbeiter_uid></RESSOURCE:mitarbeiter_uid>
<RESSOURCE:student_uid></RESSOURCE:student_uid>
<RESSOURCE:betriebsmittel_id></RESSOURCE:betriebsmittel_id>
<RESSOURCE:firma_id></RESSOURCE:firma_id>
<RESSOURCE:insertamum></RESSOURCE:insertamum>
<RESSOURCE:insertvon></RESSOURCE:insertvon>
<RESSOURCE:updateamum></RESSOURCE:updateamum>
<RESSOURCE:updatevon></RESSOURCE:updatevon>
<RESSOURCE:rdf_description></RESSOURCE:rdf_description>
</RDF:Description>';
}
$ressource = new ressource();
if($projekt_kurzbz!=null)
$ressource->getProjectRessourcen($projekt_kurzbz);
else if($projekt_phase!= null)
if($projekt_phase != null && (is_numeric($projekt_phase) == false ))
die('Ungültige ProjektphasenID');
// header for no cache
header("Cache-Control: no-cache");
header("Cache-Control: post-check=0, pre-check=0",false);
header("Expires Mon, 26 Jul 1997 05:00:00 GMT");
header("Pragma: no-cache");
// content type setzen
header("Content-type: application/xhtml+xml");
require_once('../config/vilesci.config.inc.php');
require_once('../include/functions.inc.php');
require_once('../include/ressource.class.php');
require_once('../include/basis_db.class.php');
$mitarbeiter = '';
$student='';
$betriebsmittel='';
$firma='';
$rdf_url='http://www.technikum-wien.at/ressource/';
echo '
<RDF:RDF
xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:RESSOURCE="'.$rdf_url.'rdf#"
>
';
$optional = '';
$optional_description = '';
if(isset($_GET['optional']))
{
$optional.="\n\t\t\t<RDF:li resource=\"".$rdf_url."opt"."\" />";
$optional_description = '
<RDF:Description about="'.$rdf_url.'opt" >
<RESSOURCE:ressource_id></RESSOURCE:ressource_id>
<RESSOURCE:bezeichnung></RESSOURCE:bezeichnung>
<RESSOURCE:typ><![CDATA[Auswahl]]></RESSOURCE:typ>
<RESSOURCE:beschreibung></RESSOURCE:beschreibung>
<RESSOURCE:mitarbeiter_uid></RESSOURCE:mitarbeiter_uid>
<RESSOURCE:student_uid></RESSOURCE:student_uid>
<RESSOURCE:betriebsmittel_id></RESSOURCE:betriebsmittel_id>
<RESSOURCE:firma_id></RESSOURCE:firma_id>
<RESSOURCE:insertamum></RESSOURCE:insertamum>
<RESSOURCE:insertvon></RESSOURCE:insertvon>
<RESSOURCE:updateamum></RESSOURCE:updateamum>
<RESSOURCE:updatevon></RESSOURCE:updatevon>
<RESSOURCE:rdf_description></RESSOURCE:rdf_description>
</RDF:Description>';
}
$ressource = new ressource();
if($projekt_kurzbz!=null)
$ressource->getProjectRessourcen($projekt_kurzbz);
else if($projekt_phase!= null)
$ressource->getPhaseRessourcen($projekt_phase);
else
$ressource->getAllRessourcen();
foreach ($ressource->result as $res)
{
draw_ressource($res);
}
$seq= "
<RDF:Seq about=\"".$rdf_url."liste\" >
<RDF:li>
<RDF:Seq about=\"".$rdf_url."mitarbeiter\" >$mitarbeiter
</RDF:Seq>
<RDF:Seq about=\"".$rdf_url."studenten\" >$student
</RDF:Seq>
<RDF:Seq about=\"".$rdf_url."betriebsmittel\" >$betriebsmittel
</RDF:Seq>
<RDF:Seq about=\"".$rdf_url."firma\" >$firma
</RDF:Seq>
</RDF:li>
\n\t\t</RDF:Seq>
<RDF:Seq about=\"".$rdf_url."alle\" >
$optional
$mitarbeiter
$student
$betriebsmittel
$firma
\n\t\t</RDF:Seq>
";
$seq.="\n\t</RDF:RDF>";
draw_caption('mitarbeiter');
draw_caption('studenten');
draw_caption('betriebsmittel');
draw_caption('firma');
echo $optional_description;
echo $seq;
function draw_caption($name)
{
global $rdf_url;
echo '
<RDF:Description about="'.$rdf_url.$name.'" >
<RESSOURCE:ressource_id></RESSOURCE:ressource_id>
<RESSOURCE:bezeichnung><![CDATA['.ucfirst($name).']]></RESSOURCE:bezeichnung>
<RESSOURCE:typ><![CDATA['.ucfirst($name).']]></RESSOURCE:typ>
<RESSOURCE:beschreibung></RESSOURCE:beschreibung>
<RESSOURCE:mitarbeiter_uid></RESSOURCE:mitarbeiter_uid>
<RESSOURCE:student_uid></RESSOURCE:student_uid>
<RESSOURCE:betriebsmittel_id></RESSOURCE:betriebsmittel_id>
<RESSOURCE:firma_id></RESSOURCE:firma_id>
<RESSOURCE:insertamum></RESSOURCE:insertamum>
<RESSOURCE:insertvon></RESSOURCE:insertvon>
<RESSOURCE:updateamum></RESSOURCE:updateamum>
<RESSOURCE:updatevon></RESSOURCE:updatevon>
<RESSOURCE:rdf_description></RESSOURCE:rdf_description>
</RDF:Description>
';
}
// funktion zum ausgeben der einzelnen ressourcen -> es wird unterschienden ob mitarbeiter/student/betriebsmittel/firma
function draw_ressource($ressource)
{
global $rdf_url;
global $mitarbeiter, $student, $betriebsmittel, $firma;
$db = new basis_db();
$RdfDescription ='';
$typ = '';
// Ressource ist ein Mitarbeiter
if($ressource->mitarbeiter_uid != '')
{
$qry = "SELECT vorname, nachname from campus.vw_mitarbeiter where uid='".addslashes($ressource->mitarbeiter_uid)."'";
if($db->db_query($qry))
{
if($row = $db->db_fetch_object())
$RdfDescription = $row->vorname.' '.$row->nachname;
else
die('Fehler beim Laden der Mitarbeiter-daten');
}
else
die('Fehler beim Laden der Mitarbeiter-daten');
$mitarbeiter.="\n\t\t\t<RDF:li resource=\"".$rdf_url.$ressource->ressource_id."\" />";
$typ ='Mitarbeiter';
}
// Ressource ist ein Student
if($ressource->student_uid != '')
{
$qry = "SELECT vorname, nachname from campus.vw_student where uid='".addslashes($ressource->student_uid)."'";
if($db->db_query($qry))
{
if($row = $db->db_fetch_object())
$RdfDescription = $row->vorname.' '.$row->nachname;
else
die('Fehler beim Laden der Studenten-daten');
}
else
die('Fehler beim Laden der Studenten-daten');
$student.="\n\t\t\t<RDF:li resource=\"".$rdf_url.$ressource->ressource_id."\" />";
$typ ='Student';
}
// Ressource ist ein Betriebsmittel
if($ressource->betriebsmittel_id != '')
{
$qry = "SELECT betriebsmitteltyp, beschreibung from wawi.tbl_betriebsmittel where betriebsmittel_id='".addslashes($ressource->betriebsmittel_id)."'";
if($db->db_query($qry))
{
if($row = $db->db_fetch_object())
$RdfDescription = $row->betriebsmitteltyp.', '.$row->beschreibung;
else
die('Fehler beim Laden der Betriebsmittel-daten');
}
else
die('Fehler beim Laden der Betriebsmittel-daten');
$betriebsmittel.="\n\t\t\t<RDF:li resource=\"".$rdf_url.$ressource->ressource_id."\" />";
$typ = 'Betriebsmittel';
}
// Ressource ist eine Firma
if($ressource->firma_id != '')
{
$qry = "SELECT name from public.tbl_firma where firma_id='".addslashes($ressource->firma_id)."'";
if($db->db_query($qry))
{
if($row = $db->db_fetch_object())
$RdfDescription = $row->name;
else
die('Fehler beim Laden der Firmen-daten');
}
else
die('Fehler beim Laden der Firmen-daten');
$firma.="\n\t\t\t<RDF:li resource=\"".$rdf_url.$ressource->ressource_id."\" />";
$typ = 'Firma';
}
echo '
<RDF:Description about="'.$rdf_url.$ressource->ressource_id.'" >
<RESSOURCE:ressource_id><![CDATA['.$ressource->ressource_id.']]></RESSOURCE:ressource_id>
<RESSOURCE:bezeichnung><![CDATA['.$ressource->bezeichnung.']]></RESSOURCE:bezeichnung>
<RESSOURCE:typ><![CDATA['.$typ.']]></RESSOURCE:typ>
<RESSOURCE:beschreibung><![CDATA['.$ressource->beschreibung.']]></RESSOURCE:beschreibung>
<RESSOURCE:mitarbeiter_uid><![CDATA['.$ressource->mitarbeiter_uid.']]></RESSOURCE:mitarbeiter_uid>
<RESSOURCE:student_uid><![CDATA['.$ressource->student_uid.']]></RESSOURCE:student_uid>
<RESSOURCE:betriebsmittel_id><![CDATA['.$ressource->betriebsmittel_id.']]></RESSOURCE:betriebsmittel_id>
<RESSOURCE:firma_id><![CDATA['.$ressource->firma_id.']]></RESSOURCE:firma_id>
<RESSOURCE:insertamum><![CDATA['.$ressource->insertamum.']]></RESSOURCE:insertamum>
<RESSOURCE:insertvon><![CDATA['.$ressource->insertvon.']]></RESSOURCE:insertvon>
<RESSOURCE:updateamum><![CDATA['.$ressource->updateamum.']]></RESSOURCE:updateamum>
<RESSOURCE:updatevon><![CDATA['.$ressource->updatevon.']]></RESSOURCE:updatevon>
else
$ressource->getAllRessourcen();
foreach ($ressource->result as $res)
{
draw_ressource($res);
}
$seq= "
<RDF:Seq about=\"".$rdf_url."liste\" >
<RDF:li>
<RDF:Seq about=\"".$rdf_url."mitarbeiter\" >$mitarbeiter
</RDF:Seq>
<RDF:Seq about=\"".$rdf_url."studenten\" >$student
</RDF:Seq>
<RDF:Seq about=\"".$rdf_url."betriebsmittel\" >$betriebsmittel
</RDF:Seq>
<RDF:Seq about=\"".$rdf_url."firma\" >$firma
</RDF:Seq>
</RDF:li>
\n\t\t</RDF:Seq>
<RDF:Seq about=\"".$rdf_url."alle\" >
$optional
$mitarbeiter
$student
$betriebsmittel
$firma
\n\t\t</RDF:Seq>
";
$seq.="\n\t</RDF:RDF>";
draw_caption('mitarbeiter');
draw_caption('studenten');
draw_caption('betriebsmittel');
draw_caption('firma');
echo $optional_description;
echo $seq;
function draw_caption($name)
{
global $rdf_url;
echo '
<RDF:Description about="'.$rdf_url.$name.'" >
<RESSOURCE:ressource_id></RESSOURCE:ressource_id>
<RESSOURCE:bezeichnung><![CDATA['.ucfirst($name).']]></RESSOURCE:bezeichnung>
<RESSOURCE:typ><![CDATA['.ucfirst($name).']]></RESSOURCE:typ>
<RESSOURCE:beschreibung></RESSOURCE:beschreibung>
<RESSOURCE:mitarbeiter_uid></RESSOURCE:mitarbeiter_uid>
<RESSOURCE:student_uid></RESSOURCE:student_uid>
<RESSOURCE:betriebsmittel_id></RESSOURCE:betriebsmittel_id>
<RESSOURCE:firma_id></RESSOURCE:firma_id>
<RESSOURCE:insertamum></RESSOURCE:insertamum>
<RESSOURCE:insertvon></RESSOURCE:insertvon>
<RESSOURCE:updateamum></RESSOURCE:updateamum>
<RESSOURCE:updatevon></RESSOURCE:updatevon>
<RESSOURCE:rdf_description></RESSOURCE:rdf_description>
</RDF:Description>
';
}
// funktion zum ausgeben der einzelnen ressourcen -> es wird unterschienden ob mitarbeiter/student/betriebsmittel/firma
function draw_ressource($ressource)
{
global $rdf_url;
global $mitarbeiter, $student, $betriebsmittel, $firma;
$db = new basis_db();
$RdfDescription ='';
$typ = '';
// Ressource ist ein Mitarbeiter
if($ressource->mitarbeiter_uid != '')
{
$qry = "SELECT vorname, nachname from campus.vw_mitarbeiter where uid='".addslashes($ressource->mitarbeiter_uid)."'";
if($db->db_query($qry))
{
if($row = $db->db_fetch_object())
$RdfDescription = $row->vorname.' '.$row->nachname;
else
die('Fehler beim Laden der Mitarbeiter-daten');
}
else
die('Fehler beim Laden der Mitarbeiter-daten');
$mitarbeiter.="\n\t\t\t<RDF:li resource=\"".$rdf_url.$ressource->ressource_id."\" />";
$typ ='Mitarbeiter';
}
// Ressource ist ein Student
if($ressource->uid != '')
{
$qry = "SELECT vorname, nachname from campus.vw_student where uid='".addslashes($ressource->uid)."'";
if($db->db_query($qry))
{
if($row = $db->db_fetch_object())
$RdfDescription = $row->vorname.' '.$row->nachname;
else
die('Fehler beim Laden der Studenten-daten');
}
else
die('Fehler beim Laden der Studenten-daten');
$student.="\n\t\t\t<RDF:li resource=\"".$rdf_url.$ressource->ressource_id."\" />";
$typ ='Student';
}
// Ressource ist ein Betriebsmittel
if($ressource->betriebsmittel_id != '')
{
$qry = "SELECT betriebsmitteltyp, beschreibung from wawi.tbl_betriebsmittel where betriebsmittel_id='".addslashes($ressource->betriebsmittel_id)."'";
if($db->db_query($qry))
{
if($row = $db->db_fetch_object())
$RdfDescription = $row->betriebsmitteltyp.', '.$row->beschreibung;
else
die('Fehler beim Laden der Betriebsmittel-daten');
}
else
die('Fehler beim Laden der Betriebsmittel-daten');
$betriebsmittel.="\n\t\t\t<RDF:li resource=\"".$rdf_url.$ressource->ressource_id."\" />";
$typ = 'Betriebsmittel';
}
// Ressource ist eine Firma
if($ressource->firma_id != '')
{
$qry = "SELECT name from public.tbl_firma where firma_id='".addslashes($ressource->firma_id)."'";
if($db->db_query($qry))
{
if($row = $db->db_fetch_object())
$RdfDescription = $row->name;
else
die('Fehler beim Laden der Firmen-daten');
}
else
die('Fehler beim Laden der Firmen-daten');
$firma.="\n\t\t\t<RDF:li resource=\"".$rdf_url.$ressource->ressource_id."\" />";
$typ = 'Firma';
}
echo '
<RDF:Description about="'.$rdf_url.$ressource->ressource_id.'" >
<RESSOURCE:ressource_id><![CDATA['.$ressource->ressource_id.']]></RESSOURCE:ressource_id>
<RESSOURCE:bezeichnung><![CDATA['.$ressource->bezeichnung.']]></RESSOURCE:bezeichnung>
<RESSOURCE:typ><![CDATA['.$typ.']]></RESSOURCE:typ>
<RESSOURCE:beschreibung><![CDATA['.$ressource->beschreibung.']]></RESSOURCE:beschreibung>
<RESSOURCE:mitarbeiter_uid><![CDATA['.$ressource->mitarbeiter_uid.']]></RESSOURCE:mitarbeiter_uid>
<RESSOURCE:student_uid><![CDATA['.$ressource->uid.']]></RESSOURCE:student_uid>
<RESSOURCE:betriebsmittel_id><![CDATA['.$ressource->betriebsmittel_id.']]></RESSOURCE:betriebsmittel_id>
<RESSOURCE:firma_id><![CDATA['.$ressource->firma_id.']]></RESSOURCE:firma_id>
<RESSOURCE:insertamum><![CDATA['.$ressource->insertamum.']]></RESSOURCE:insertamum>
<RESSOURCE:insertvon><![CDATA['.$ressource->insertvon.']]></RESSOURCE:insertvon>
<RESSOURCE:updateamum><![CDATA['.$ressource->updateamum.']]></RESSOURCE:updateamum>
<RESSOURCE:updatevon><![CDATA['.$ressource->updatevon.']]></RESSOURCE:updatevon>
<RESSOURCE:aufwand><![CDATA['.$ressource->aufwand.']]></RESSOURCE:aufwand>
<RESSOURCE:funktion_kurzbz><![CDATA['.$ressource->funktion_kurzbz.']]></RESSOURCE:funktion_kurzbz>
<RESSOURCE:projekt_ressource_id><![CDATA['.$ressource->projekt_ressource_id.']]></RESSOURCE:projekt_ressource_id>
<RESSOURCE:rdf_description><![CDATA['.$RdfDescription.']]></RESSOURCE:rdf_description>
</RDF:Description>
';
}
?>
<RESSOURCE:funktion_kurzbz><![CDATA['.$ressource->funktion_kurzbz.']]></RESSOURCE:funktion_kurzbz>
<RESSOURCE:projekt_ressource_id><![CDATA['.$ressource->projekt_ressource_id.']]></RESSOURCE:projekt_ressource_id>
<RESSOURCE:rdf_description><![CDATA['.$RdfDescription.']]></RESSOURCE:rdf_description>
</RDF:Description>
';
}
?>
+87 -86
View File
@@ -1,86 +1,87 @@
<?php
/* Copyright (C) 2010 Technikum-Wien
*
* 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: Christian Paminger <christian.paminger@technikum-wien.at>,
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at> and
* Karl Burkhart <burkhart@technikum-wien.at>.
*/
header("Cache-Control: no-cache");
header("Cache-Control: post-check=0, pre-check=0",false);
header("Expires Mon, 26 Jul 1997 05:00:00 GMT");
header("Pragma: no-cache");
require_once('../config/vilesci.config.inc.php');
require_once('../include/basis_db.class.php');
require_once('../include/ressource.class.php');
require_once('../include/datum.class.php');
require_once('../include/benutzerberechtigung.class.php');
require_once('../include/functions.inc.php');
$SOAPServer = new SoapServer(APP_ROOT."/soap/ressource.wsdl.php?".microtime());
$SOAPServer->addFunction("saveRessource");
$SOAPServer->handle();
// WSDL Chache auf aus
ini_set("soap.wsdl_cache_enabled", "0");
/**
*
* Speichert die Ressource
* @param $username
* @param $passwort
* @param $ressource
*/
function saveRessource($username, $passwort, $ressource)
{
if(!$user = check_user($username, $passwort))
return new SoapFault("Server", "Invalid Credentials");
$rechte = new benutzerberechtigung();
$rechte->getBerechtigungen($user);
if(!$rechte->isBerechtigt('planner', null, 'sui'))
return new SoapFault("Server", "Sie haben keine Berechtigung zum Speichern von Ressourcen.");
$ressourceNew = new ressource();
if($ressource_id!='')
{
$ressourceNew->load($ressource->ressource_id);
$ressourceNew->new = false;
}
else
{
$ressourceNew->new = true;
$ressourceNew->insertvon = $user;
}
$ressourceNew->ressource_id=$ressource->ressource_id;
$ressourceNew->bezeichnung=$ressource->bezeichnung;
$ressourceNew->beschreibung=$ressource->beschreibung;
$ressourceNew->mitarbeiter_uid = $ressource->mitarbeiter_uid;
$ressourceNew->student_uid = $ressource->student_uid;
$ressourceNew->betriebsmittel_id = $ressource->betriebsmittel_id;
$ressourceNew->firma_id = $ressource->firma_id;
$ressourceNew->updatevon = $user;
if($ressourceNew->save())
return $ressourceNew->ressource_id;
else
return new SoapFault("Server", $ressourceNew->errormsg);
}
?>
<?php
/* Copyright (C) 2010 Technikum-Wien
*
* 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: Christian Paminger <christian.paminger@technikum-wien.at>,
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at>,
* Karl Burkhart <burkhart@technikum-wien.at> and
* Andreas Moik <moik@technikum-wien.at>.
*/
header("Cache-Control: no-cache");
header("Cache-Control: post-check=0, pre-check=0",false);
header("Expires Mon, 26 Jul 1997 05:00:00 GMT");
header("Pragma: no-cache");
require_once('../config/vilesci.config.inc.php');
require_once('../include/basis_db.class.php');
require_once('../include/ressource.class.php');
require_once('../include/datum.class.php');
require_once('../include/benutzerberechtigung.class.php');
require_once('../include/functions.inc.php');
$SOAPServer = new SoapServer(APP_ROOT."/soap/ressource.wsdl.php?".microtime());
$SOAPServer->addFunction("saveRessource");
$SOAPServer->handle();
// WSDL Chache auf aus
ini_set("soap.wsdl_cache_enabled", "0");
/**
*
* Speichert die Ressource
* @param $username
* @param $passwort
* @param $ressource
*/
function saveRessource($username, $passwort, $ressource)
{
if(!$user = check_user($username, $passwort))
return new SoapFault("Server", "Invalid Credentials");
$rechte = new benutzerberechtigung();
$rechte->getBerechtigungen($user);
if(!$rechte->isBerechtigt('planner', null, 'sui'))
return new SoapFault("Server", "Sie haben keine Berechtigung zum Speichern von Ressourcen.");
$ressourceNew = new ressource();
if($ressource_id!='')
{
$ressourceNew->load($ressource->ressource_id);
$ressourceNew->new = false;
}
else
{
$ressourceNew->new = true;
$ressourceNew->insertvon = $user;
}
$ressourceNew->ressource_id=$ressource->ressource_id;
$ressourceNew->bezeichnung=$ressource->bezeichnung;
$ressourceNew->beschreibung=$ressource->beschreibung;
$ressourceNew->mitarbeiter_uid = $ressource->mitarbeiter_uid;
$ressourceNew->uid = $ressource->student_uid;
$ressourceNew->betriebsmittel_id = $ressource->betriebsmittel_id;
$ressourceNew->firma_id = $ressource->firma_id;
$ressourceNew->updatevon = $user;
if($ressourceNew->save())
return $ressourceNew->ressource_id;
else
return new SoapFault("Server", $ressourceNew->errormsg);
}
?>
+126 -126
View File
@@ -1,127 +1,127 @@
<?php
/* Copyright (C) 2010 Technikum-Wien
*
* 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: Christian Paminger <christian.paminger@technikum-wien.at>,
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at> and
* Karl Burkhart <burkhart@technikum-wien.at>.
*/
header("Cache-Control: no-cache");
header("Cache-Control: post-check=0, pre-check=0",false);
header("Expires Mon, 26 Jul 1997 05:00:00 GMT");
header("Pragma: no-cache");
require_once('../config/vilesci.config.inc.php');
require_once('../include/basis_db.class.php');
require_once('../include/ressource.class.php');
require_once('../include/datum.class.php');
require_once('../include/functions.inc.php');
require_once('../include/benutzerberechtigung.class.php');
$SOAPServer = new SoapServer(APP_ROOT."/soap/ressource_projekt.wsdl.php?".microtime());
$SOAPServer->addFunction("saveProjektRessource");
$SOAPServer->addFunction("deleteProjektRessource");
$SOAPServer->handle();
// WSDL Chache auf aus
ini_set("soap.wsdl_cache_enabled", "0");
/**
*
* Speichert in der Zwischentabelle Ressource - Projekt
* @param $username
* @param $passwort
* @param $projektRessource
*/
function saveProjektRessource($username, $passwort, $projektRessource)
{
if(!$user = check_user($username, $passwort))
return new SoapFault("Server", "Invalid Credentials");
$rechte = new benutzerberechtigung();
$rechte->getBerechtigungen($user);
if(!$rechte->isBerechtigt('planner', null, 'sui'))
return new SoapFault("Server", "Sie haben keine Berechtigung zum Speichern von Projekten.");
$ressource = new ressource();
if($projektRessource->projekt_ressource_id!='')
{
$ressource->loadProjektRessource($projektRessource->projekt_ressource_id);
$ressource->new = false;
}
else
{
$ressource->new = true;
}
$ressource->projekt_ressource_id=$projektRessource->projekt_ressource_id;
$ressource->projektphase_id=$projektRessource->projektphase_id;
$ressource->projekt_kurzbz=$projektRessource->projekt_kurzbz;
<?php
/* Copyright (C) 2010 Technikum-Wien
*
* 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: Christian Paminger <christian.paminger@technikum-wien.at>,
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at> and
* Karl Burkhart <burkhart@technikum-wien.at>.
*/
header("Cache-Control: no-cache");
header("Cache-Control: post-check=0, pre-check=0",false);
header("Expires Mon, 26 Jul 1997 05:00:00 GMT");
header("Pragma: no-cache");
require_once('../config/vilesci.config.inc.php');
require_once('../include/basis_db.class.php');
require_once('../include/ressource.class.php');
require_once('../include/datum.class.php');
require_once('../include/functions.inc.php');
require_once('../include/benutzerberechtigung.class.php');
$SOAPServer = new SoapServer(APP_ROOT."/soap/ressource_projekt.wsdl.php?".microtime());
$SOAPServer->addFunction("saveProjektRessource");
$SOAPServer->addFunction("deleteProjektRessource");
$SOAPServer->handle();
// WSDL Chache auf aus
ini_set("soap.wsdl_cache_enabled", "0");
/**
*
* Speichert in der Zwischentabelle Ressource - Projekt
* @param $username
* @param $passwort
* @param $projektRessource
*/
function saveProjektRessource($username, $passwort, $projektRessource)
{
if(!$user = check_user($username, $passwort))
return new SoapFault("Server", "Invalid Credentials");
$rechte = new benutzerberechtigung();
$rechte->getBerechtigungen($user);
if(!$rechte->isBerechtigt('planner', null, 'sui'))
return new SoapFault("Server", "Sie haben keine Berechtigung zum Speichern von Projekten.");
$ressource = new ressource();
if($projektRessource->projekt_ressource_id!='')
{
$ressource->loadProjektRessource($projektRessource->projekt_ressource_id);
$ressource->new = false;
}
else
{
$ressource->new = true;
}
$ressource->projekt_ressource_id=$projektRessource->projekt_ressource_id;
$ressource->projektphase_id=$projektRessource->projektphase_id;
$ressource->projekt_kurzbz=$projektRessource->projekt_kurzbz;
$ressource->ressource_id = $projektRessource->ressource_id;
$ressource->funktion_kurzbz = $projektRessource->funktion_kurzbz;
$ressource->beschreibung = $projektRessource->beschreibung;
$ressource->aufwand = $projektRessource->aufwand;
if($ressource->saveProjektRessource())
return $ressource->projekt_ressource_id;
else
return new SoapFault("Server", $ressource->errormsg);
}
/**
* Löscht entweder eine Projekt zu Ressource oder Phase zu Ressource Zuordnung
* @param type $username
* @param type $passwort
* @param type $projektRessource
* @return \SoapFault
*/
function deleteProjektRessource($username, $passwort, $projektRessource)
{
if(!$user = check_user($username, $passwort))
return new SoapFault ("Server", "Invalid Credentials");
$recht = new benutzerberechtigung();
$recht->getBerechtigungen($user);
// if(!$rechte->isBerechtigt('planner', null, 'sui'))
// return new SoapFault("Server", "Sie haben keine Berechtigung zum Speichern von Projekten.");
$ressource = new ressource();
if($projektRessource->projektphase_id != '')
{
// von Projektphase löschen
if($ressource->deleteFromPhase($projektRessource->ressource_id, $projektRessource->projektphase_id))
return "Erfolg";
else
return "Fehler beim Löschen";
}
else
{
// von Projekt löschen
if($ressource->deleteFromProjekt($projektRessource->ressource_id, $projektRessource->projekt_kurzbz))
return "Erfolg";
else
return "Fehler beim Löschen";
}
}
?>
$ressource->funktion_kurzbz = $projektRessource->funktion_kurzbz;
$ressource->beschreibung = $projektRessource->beschreibung;
$ressource->aufwand = $projektRessource->aufwand;
if($ressource->saveProjektRessource())
return $ressource->projekt_ressource_id;
else
return new SoapFault("Server", $ressource->errormsg);
}
/**
* Löscht entweder eine Projekt zu Ressource oder Phase zu Ressource Zuordnung
* @param type $username
* @param type $passwort
* @param type $projektRessource
* @return \SoapFault
*/
function deleteProjektRessource($username, $passwort, $projektRessource)
{
if(!$user = check_user($username, $passwort))
return new SoapFault ("Server", "Invalid Credentials");
$recht = new benutzerberechtigung();
$recht->getBerechtigungen($user);
// if(!$rechte->isBerechtigt('planner', null, 'sui'))
// return new SoapFault("Server", "Sie haben keine Berechtigung zum Speichern von Projekten.");
$ressource = new ressource();
if($projektRessource->projektphase_id != '')
{
// von Projektphase löschen
if($ressource->deleteFromPhase($projektRessource->ressource_id, $projektRessource->projektphase_id))
return "Erfolg";
else
return "Fehler beim Löschen";
}
else
{
// von Projekt löschen
if($ressource->deleteFromProjekt($projektRessource->ressource_id, $projektRessource->projekt_kurzbz))
return "Erfolg";
else
return "Fehler beim Löschen";
}
}
?>
+15 -11
View File
@@ -34,14 +34,15 @@ echo '<html>
$all_tables_to_update =
array
(
array("schema" => "bis", "name" => "tbl_bisio", "from" => "student_uid", "to" => "prestudent_id", "datatype" => "int", "newTarget" => "tbl_prestudent", "newTargetSchema" => "public", "pickDataFrom" => "tbl_student", "pickDataFromCol" => "student_uid"),
array("schema" => "campus", "name" => "tbl_lvgesamtnote", "from" => "student_uid", "to" => "prestudent_id", "datatype" => "int", "newTarget" => "tbl_prestudent", "newTargetSchema" => "public", "pickDataFrom" => "tbl_student", "pickDataFromCol" => "student_uid"),
array("schema" => "campus", "name" => "tbl_studentbeispiel", "from" => "student_uid", "to" => "uid", "datatype" => "varchar(32)", "newTarget" => "tbl_benutzer", "newTargetSchema" => "public", "pickDataFrom" => "tbl_benutzer", "pickDataFromCol" => "uid" ),
array("schema" => "campus", "name" => "tbl_studentuebung", "from" => "student_uid", "to" => "uid", "datatype" => "varchar(32)", "newTarget" => "tbl_benutzer", "newTargetSchema" => "public", "pickDataFrom" => "tbl_benutzer", "pickDataFromCol" => "uid" ),
array("schema" => "campus", "name" => "tbl_legesamtnote", "from" => "student_uid", "to" => "prestudent_id", "datatype" => "int", "newTarget" => "tbl_prestudent", "newTargetSchema" => "public", "pickDataFrom" => "tbl_student", "pickDataFromCol" => "student_uid"),
array("schema" => "lehre", "name" => "tbl_abschlusspruefung", "from" => "student_uid", "to" => "prestudent_id", "datatype" => "int", "newTarget" => "tbl_prestudent", "newTargetSchema" => "public", "pickDataFrom" => "tbl_student", "pickDataFromCol" => "student_uid"),
array("schema" => "public", "name" => "tbl_studentlehrverband", "from" => "student_uid", "to" => "prestudent_id", "datatype" => "int", "newTarget" => "tbl_prestudent", "newTargetSchema" => "public", "pickDataFrom" => "tbl_student", "pickDataFromCol" => "student_uid"),
array("schema" => "lehre", "name" => "tbl_projektarbeit", "from" => "student_uid", "to" => "prestudent_id", "datatype" => "int", "newTarget" => "tbl_prestudent", "newTargetSchema" => "public", "pickDataFrom" => "tbl_student", "pickDataFromCol" => "student_uid"),
array("schema" => "bis", "name" => "tbl_bisio", "from" => "student_uid", "to" => "prestudent_id", "datatype" => "int", "newTarget" => "tbl_prestudent", "newTargetSchema" => "public", "pickDataFrom" => "tbl_student", "pickDataFromCol" => "student_uid", "constraint" => "SET NOT NULL"),
array("schema" => "campus", "name" => "tbl_lvgesamtnote", "from" => "student_uid", "to" => "prestudent_id", "datatype" => "int", "newTarget" => "tbl_prestudent", "newTargetSchema" => "public", "pickDataFrom" => "tbl_student", "pickDataFromCol" => "student_uid", "constraint" => "SET NOT NULL"),
array("schema" => "campus", "name" => "tbl_studentbeispiel", "from" => "student_uid", "to" => "uid", "datatype" => "varchar(32)", "newTarget" => "tbl_benutzer", "newTargetSchema" => "public", "pickDataFrom" => "tbl_benutzer", "pickDataFromCol" => "uid" , "constraint" => "SET NOT NULL"),
array("schema" => "campus", "name" => "tbl_studentuebung", "from" => "student_uid", "to" => "uid", "datatype" => "varchar(32)", "newTarget" => "tbl_benutzer", "newTargetSchema" => "public", "pickDataFrom" => "tbl_benutzer", "pickDataFromCol" => "uid" , "constraint" => "SET NOT NULL"),
array("schema" => "campus", "name" => "tbl_legesamtnote", "from" => "student_uid", "to" => "prestudent_id", "datatype" => "int", "newTarget" => "tbl_prestudent", "newTargetSchema" => "public", "pickDataFrom" => "tbl_student", "pickDataFromCol" => "student_uid", "constraint" => "SET NOT NULL"),
array("schema" => "lehre", "name" => "tbl_abschlusspruefung", "from" => "student_uid", "to" => "prestudent_id", "datatype" => "int", "newTarget" => "tbl_prestudent", "newTargetSchema" => "public", "pickDataFrom" => "tbl_student", "pickDataFromCol" => "student_uid", "constraint" => "SET NOT NULL"),
array("schema" => "public", "name" => "tbl_studentlehrverband", "from" => "student_uid", "to" => "prestudent_id", "datatype" => "int", "newTarget" => "tbl_prestudent", "newTargetSchema" => "public", "pickDataFrom" => "tbl_student", "pickDataFromCol" => "student_uid", "constraint" => "SET NOT NULL"),
array("schema" => "lehre", "name" => "tbl_projektarbeit", "from" => "student_uid", "to" => "prestudent_id", "datatype" => "int", "newTarget" => "tbl_prestudent", "newTargetSchema" => "public", "pickDataFrom" => "tbl_student", "pickDataFromCol" => "student_uid", "constraint" => "SET NOT NULL"),
array("schema" => "fue", "name" => "tbl_ressource", "from" => "student_uid", "to" => "uid", "datatype" => "varchar(32)", "newTarget" => "tbl_benutzer", "newTargetSchema" => "public", "pickDataFrom" => "tbl_benutzer", "pickDataFromCol" => "uid" , "constraint" => ""),
);
if(!isset($_POST["action"]))
@@ -486,10 +487,13 @@ function modifyOneTable($db, $table)
UPDATE '.$table["schema"].".".$table["name"].' SET '.$table["to"].' = (SELECT '.$table["to"].' FROM '.$table["newTargetSchema"].'.'.$table["pickDataFrom"].' WHERE '.$table["pickDataFromCol"].'='.$table["schema"].'.'.$table["name"].'.'.$table["from"].');';
$db->db_query($alter_update_qry);
$constraint_qry = "";
//constraints: $TO FK, $TO NOT NULL
$constraint_qry = 'ALTER TABLE '.$table["schema"].".".$table["name"].' ALTER COLUMN '.$table["to"].' SET NOT NULL;
ALTER TABLE '.$table["schema"].".".$table["name"].' ADD CONSTRAINT fk_'.$table["name"].'_'.$table["newTarget"].'_'.$table["to"].' FOREIGN KEY ('.$table["to"].') REFERENCES '.$table["newTargetSchema"].'.'.$table["newTarget"].' ('.$table["to"].');';
//constraints: $TO FK, $TO
if($table["constraint"] != "")
$constraint_qry = 'ALTER TABLE '.$table["schema"].".".$table["name"].' ALTER COLUMN '.$table["to"].' '.$table["constraint"];
$constraint_qry.=' ALTER TABLE '.$table["schema"].".".$table["name"].' ADD CONSTRAINT fk_'.$table["name"].'_'.$table["newTarget"].'_'.$table["to"].' FOREIGN KEY ('.$table["to"].') REFERENCES '.$table["newTargetSchema"].'.'.$table["newTarget"].' ('.$table["to"].');';
if(!$db->db_query($constraint_qry))
{