Merge branch 'feature-4210/BIS_UHSTAT2_Erweiterungen'

This commit is contained in:
Andreas Österreicher
2019-10-15 13:56:38 +02:00
10 changed files with 1682 additions and 475 deletions
@@ -0,0 +1,15 @@
<?php
class Bisiozweck_model extends DB_Model
{
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
$this->dbTable = 'bis.tbl_bisio_zweck';
$this->pk = array('bisio_id', 'zweck_code');
$this->hasSequence = false;
}
}
+206 -1
View File
@@ -2669,11 +2669,12 @@ if(!$error)
$bisio->nation_code = $_POST['nation_code'];
$bisio->von = $_POST['von'];
$bisio->bis = $_POST['bis'];
$bisio->zweck_code = $_POST['zweck_code'];
$bisio->student_uid = $_POST['student_uid'];
$bisio->lehreinheit_id = $_POST['lehreinheit_id'];
$bisio->ort = $_POST['ort'];
$bisio->universitaet = $_POST['universitaet'];
$bisio->ects_erworben = $_POST['ects_erworben'];
$bisio->ects_angerechnet = $_POST['ects_angerechnet'];
$bisio->updateamum = date('Y-m-d H:i:s');
$bisio->updatevon = $user;
@@ -2692,6 +2693,210 @@ if(!$error)
}
}
}
elseif(isset($_POST['type']) && $_POST['type']=='savebisiozweck')
{
$bisio = new bisio();
if($bisio->load($_POST['bisio_id']))
{
$student = new student();
if($student->load($bisio->student_uid))
{
//Speichert einen BisIO Eintrag
if(!$rechte->isBerechtigt('assistenz',$student->studiengang_kz,'suid') &&
!$rechte->isBerechtigt('admin',$student->studiengang_kz, 'suid'))
{
$error = true;
$return = false;
$errormsg = 'Sie haben keine Berechtigung';
}
else
{
$bisio = new bisio();
$bisio->bisio_id = (isset($_POST['bisio_id'])?$_POST['bisio_id']:'');
$bisio->zweck_code = $_POST['zweck_code'];
if(!$error)
{
if($bisio->saveZweck())
{
$return = true;
$data = $bisio->bisio_id;
}
else
{
$errormsg = $bisio->errormsg;
$return = false;
}
}
}
}
else
{
$errormsg = $student->errormsg;
$return = false;
}
}
else
{
$errormsg = $bisio->errormsg;
$return = false;
}
}
elseif(isset($_POST['type']) && $_POST['type']=='deletebisiozweck')
{
$bisio = new bisio();
if($bisio->load($_POST['bisio_id']))
{
$student = new student();
if($student->load($bisio->student_uid))
{
//Speichert einen BisIO Eintrag
if(!$rechte->isBerechtigt('assistenz',$student->studiengang_kz,'suid') &&
!$rechte->isBerechtigt('admin',$student->studiengang_kz, 'suid'))
{
$error = true;
$return = false;
$errormsg = 'Sie haben keine Berechtigung';
}
else
{
$bisio = new bisio();
$bisio->bisio_id = (isset($_POST['bisio_id'])?$_POST['bisio_id']:'');
$bisio->zweck_code = $_POST['zweck_code'];
if(!$error)
{
if($bisio->deleteZweck())
{
$return = true;
}
else
{
$errormsg = $bisio->errormsg;
$return = false;
}
}
}
}
else
{
$errormsg = $student->errormsg;
$return = false;
}
}
else
{
$errormsg = $bisio->errormsg;
$return = false;
}
}
elseif(isset($_POST['type']) && $_POST['type']=='savebisioaufenthaltfoerderung')
{
$bisio = new bisio();
if($bisio->load($_POST['bisio_id']))
{
$student = new student();
if($student->load($bisio->student_uid))
{
//Speichert einen BisIO Eintrag
if(!$rechte->isBerechtigt('assistenz',$student->studiengang_kz,'suid') &&
!$rechte->isBerechtigt('admin',$student->studiengang_kz, 'suid'))
{
$error = true;
$return = false;
$errormsg = 'Sie haben keine Berechtigung';
}
else
{
$bisio = new bisio();
$bisio->bisio_id = (isset($_POST['bisio_id'])?$_POST['bisio_id']:'');
$bisio->aufenthaltfoerderung_code = $_POST['aufenthaltfoerderung_code'];
if(!$error)
{
if($bisio->saveAufenthaltFoerderung())
{
$return = true;
$data = $bisio->bisio_id;
}
else
{
$errormsg = $bisio->errormsg;
$return = false;
}
}
}
}
else
{
$errormsg = $student->errormsg;
$return = false;
}
}
else
{
$errormsg = $bisio->errormsg;
$return = false;
}
}
elseif(isset($_POST['type']) && $_POST['type']=='deletebisioaufenthaltfoerderung')
{
$bisio = new bisio();
if($bisio->load($_POST['bisio_id']))
{
$student = new student();
if($student->load($bisio->student_uid))
{
//Speichert einen BisIO Eintrag
if(!$rechte->isBerechtigt('assistenz',$student->studiengang_kz,'suid') &&
!$rechte->isBerechtigt('admin',$student->studiengang_kz, 'suid'))
{
$error = true;
$return = false;
$errormsg = 'Sie haben keine Berechtigung';
}
else
{
$bisio = new bisio();
$bisio->bisio_id = (isset($_POST['bisio_id'])?$_POST['bisio_id']:'');
$bisio->aufenthaltfoerderung_code = $_POST['aufenthaltfoerderung_code'];
if(!$error)
{
if($bisio->deleteAufenthaltFoerderung())
{
$return = true;
}
else
{
$errormsg = $bisio->errormsg;
$return = false;
}
}
}
}
else
{
$errormsg = $student->errormsg;
$return = false;
}
}
else
{
$errormsg = $bisio->errormsg;
$return = false;
}
}
elseif(isset($_POST['type']) && $_POST['type']=='getnotenotenschluessel')
{
if(!$rechte->isBerechtigt('admin', null, 's') && !$rechte->isBerechtigt('assistenz', null, 's') &&
+211 -112
View File
@@ -35,85 +35,92 @@ echo '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>';
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
>
<!-- Incomming/Outgoing DETAILS -->
<vbox id="student-io" style="overflow:auto;margin:0px;" flex="1">
<hbox id="student-io" style="overflow:auto;margin:0px;">
<popupset>
<menupopup id="student-io-tree-popup">
<menuitem label="Entfernen" oncommand="StudentIODelete();" id="student-io-tree-popup-delete" hidden="false"/>
</menupopup>
</popupset>
<popupset>
<menupopup id="student-io-tree-aufenthaltfoerderung-popup">
<menuitem label="Entfernen" oncommand="StudentIOAufenthaltfoerderungDelete();" id="student-io-tree-popup-aufenthaltfoerderung-delete" hidden="false"/>
</menupopup>
</popupset>
<popupset>
<menupopup id="student-io-tree-zweck-popup">
<menuitem label="Entfernen" oncommand="StudentIOZweckDelete();" id="student-io-tree-popup-zweck-delete" hidden="false"/>
</menupopup>
</popupset>
<vbox>
<hbox>
<tree id="student-io-tree" seltype="single" hidecolumnpicker="false" flex="2"
datasources="rdf:null" ref="http://www.technikum-wien.at/bisio/liste"
style="margin-left:10px;margin-right:10px;margin-bottom:5px;margin-top: 10px;min-height:100px" height="100px" enableColumnDrag="true"
context="student-io-tree-popup"
flags="dont-build-content"
>
<treecols>
<treecol id="student-io-tree-mobilitaetsprogramm_kurzbz" label="Kurzbz" flex="2" hidden="false" primary="true"
class="sortDirectionIndicator"
sortActive="true"
sortDirection="ascending"
sort="rdf:http://www.technikum-wien.at/bisio/rdf#mobilitaetsprogramm_kurzbz"/>
<splitter class="tree-splitter"/>
<treecol id="student-io-tree-nation_code" label="Nation" flex="1" hidden="false"
class="sortDirectionIndicator"
sort="rdf:http://www.technikum-wien.at/bisio/rdf#nation_code"/>
<splitter class="tree-splitter"/>
<treecol id="student-io-tree-von" label="Von" flex="2" hidden="false"
class="sortDirectionIndicator"
sort="rdf:http://www.technikum-wien.at/bisio/rdf#von_iso" />
<splitter class="tree-splitter"/>
<treecol id="student-io-tree-bis" label="Bis" flex="2" hidden="false"
class="sortDirectionIndicator"
sort="rdf:http://www.technikum-wien.at/bisio/rdf#bis_iso" />
<splitter class="tree-splitter"/>
<treecol id="student-io-tree-bisio_id" label="bisio_id" flex="2" hidden="true"
class="sortDirectionIndicator"
sort="rdf:http://www.technikum-wien.at/bisio/rdf#bisio_id" />
<splitter class="tree-splitter"/>
</treecols>
<hbox flex="1">
<grid id="student-io-grid-detail" style="margin:4px;" flex="1">
<columns >
<template>
<treechildren flex="1" >
<treeitem uri="rdf:*">
<treerow>
<treecell label="rdf:http://www.technikum-wien.at/bisio/rdf#mobilitaetsprogramm_kurzbz"/>
<treecell label="rdf:http://www.technikum-wien.at/bisio/rdf#nation_code"/>
<treecell label="rdf:http://www.technikum-wien.at/bisio/rdf#von"/>
<treecell label="rdf:http://www.technikum-wien.at/bisio/rdf#bis"/>
<treecell label="rdf:http://www.technikum-wien.at/bisio/rdf#bisio_id"/>
</treerow>
</treeitem>
</treechildren>
</template>
</tree>
<vbox>
<button id="student-io-button-neu" label="Neu" oncommand="StudentIONeu();" disabled="true"/>
<button id="student-io-button-loeschen" label="Loeschen" oncommand="StudentIODelete();" disabled="true"/>
</vbox>
<vbox hidden="true">
<label value="Neu"/>
<checkbox id="student-io-detail-checkbox-neu" checked="true" />
<label value="Uid"/>
<textbox id="student-io-detail-textbox-uid" disabled="true"/>
<label value="BisIO ID"/>
<textbox id="student-io-detail-textbox-bisio_id" disabled="true"/>
</vbox>
<spacer flex="1" />
</hbox>
<hbox>
<grid id="student-io-grid-detail" style="margin:4px;" flex="1">
<columns >
<column flex="1"/>
<column flex="1"/>
</columns>
<rows>
<row>
<tree id="student-io-tree" seltype="single" hidecolumnpicker="false" flex="1"
datasources="rdf:null" ref="http://www.technikum-wien.at/bisio/liste"
style="margin-left:10px;margin-right:10px;margin-bottom:5px;margin-top: 10px;" height="100px" enableColumnDrag="true"
context="student-io-tree-popup"
flags="dont-build-content"
>
<!-- onselect="StudentIOAuswahl()" - wird jetzt per JS gesetzt -->
<treecols>
<treecol id="student-io-tree-mobilitaetsprogramm_kurzbz" label="Kurzbz" flex="2" hidden="false" primary="true"
class="sortDirectionIndicator"
sortActive="true"
sortDirection="ascending"
sort="rdf:http://www.technikum-wien.at/bisio/rdf#mobilitaetsprogramm_kurzbz"/>
<splitter class="tree-splitter"/>
<treecol id="student-io-tree-nation_code" label="Nation" flex="1" hidden="false"
class="sortDirectionIndicator"
sort="rdf:http://www.technikum-wien.at/bisio/rdf#nation_code"/>
<splitter class="tree-splitter"/>
<treecol id="student-io-tree-von" label="Von" flex="2" hidden="false"
class="sortDirectionIndicator"
sort="rdf:http://www.technikum-wien.at/bisio/rdf#von_iso" />
<splitter class="tree-splitter"/>
<treecol id="student-io-tree-bis" label="Bis" flex="2" hidden="false"
class="sortDirectionIndicator"
sort="rdf:http://www.technikum-wien.at/bisio/rdf#bis_iso" />
<splitter class="tree-splitter"/>
<treecol id="student-io-tree-zweck_kurzbz" label="Zweck" flex="2" hidden="false"
class="sortDirectionIndicator"
sort="rdf:http://www.technikum-wien.at/bisio/rdf#zweck_bezeichnung" />
<splitter class="tree-splitter"/>
<treecol id="student-io-tree-bisio_id" label="bisio_id" flex="2" hidden="true"
class="sortDirectionIndicator"
sort="rdf:http://www.technikum-wien.at/bisio/rdf#bisio_id" />
<splitter class="tree-splitter"/>
</treecols>
<template>
<treechildren flex="1" >
<treeitem uri="rdf:*">
<treerow>
<treecell label="rdf:http://www.technikum-wien.at/bisio/rdf#mobilitaetsprogramm_kurzbz"/>
<treecell label="rdf:http://www.technikum-wien.at/bisio/rdf#nation_code"/>
<treecell label="rdf:http://www.technikum-wien.at/bisio/rdf#von"/>
<treecell label="rdf:http://www.technikum-wien.at/bisio/rdf#bis"/>
<treecell label="rdf:http://www.technikum-wien.at/bisio/rdf#zweck_bezeichnung"/>
<treecell label="rdf:http://www.technikum-wien.at/bisio/rdf#bisio_id"/>
</treerow>
</treeitem>
</treechildren>
</template>
</tree>
<vbox>
<hbox>
<button id="student-io-button-neu" label="Neu" oncommand="StudentIONeu();" disabled="true"/>
<button id="student-io-button-loeschen" label="Loeschen" oncommand="StudentIODelete();" disabled="true"/>
</hbox>
<vbox hidden="true">
<label value="Neu"/>
<checkbox id="student-io-detail-checkbox-neu" checked="true" />
<label value="Uid"/>
<textbox id="student-io-detail-textbox-uid" disabled="true"/>
<label value="BisIO ID"/>
<textbox id="student-io-detail-textbox-bisio_id" disabled="true"/>
</vbox>
<groupbox id="student-io-groupbox" flex="1">
<caption label="BIS"/>
<grid id="student-io-grid-detail" style="overflow:auto;margin:4px;" flex="1">
@@ -126,17 +133,16 @@ echo '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>';
<label value="Von" control="student-io-textbox-von"/>
<hbox>
<box class="Datum" id="student-io-textbox-von" disabled="true"/>
<spacer flex="1" />
</hbox>
<spacer flex="1" />
</hbox>
</row>
<row>
<label value="Bis" control="student-io-textbox-bis"/>
<hbox>
<box class="Datum" id="student-io-textbox-bis" disabled="true"/>
<!--<textbox id="student-io-textbox-bis" disabled="true" maxlength="10" size="10"/>-->
<spacer flex="1" />
</hbox>
</row>
<spacer flex="1" />
</hbox>
</row>
<row>
<label value="Mobilitaetsprogramm" control="student-io-menulist-mobilitaetsprogramm"/>
<menulist id="student-io-menulist-mobilitaetsprogramm" disabled="true"
@@ -145,8 +151,8 @@ echo '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>';
<template>
<menupopup>
<menuitem value="rdf:http://www.technikum-wien.at/mobilitaetsprogramm/rdf#mobilitaetsprogramm_code"
label="rdf:http://www.technikum-wien.at/mobilitaetsprogramm/rdf#kurzbz"
uri="rdf:*"/>
label="rdf:http://www.technikum-wien.at/mobilitaetsprogramm/rdf#kurzbz"
uri="rdf:*"/>
</menupopup>
</template>
</menulist>
@@ -159,34 +165,68 @@ echo '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>';
<template>
<menupopup>
<menuitem value="rdf:http://www.technikum-wien.at/nation/rdf#nation_code"
label="rdf:http://www.technikum-wien.at/nation/rdf#kurztext"
uri="rdf:*"/>
label="rdf:http://www.technikum-wien.at/nation/rdf#kurztext"
uri="rdf:*"/>
</menupopup>
</template>
</menulist>
</row>
<row>
<label value="Zweck" control="student-io-menulist-zweck"/>
<menulist id="student-io-menulist-zweck" disabled="true"
datasources="<?php echo APP_ROOT ?>rdf/zweck.rdf.php" flex="1"
ref="http://www.technikum-wien.at/zweck/liste" >
<template>
<menupopup>
<menuitem value="rdf:http://www.technikum-wien.at/zweck/rdf#zweck_code"
label="rdf:http://www.technikum-wien.at/zweck/rdf#bezeichnung"
uri="rdf:*"/>
</menupopup>
</template>
</menulist>
</row>
<vbox>
<tree id="student-io-tree-zweck" seltype="single" hidecolumnpicker="false" flex="1"
datasources="rdf:null" ref="http://www.technikum-wien.at/zweck/liste"
style="margin-left:10px;margin-right:10px;margin-bottom:5px;margin-top: 10px;" height="100px" enableColumnDrag="true"
context="student-io-tree-zweck-popup"
flags="dont-build-content"
>
<treecols>
<treecol id="student-io-tree-zweck-bezeichnung" label="Bezeichnung" flex="2" hidden="false"
class="sortDirectionIndicator"
sortActive="true"
sortDirection="ascending"
sort="rdf:http://www.technikum-wien.at/zweck/rdf#bezeichnung"/>
<treecol id="student-io-tree-zweck-code" label="Code" flex="2" hidden="true"
class="sortDirectionIndicator"
sort="rdf:http://www.technikum-wien.at/zweck/rdf#zweck_code"/>
</treecols>
<template>
<treechildren flex="1" >
<treeitem uri="rdf:*">
<treerow>
<treecell label="rdf:http://www.technikum-wien.at/zweck/rdf#bezeichnung"/>
<treecell label="rdf:http://www.technikum-wien.at/zweck/rdf#zweck_code"/>
</treerow>
</treeitem>
</treechildren>
</template>
</tree>
<hbox>
<menulist id="student-io-menulist-zweck" disabled="true"
datasources="rdf:null" flex="1"
ref="http://www.technikum-wien.at/zweck/liste" >
<template>
<menupopup>
<menuitem value="rdf:http://www.technikum-wien.at/zweck/rdf#zweck_code"
label="rdf:http://www.technikum-wien.at/zweck/rdf#bezeichnung"
uri="rdf:*"/>
</menupopup>
</template>
</menulist>
<button id="student-io-button-zweck-hinzufuegen" label="Hinzufügen" oncommand="StudentIOZweckAdd();" disabled="true"/>
</hbox>
</vbox>
</row>
</rows>
</grid>
</groupbox>
<groupbox id="student-io-groupbox" flex="1">
<caption label="Outgoing (Zeugnis)"/>
</vbox>
<vbox>
<groupbox id="student-io-groupbox">
<caption label="Outgoing"/>
<grid id="student-io-grid-detail" style="overflow:auto;margin:4px;" flex="1">
<columns >
<columns >
<column flex="1"/>
<column flex="5"/>
</columns>
@@ -194,28 +234,28 @@ echo '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>';
<row>
<label value="Lehrveranstaltung" control="student-io-menulist-lehrveranstaltung"/>
<menulist id="student-io-menulist-lehrveranstaltung" disabled="true"
datasources="rdf:null" flex="1"
ref="http://www.technikum-wien.at/lehrveranstaltung/liste"
oncommand="StudentIOLVAChange()">
datasources="rdf:null" flex="1"
ref="http://www.technikum-wien.at/lehrveranstaltung/liste"
oncommand="StudentIOLVAChange()">
<template>
<menupopup>
<menuitem value="rdf:http://www.technikum-wien.at/lehrveranstaltung/rdf#lehrveranstaltung_id"
label="rdf:http://www.technikum-wien.at/lehrveranstaltung/rdf#bezeichnung Semester rdf:http://www.technikum-wien.at/lehrveranstaltung/rdf#semester"
uri="rdf:*"/>
</menupopup>
label="rdf:http://www.technikum-wien.at/lehrveranstaltung/rdf#bezeichnung Semester rdf:http://www.technikum-wien.at/lehrveranstaltung/rdf#semester"
uri="rdf:*"/>
</menupopup>
</template>
</menulist>
</row>
<row>
<label value="Lehreinheit" control="student-io-menulist-lehreinheit"/>
<menulist id="student-io-menulist-lehreinheit" disabled="true"
datasources="rdf:null" flex="1"
ref="http://www.technikum-wien.at/lehreinheit/liste" >
datasources="rdf:null" flex="1"
ref="http://www.technikum-wien.at/lehreinheit/liste" >
<template>
<menupopup>
<menuitem value="rdf:http://www.technikum-wien.at/lehreinheit/rdf#lehreinheit_id"
label="rdf:http://www.technikum-wien.at/lehreinheit/rdf#bezeichnung"
uri="rdf:*"/>
label="rdf:http://www.technikum-wien.at/lehreinheit/rdf#bezeichnung"
uri="rdf:*"/>
</menupopup>
</template>
</menulist>
@@ -228,19 +268,78 @@ echo '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>';
<label value="Universitaet" control="student-io-textbox-universitaet"/>
<textbox id="student-io-textbox-universitaet" disabled="true" />
</row>
<row>
<label value="Erworbene ECTS" control="student-io-textbox-ects_erworben"/>
<hbox>
<textbox id="student-io-textbox-ects_erworben" disabled="true" />
<label value="Angerechnete ECTS" control="student-io-textbox-ects_angerechnet"/>
<textbox id="student-io-textbox-ects_angerechnet" disabled="true" />
</hbox>
</row>
<row>
<label value="Aufenthalt Förderung" control="student-io-tree-aufenthaltfoerderung"/>
<vbox>
<tree id="student-io-tree-aufenthaltfoerderung" seltype="single" hidecolumnpicker="false" flex="1"
datasources="rdf:null" ref="http://www.technikum-wien.at/aufenthaltfoerderung"
style="margin-left:10px;margin-right:10px;margin-bottom:5px;margin-top: 10px;" height="100px" enableColumnDrag="true"
context="student-io-tree-aufenthaltfoerderung-popup"
flags="dont-build-content"
>
<treecols>
<treecol id="student-io-tree-aufenthaltfoerderung-bezeichnung" label="Bezeichnung" flex="2" hidden="false"
class="sortDirectionIndicator"
sortActive="true"
sortDirection="ascending"
sort="rdf:http://www.technikum-wien.at/aufenthaltfoerderung/rdf#bezeichnung"/>
<treecol id="student-io-tree-aufenthaltfoerderung-code" label="Code" flex="2" hidden="true"
class="sortDirectionIndicator"
sort="rdf:http://www.technikum-wien.at/aufenthaltfoerderung/rdf#aufenthaltfoerderung_code"/>
</treecols>
<template>
<treechildren flex="1" >
<treeitem uri="rdf:*">
<treerow>
<treecell label="rdf:http://www.technikum-wien.at/aufenthaltfoerderung/rdf#bezeichnung"/>
<treecell label="rdf:http://www.technikum-wien.at/aufenthaltfoerderung/rdf#aufenthaltfoerderung_code"/>
</treerow>
</treeitem>
</treechildren>
</template>
</tree>
<hbox>
<menulist id="student-io-menulist-aufenthaltfoerderung" disabled="true"
datasources="<?php echo APP_ROOT ?>rdf/aufenthaltfoerderung.rdf.php" flex="1"
ref="http://www.technikum-wien.at/aufenthaltfoerderung" >
<template>
<menupopup>
<menuitem value="rdf:http://www.technikum-wien.at/aufenthaltfoerderung/rdf#aufenthaltfoerderung_code"
label="rdf:http://www.technikum-wien.at/aufenthaltfoerderung/rdf#bezeichnung"
uri="rdf:*"/>
</menupopup>
</template>
</menulist>
<button id="student-io-button-aufenthaltfoerderung-hinzufuegen" label="Hinzufügen" oncommand="StudentIOAufenthaltfoerderungAdd();" disabled="true"/>
</hbox>
</vbox>
</row>
</rows>
</grid>
</groupbox>
<hbox>
<spacer flex="1" />
<button id="student-io-button-speichern" oncommand="StudentIODetailSpeichern()" label="Speichern" disabled="true"/>
</hbox>
</vbox>
</row>
</rows>
</grid>
</hbox>
<spacer flex="1" />
</vbox>
</rows>
</grid>
</overlay>
<spacer flex="5" />
</hbox>
<hbox>
<button id="student-io-button-speichern" oncommand="StudentIODetailSpeichern()" label="Speichern" disabled="true"/>
<spacer flex="1" />
</hbox>
</vbox>
<spacer flex="1" />
</hbox>
</overlay>
+415 -18
View File
@@ -39,6 +39,8 @@ var StudentKontoTreeDatasource; //Datasource des KontoTrees
var StudentTreeLoadDataOnSelect=true; //Gib an ob beim Selectieren im Tree die Daten geladen werden sollen
var StudentTreeLoadDataOnSelect2=true; //Gib an ob beim Selectieren im Tree die Daten geladen werden sollen
var StudentIOTreeDatasource; //Datasource des Incomming/Outgoing Trees
var StudentIOAufenthaltFoerderungTreeDatasource; //Datasource des Outgoing Foerderung Trees
var StudentIOZweckTreeDatasource; //Datasource des Outgoing Zweck Trees
var StudentIOSelectID=null; //BISIO Eintrag der nach dem Refresh markiert werden soll
var StudentNotenTreeDatasource; //Datasource des Noten Trees
var StudentNotenSelectLehrveranstaltungID=null; //LehreinheitID des Noten Eintrages der nach dem Refresh markiert werden soll
@@ -195,6 +197,71 @@ var StudentIOTreeListener =
}
};
// ****
// * Observer fuer BISIO Aufenthaltfoerderung Tree
// * startet Rebuild nachdem das Refresh
// * der datasource fertig ist
// ****
var StudentIOAufenthaltFoerderungTreeSinkObserver =
{
onBeginLoad : function(pSink)
{
},
onInterrupt : function(pSink) {},
onResume : function(pSink) {},
onError : function(pSink, pStatus, pError) {},
onEndLoad : function(pSink)
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
document.getElementById('student-io-tree-aufenthaltfoerderung').builder.rebuild();
}
};
// ****
// * Nach dem Rebuild wird der Eintrag wieder
// * markiert
// ****
var StudentIOAufenthaltFoerderungTreeListener =
{
willRebuild : function(builder) { },
didRebuild : function(builder)
{
}
};
// ****
// * Observer fuer BISIO Zweck Tree
// * startet Rebuild nachdem das Refresh
// * der datasource fertig ist
// ****
var StudentIOZweckTreeSinkObserver =
{
onBeginLoad : function(pSink)
{
},
onInterrupt : function(pSink) {},
onResume : function(pSink) {},
onError : function(pSink, pStatus, pError) {},
onEndLoad : function(pSink)
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
document.getElementById('student-io-tree-aufenthaltfoerderung').builder.rebuild();
}
};
// ****
// * Nach dem Rebuild wird der Eintrag wieder
// * markiert
// ****
var StudentIOZweckTreeListener =
{
willRebuild : function(builder) { },
didRebuild : function(builder)
{
}
};
// ****
// * Observer fuer Noten Tree
@@ -454,7 +521,7 @@ function StudentLVZeugnisPrint(event, sprache)
var xsl = 'LVZeugnis';
if (sprache == 'English')
xsl = 'LVZeugnisEng';
url = '<?php echo APP_ROOT; ?>content/pdfExport.php?xml=lehrveranstaltungszeugnis.rdf.php&xsl='+xsl+'&stg_kz='+stg_kz+'&uid=;'+uid+'&output='+output+'&ss='+stsem+'&lvid='+lvid+'&'+gettimestamp();
window.location.href = url;
@@ -3107,7 +3174,8 @@ function StudentIOAuswahl()
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var tree = document.getElementById('student-io-tree');
if (tree.currentIndex==-1) return;
if (tree.currentIndex == -1)
return;
StudentIODetailDisableFields(false);
@@ -3139,6 +3207,8 @@ function StudentIOAuswahl()
studiensemester_kurzbz = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#studiensemester_kurzbz" ));
ort = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#ort" ));
universitaet = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#universitaet" ));
ects_angerechnet = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#ects_angerechnet" ));
ects_erworben = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#ects_erworben" ));
try
{
@@ -3204,7 +3274,6 @@ function StudentIOAuswahl()
document.getElementById('student-io-menulist-nation').value=nation_code;
document.getElementById('student-io-textbox-von').value=von;
document.getElementById('student-io-textbox-bis').value=bis;
document.getElementById('student-io-menulist-zweck').value=zweck_code;
document.getElementById('student-io-detail-textbox-uid').value=student_uid;
document.getElementById('student-io-detail-checkbox-neu').checked=false;
document.getElementById('student-io-detail-textbox-bisio_id').value=bisio_id;
@@ -3212,6 +3281,210 @@ function StudentIOAuswahl()
document.getElementById('student-io-textbox-universitaet').value=universitaet;
document.getElementById('student-io-menulist-lehreinheit').value=lehreinheit_id;
document.getElementById('student-io-menulist-lehrveranstaltung').value=lehrveranstaltung_id;
document.getElementById('student-io-textbox-ects_erworben').value=ects_erworben;
document.getElementById('student-io-textbox-ects_angerechnet').value=ects_angerechnet;
StudentIOAufenthaltFoerderungTreeLoad(bisio_id);
StudentIOZweckTreeLoad(bisio_id);
StudentIOZweckMenulistLoad();
}
/**
* Laedt das Dropdown fuer den Zweck
* Abhaengig vom Status werden unterschiedliche Eintraege geladen
*/
function StudentIOZweckMenulistLoad()
{
var student_tree = document.getElementById('student-tree');
var status = getTreeCellText(student_tree, 'student-treecol-status', student_tree.currentIndex);
var type = 'outgoing';
if (status == 'Incoming')
type = 'incoming';
//Lehreinheiten Drop Down laden
var zweckDropDown = document.getElementById('student-io-menulist-zweck');
url = '<?php echo APP_ROOT;?>rdf/zweck.rdf.php?type=' + type + '&'+gettimestamp();
//Alte DS entfernen
var oldDatasources = zweckDropDown.database.GetDataSources();
while (oldDatasources.hasMoreElements())
{
zweckDropDown.database.RemoveDataSource(oldDatasources.getNext());
}
//Refresh damit die entfernten DS auch wirklich entfernt werden
zweckDropDown.builder.rebuild();
zweckDropDown.selectedItem = '';
zweckDropDown.value = '';
var rdfService = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService);
var datasource = rdfService.GetDataSourceBlocking(url);
zweckDropDown.database.AddDataSource(datasource);
zweckDropDown.builder.rebuild();
}
/**
* Fuegt einen Zweck zu einem Auslandssemester hinzu
* Bei Incoming darf nur ein Eintrag gesetzt werden
*/
function StudentIOZweckAdd()
{
var student_tree = document.getElementById('student-tree');
var status = getTreeCellText(student_tree, 'student-treecol-status', student_tree.currentIndex);
if (status == 'Incoming')
{
// Incoming duerfen nur einen Zweck eingetragen haben.
tree = document.getElementById('student-io-tree-zweck');
if (tree.view && tree.view.rowCount > 0)
{
alert("Bei Incoming darf nur ein Zweck angegeben werden");
return false;
}
}
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var bisio_id = document.getElementById('student-io-detail-textbox-bisio_id').value;
var zweck_code = document.getElementById('student-io-menulist-zweck').value;
var url = '<?php echo APP_ROOT ?>content/student/studentDBDML.php';
var req = new phpRequest(url,'','');
req.add('type', 'savebisiozweck');
req.add('bisio_id', bisio_id);
req.add('zweck_code', zweck_code);
var response = req.executePOST();
var val = new ParseReturnValue(response)
if (!val.dbdml_return)
{
if (val.dbdml_errormsg == '')
alert(response)
else
alert(val.dbdml_errormsg)
}
else
{
StudentIOZweckTreeLoad(bisio_id);
SetStatusBarText('Daten wurden gespeichert');
}
}
/**
* Loescht die Zuordnung eines Zwecks zu einem Auslandssemester
*/
function StudentIOZweckDelete()
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var tree = document.getElementById('student-io-tree-zweck');
if (tree.currentIndex == -1)
return;
//Ausgewaehlte Nr holen
var zweck_code = getTreeCellText(tree, 'student-io-tree-zweck-code', tree.currentIndex);
var bisio_id = document.getElementById('student-io-detail-textbox-bisio_id').value
var url = '<?php echo APP_ROOT ?>content/student/studentDBDML.php';
var req = new phpRequest(url,'','');
req.add('type', 'deletebisiozweck');
req.add('bisio_id', bisio_id);
req.add('zweck_code', zweck_code);
var response = req.executePOST();
var val = new ParseReturnValue(response)
if (!val.dbdml_return)
{
if (val.dbdml_errormsg == '')
alert(response)
else
alert(val.dbdml_errormsg)
}
else
{
StudentIOZweckTreeLoad(bisio_id);
SetStatusBarText('Eintrag wurde gelöscht');
}
}
/**
* Fuegt eine Foerderung zu einem Auslandssemester hinzu
*/
function StudentIOAufenthaltfoerderungAdd()
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var bisio_id = document.getElementById('student-io-detail-textbox-bisio_id').value;
var aufenthaltfoerderung_code = document.getElementById('student-io-menulist-aufenthaltfoerderung').value;
var url = '<?php echo APP_ROOT ?>content/student/studentDBDML.php';
var req = new phpRequest(url,'','');
req.add('type', 'savebisioaufenthaltfoerderung');
req.add('bisio_id', bisio_id);
req.add('aufenthaltfoerderung_code', aufenthaltfoerderung_code);
var response = req.executePOST();
var val = new ParseReturnValue(response)
if (!val.dbdml_return)
{
if (val.dbdml_errormsg == '')
alert(response)
else
alert(val.dbdml_errormsg)
}
else
{
StudentIOAufenthaltFoerderungTreeLoad(bisio_id);
SetStatusBarText('Daten wurden gespeichert');
}
}
/**
* Entfernt eine Foerderung von einem Auslandssemester
*/
function StudentIOAufenthaltfoerderungDelete()
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var tree = document.getElementById('student-io-tree-aufenthaltfoerderung');
if (tree.currentIndex == -1)
return;
//Ausgewaehlte Nr holen
var aufenthaltfoerderung_code = getTreeCellText(tree, 'student-io-tree-aufenthaltfoerderung-code', tree.currentIndex);
var bisio_id = document.getElementById('student-io-detail-textbox-bisio_id').value
var url = '<?php echo APP_ROOT ?>content/student/studentDBDML.php';
var req = new phpRequest(url,'','');
req.add('type', 'deletebisioaufenthaltfoerderung');
req.add('bisio_id', bisio_id);
req.add('aufenthaltfoerderung_code', aufenthaltfoerderung_code);
var response = req.executePOST();
var val = new ParseReturnValue(response)
if (!val.dbdml_return)
{
if (val.dbdml_errormsg == '')
alert(response)
else
alert(val.dbdml_errormsg)
}
else
{
StudentIOAufenthaltFoerderungTreeLoad(bisio_id);
SetStatusBarText('Eintrag wurde gelöscht');
}
}
// ****
@@ -3239,6 +3512,13 @@ function StudentIODetailDisableFields(val)
document.getElementById('student-io-menulist-lehreinheit').disabled=val;
document.getElementById('student-io-textbox-ort').disabled=val;
document.getElementById('student-io-textbox-universitaet').disabled=val;
document.getElementById('student-io-textbox-ects_angerechnet').disabled=val;
document.getElementById('student-io-textbox-ects_erworben').disabled=val;
document.getElementById('student-io-menulist-aufenthaltfoerderung').disabled=val;
document.getElementById('student-io-button-aufenthaltfoerderung-hinzufuegen').disabled=val;
document.getElementById('student-io-button-zweck-hinzufuegen').disabled=val;
document.getElementById('student-io-tree-aufenthaltfoerderung').disabled=val;
document.getElementById('student-io-tree-zweck').disabled=val;
}
// *****
@@ -3248,11 +3528,13 @@ function StudentIOResetFileds()
{
document.getElementById('student-io-textbox-von').value='';
document.getElementById('student-io-textbox-bis').value='';
document.getElementById('student-io-menulist-mobilitaetsprogramm').value='6';
document.getElementById('student-io-menulist-mobilitaetsprogramm').value='7';
document.getElementById('student-io-menulist-zweck').value='2';
document.getElementById('student-io-menulist-nation').value='A';
document.getElementById('student-io-textbox-ort').value='';
document.getElementById('student-io-textbox-universitaet').value='';
document.getElementById('student-io-textbox-ects_angerechnet').value='';
document.getElementById('student-io-textbox-ects_erworben').value='';
}
// ****
@@ -3273,6 +3555,8 @@ function StudentIODetailSpeichern()
lehreinheit_id = document.getElementById('student-io-menulist-lehreinheit').value;
ort = document.getElementById('student-io-textbox-ort').value;
universitaet = document.getElementById('student-io-textbox-universitaet').value;
ects_erworben = document.getElementById('student-io-textbox-ects_erworben').value;
ects_angerechnet = document.getElementById('student-io-textbox-ects_angerechnet').value;
studiengang_kz = document.getElementById('student-prestudent-menulist-studiengang_kz').value;
@@ -3307,6 +3591,8 @@ function StudentIODetailSpeichern()
req.add('lehreinheit_id', lehreinheit_id);
req.add('ort', ort);
req.add('universitaet', universitaet);
req.add('ects_angerechnet', ects_angerechnet);
req.add('ects_erworben', ects_erworben);
var response = req.executePOST();
@@ -3379,7 +3665,7 @@ function StudentIODelete()
}
// ****
// * Aktiviert die Felder zum Anlegen eines neuen Eintrages
// * Erstellt einen neuen IO Eintrag mit Defaultwerten und wechselt in den Editiermodus
// ****
function StudentIONeu()
{
@@ -3400,17 +3686,21 @@ function StudentIONeu()
if(tag<10)
tag='0'+tag;
//UID ins Textfeld schreiben
document.getElementById('student-io-detail-textbox-uid').value=document.getElementById('student-detail-textbox-uid').value;
document.getElementById('student-io-detail-checkbox-neu').checked=true;
document.getElementById('student-io-textbox-von').value=tag+'.'+monat+'.'+jahr;
document.getElementById('student-io-textbox-bis').value=tag+'.'+monat+'.'+jahr;
var uid = document.getElementById('student-detail-textbox-uid').value;
var defaultdatum = tag+'.'+monat+'.'+jahr;
var mobilitaetsprogramm = 7; // ERASMUS
//UID ins Textfeld schreiben
document.getElementById('student-io-detail-textbox-uid').value = uid;
document.getElementById('student-io-detail-checkbox-neu').checked = true;
document.getElementById('student-io-textbox-von').value = defaultdatum;
document.getElementById('student-io-textbox-bis').value = defaultdatum;
document.getElementById('student-io-menulist-mobilitaetsprogramm').value = mobilitaetsprogramm;
try
{
//Wenn nach dem Personen gesucht wurde, ist es moeglich, dass kein Studiengang gewaehlt ist.
//Dann wird der Studiengang/Semester des Studenten genommen
var verband_tree=document.getElementById('tree-verband');
var verband_tree = document.getElementById('tree-verband');
var stg_kz = getTreeCellText(verband_tree, 'stg_kz', verband_tree.currentIndex);
var sem = getTreeCellText(verband_tree, 'sem', verband_tree.currentIndex);
@@ -3421,13 +3711,51 @@ function StudentIONeu()
var sem = document.getElementById('student-detail-textbox-semester').value;
}
// Neuen IO Datensatz erstellen und in Editiermodus wechseln.
var url = '<?php echo APP_ROOT ?>content/student/studentDBDML.php';
var req = new phpRequest(url,'','');
req.add('type', 'savebisio');
req.add('neu', true);
req.add('von', ConvertDateToISO(defaultdatum));
req.add('bis', ConvertDateToISO(defaultdatum));
req.add('mobilitaetsprogramm_code', mobilitaetsprogramm);
req.add('nation_code', 'A');
req.add('student_uid', uid);
req.add('studiengang_kz', stg_kz);
req.add('lehreinheit_id', '');
req.add('ort', '');
req.add('universitaet', '');
req.add('ects_angerechnet', '');
req.add('ects_erworben', '');
var response = req.executePOST();
var val = new ParseReturnValue(response)
if (!val.dbdml_return)
{
if(val.dbdml_errormsg == '')
alert(response)
else
alert(val.dbdml_errormsg)
}
else
{
StudentIOSelectID = val.dbdml_data;
StudentIOTreeDatasource.Refresh(false); //non blocking
document.getElementById('student-io-detail-checkbox-neu').checked = false;
document.getElementById('student-io-detail-textbox-bisio_id').value = StudentIOSelectID;
}
//Lehrveranstaltung Drop Down laden
var LVDropDown = document.getElementById('student-io-menulist-lehrveranstaltung');
url='<?php echo APP_ROOT;?>rdf/lehrveranstaltung.rdf.php?stg_kz='+stg_kz+"&sem="+sem+"&optional=true&"+gettimestamp();
url = '<?php echo APP_ROOT;?>rdf/lehrveranstaltung.rdf.php?stg_kz='+stg_kz+"&sem="+sem+"&optional=true&"+gettimestamp();
//Alte DS entfernen
var oldDatasources = LVDropDown.database.GetDataSources();
while(oldDatasources.hasMoreElements())
while (oldDatasources.hasMoreElements())
{
LVDropDown.database.RemoveDataSource(oldDatasources.getNext());
}
@@ -3437,22 +3765,21 @@ function StudentIONeu()
var rdfService = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService);
var datasource = rdfService.GetDataSource(url);
LVDropDown.database.AddDataSource(datasource);
LVDropDown.value='';
//LVDropDown.selectedItem='';
LVDropDown.value = '';
var LEDropDown = document.getElementById('student-io-menulist-lehreinheit');
//Alte DS entfernen
var oldDatasources = LEDropDown.database.GetDataSources();
while(oldDatasources.hasMoreElements())
while (oldDatasources.hasMoreElements())
{
LEDropDown.database.RemoveDataSource(oldDatasources.getNext());
}
//Refresh damit die entfernten DS auch wirklich entfernt werden
LEDropDown.builder.rebuild();
LEDropDown.value='';
LEDropDown.selectedItem='';
LEDropDown.value = '';
LEDropDown.selectedItem = '';
}
// ****
@@ -3526,6 +3853,76 @@ function StudentIOLVAChange()
}
/**
* Laedt den Aufenthalt Foerderung Tree im In/Out Karteireiter
*/
function StudentIOAufenthaltFoerderungTreeLoad(bisio_id)
{
tree = document.getElementById('student-io-tree-aufenthaltfoerderung');
url='<?php echo APP_ROOT;?>rdf/aufenthaltfoerderung.rdf.php?bisio_id='+bisio_id+"&"+gettimestamp();
//Alte Observer entfernen
try
{
StudentIOAufenthaltFoerderungTreeDatasource.removeXMLSinkObserver(StudentIOAufenthaltFoerderungTreeSinkObserver);
tree.builder.removeListener(StudentIOAufenthaltFoerderungTreeListener);
}
catch(e)
{}
//Alte DS entfernen
var oldDatasources = tree.database.GetDataSources();
while(oldDatasources.hasMoreElements())
{
tree.database.RemoveDataSource(oldDatasources.getNext());
}
//Refresh damit die entfernten DS auch wirklich entfernt werden
tree.builder.rebuild();
var rdfService = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService);
StudentIOAufenthaltFoerderungTreeDatasource = rdfService.GetDataSource(url);
StudentIOAufenthaltFoerderungTreeDatasource.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource);
StudentIOAufenthaltFoerderungTreeDatasource.QueryInterface(Components.interfaces.nsIRDFXMLSink);
tree.database.AddDataSource(StudentIOAufenthaltFoerderungTreeDatasource);
StudentIOAufenthaltFoerderungTreeDatasource.addXMLSinkObserver(StudentIOAufenthaltFoerderungTreeSinkObserver);
tree.builder.addListener(StudentIOAufenthaltFoerderungTreeListener);
}
/**
* Laedt den Zweck Tree im In/Out Karteireiter
*/
function StudentIOZweckTreeLoad(bisio_id)
{
tree = document.getElementById('student-io-tree-zweck');
url='<?php echo APP_ROOT;?>rdf/zweck.rdf.php?bisio_id='+bisio_id+"&"+gettimestamp();
//Alte Observer entfernen
try
{
StudentIOZweckTreeDatasource.removeXMLSinkObserver(StudentIOZweckTreeSinkObserver);
tree.builder.removeListener(StudentIOZweckTreeListener);
}
catch(e)
{}
//Alte DS entfernen
var oldDatasources = tree.database.GetDataSources();
while(oldDatasources.hasMoreElements())
{
tree.database.RemoveDataSource(oldDatasources.getNext());
}
//Refresh damit die entfernten DS auch wirklich entfernt werden
tree.builder.rebuild();
var rdfService = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService);
StudentIOZweckTreeDatasource = rdfService.GetDataSource(url);
StudentIOZweckTreeDatasource.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource);
StudentIOZweckTreeDatasource.QueryInterface(Components.interfaces.nsIRDFXMLSink);
tree.database.AddDataSource(StudentIOZweckTreeDatasource);
StudentIOZweckTreeDatasource.addXMLSinkObserver(StudentIOZweckTreeSinkObserver);
tree.builder.addListener(StudentIOZweckTreeListener);
}
// **************** NOTEN ************** //
// ****
+619 -327
View File
@@ -1,327 +1,619 @@
<?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
* Rudolf Hangl <rudolf.hangl@technikum-wien.at>.
*/
/**
* Klasse bisio - Incomming/Outgoing
* @create 2007-05-14
*/
require_once(dirname(__FILE__).'/basis_db.class.php');
class bisio extends basis_db
{
public $new; // boolean
public $result = array(); // adresse Objekt
//Tabellenspalten
public $bisio_id; // serial
public $mobilitaetsprogramm_code; // integer
public $mobilitaetsprogramm_kurzbz;
public $nation_code; // varchar(3)
public $von; // date
public $bis; // date
public $zweck_code; // varchar(20)
public $zweck_bezeichnung;
public $student_uid; // varchar(16)
public $updateamum; // timestamp
public $updatevon; // varchar(16)
public $insertamum; // timestamp
public $insertvon; // varchar(16)
public $ext_id; // bigint
public $ort;
public $universitaet;
public $lehreinheit_id;
/**
* Konstruktor
* @param $bisio_id ID die geladen werden soll (Default=null)
*/
public function __construct($bisio_id=null)
{
parent::__construct();
if(!is_null($bisio_id))
$this->load($bisio_id);
}
/**
* Laedt die Funktion mit der ID $buchungsnr
* @param $buchungsnr ID der zu ladenden Email
* @return true wenn ok, false im Fehlerfall
*/
public function load($bisio_id)
{
if(!is_numeric($bisio_id))
{
$this->errormsg = 'ID muss eine gueltige Zahl sein';
return false;
}
$qry = "SELECT * FROM bis.tbl_bisio WHERE bisio_id=".$this->db_add_param($bisio_id, FHC_INTEGER).";";
if($this->db_query($qry))
{
if($row = $this->db_fetch_object())
{
$this->bisio_id = $row->bisio_id;
$this->mobilitaetsprogramm_code = $row->mobilitaetsprogramm_code;
$this->nation_code = $row->nation_code;
$this->von = $row->von;
$this->bis = $row->bis;
$this->zweck_code = $row->zweck_code;
$this->student_uid = $row->student_uid;
$this->updateamum = $row->updateamum;
$this->updatevon = $row->updatevon;
$this->insertamum = $row->insertamum;
$this->insertvon = $row->insertvon;
$this->ext_id = $row->ext_id;
$this->ort = $row->ort;
$this->universitaet = $row->universitaet;
$this->lehreinheit_id = $row->lehreinheit_id;
return true;
}
else
{
$this->errormsg = 'Datensatz wurde nicht gefunden';
return false;
}
}
else
{
$this->errormsg = 'Fehler beim Laden der Daten';
return false;
}
}
/**
* Prueft die Variablen auf Gueltigkeit
* @return true wenn ok, false im Fehlerfall
*/
protected function validate()
{
if(!is_numeric($this->mobilitaetsprogramm_code))
{
$this->errormsg = 'Mobilitaetsprogramm ist ungueltig';
return false;
}
if(mb_strlen($this->nation_code)>3)
{
$this->errormsg = 'Nation ist ungueltig';
return false;
}
if(mb_strlen($this->zweck_code)>20)
{
$this->errormsg = 'Zweck ist ungueltig';
return false;
}
if(mb_strlen($this->student_uid)>32)
{
$this->errormsg = 'Student_UID ist ungueltig';
return false;
}
if($this->von!='' && !mb_ereg("([0-9]{4})-([0-9]{2})-([0-9]{2})",$this->von))
{
$this->errormsg = 'VON-Datum hat ein ungueltiges Format';
return false;
}
if($this->bis!='' && !mb_ereg("([0-9]{4})-([0-9]{2})-([0-9]{2})",$this->bis))
{
$this->errormsg = 'BIS-Datum hat ein ungueltiges Format';
return false;
}
return true;
}
/**
* Speichert den aktuellen Datensatz in die Datenbank
* Wenn $neu auf true gesetzt ist wird ein neuer Datensatz angelegt
* andernfalls wird der Datensatz mit der ID in $kontakt_id aktualisiert
* @param $new true wenn insert false wenn update
* @return true wenn ok, false im Fehlerfall
*/
public function save($new=null)
{
//Variablen pruefen
if(!$this->validate())
return false;
if($new==null)
$new = $this->new;
if($new)
{
//Neuen Datensatz einfuegen
$qry='BEGIN;INSERT INTO bis.tbl_bisio (mobilitaetsprogramm_code, nation_code, von, bis, zweck_code, student_uid, updateamum, updatevon, insertamum, insertvon, ort, universitaet, lehreinheit_id) VALUES('.
$this->db_add_param($this->mobilitaetsprogramm_code, FHC_INTEGER).', '.
$this->db_add_param($this->nation_code).', '.
$this->db_add_param($this->von).', '.
$this->db_add_param($this->bis).', '.
$this->db_add_param($this->zweck_code).', '.
$this->db_add_param($this->student_uid).', '.
$this->db_add_param($this->updateamum).', '.
$this->db_add_param($this->updatevon).', '.
$this->db_add_param($this->insertamum).', '.
$this->db_add_param($this->insertvon).', '.
$this->db_add_param($this->ort).', '.
$this->db_add_param($this->universitaet).', '.
$this->db_add_param($this->lehreinheit_id, FHC_INTEGER).');';
}
else
{
//Updaten des bestehenden Datensatzes
$qry = 'UPDATE bis.tbl_bisio SET '.
' mobilitaetsprogramm_code='.$this->db_add_param($this->mobilitaetsprogramm_code, FHC_INTEGER).','.
' nation_code='.$this->db_add_param($this->nation_code).','.
' von='.$this->db_add_param($this->von).','.
' bis='.$this->db_add_param($this->bis).','.
' zweck_code='.$this->db_add_param($this->zweck_code).','.
' student_uid='.$this->db_add_param($this->student_uid).','.
' updateamum='.$this->db_add_param($this->updateamum).','.
' updatevon='.$this->db_add_param($this->updatevon).','.
' ort='.$this->db_add_param($this->ort).','.
' universitaet='.$this->db_add_param($this->universitaet).','.
' lehreinheit_id='.$this->db_add_param($this->lehreinheit_id, FHC_INTEGER).
" WHERE bisio_id=".$this->db_add_param($this->bisio_id, FHC_INTEGER).";";
}
if($this->db_query($qry))
{
if($new)
{
$qry = "SELECT currval('bis.tbl_bisio_bisio_id_seq') as id";
if($this->db_query($qry))
{
if($row = $this->db_fetch_object())
{
$this->bisio_id = $row->id;
$this->db_query('COMMIT;');
}
else
{
$this->errormsg = 'Fehler beim Auslesen der Sequence';
$this->db_query('ROLLBACK;');
return false;
}
}
else
{
$this->errormsg = 'Fehler beim Auslesen der Sequence';
$this->db_query('ROLLBACK;');
return false;
}
}
return true;
}
else
{
$this->errormsg = 'Fehler beim Speichern der Daten';
return true;
}
}
/**
* Loescht den Datenensatz mit der ID die uebergeben wird
* @param bisio_id ID die geloescht werden soll
* @return true wenn ok, false im Fehlerfall
*/
public function delete($bisio_id)
{
if(!is_numeric($bisio_id))
{
$this->errormsg = 'ID ist ungueltig';
return false;
}
$qry = "DELETE FROM bis.tbl_bisio WHERE bisio_id=".$this->db_add_param($bisio_id, FHC_INTEGER).";";
if($this->db_query($qry))
return true;
else
{
$this->errormsg = 'Fehler beim Loeschen des Datensatzes';
return false;
}
}
/**
* Liefert alle Incomming/Outgoing
* Eintraege eines Studenten
* @param $uid
* @return true wenn ok, false wenn fehler
*/
public function getIO($uid)
{
$qry = "SELECT tbl_bisio.*,
tbl_mobilitaetsprogramm.kurzbz as mobilitaetsprogramm_kurzbz,
tbl_zweck.bezeichnung as zweck_bezeichnung
FROM
bis.tbl_bisio,
bis.tbl_zweck,
bis.tbl_mobilitaetsprogramm
WHERE
student_uid=".$this->db_add_param($uid)." AND
tbl_zweck.zweck_code=tbl_bisio.zweck_code AND
tbl_mobilitaetsprogramm.mobilitaetsprogramm_code=tbl_bisio.mobilitaetsprogramm_code
ORDER BY bis;";
if($this->db_query($qry))
{
while($row = $this->db_fetch_object())
{
$io = new bisio();
$io->bisio_id = $row->bisio_id;
$io->mobilitaetsprogramm_code = $row->mobilitaetsprogramm_code;
$io->mobilitaetsprogramm_kurzbz = $row->mobilitaetsprogramm_kurzbz;
$io->nation_code = $row->nation_code;
$io->von = $row->von;
$io->bis = $row->bis;
$io->zweck_code = $row->zweck_code;
$io->zweck_bezeichnung = $row->zweck_bezeichnung;
$io->student_uid = $row->student_uid;
$io->updateamum = $row->updateamum;
$io->updatevon = $row->updatevon;
$io->insertamum = $row->insertamum;
$io->insertvon = $row->insertvon;
$io->ext_id = $row->ext_id;
$io->ort = $row->ort;
$io->universitaet = $row->universitaet;
$io->lehreinheit_id = $row->lehreinheit_id;
$this->result[] = $io;
}
return true;
}
else
{
$this->errormsg = 'Fehler beim Laden der Daten';
return false;
}
}
}
?>
<?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
* Rudolf Hangl <rudolf.hangl@technikum-wien.at>.
*/
/**
* Klasse bisio - Incomming/Outgoing
* @create 2007-05-14
*/
require_once(dirname(__FILE__).'/basis_db.class.php');
class bisio extends basis_db
{
public $new; // boolean
public $result = array(); // bisio Objekt
//Tabellenspalten
public $bisio_id; // serial
public $mobilitaetsprogramm_code; // integer
public $mobilitaetsprogramm_kurzbz; // varchar(16)
public $nation_code; // varchar(3)
public $von; // date
public $bis; // date
public $zweck_code; // varchar(20)
public $student_uid; // varchar(16)
public $updateamum; // timestamp
public $updatevon; // varchar(32)
public $insertamum; // timestamp
public $insertvon; // varchar(32)
public $ext_id; // bigint
public $ort; // varchar(128)
public $universitaet; // varchar(256)
public $lehreinheit_id; // integer
public $ects_erworben; // numeric(5,2)
public $ects_angerechnet; // numeric(5,2)
public $aufenthaltfoerderung_code; // integer
public $bezeichnung; // varchar(64)
/**
* Konstruktor
* @param $bisio_id ID die geladen werden soll (Default=null)
*/
public function __construct($bisio_id=null)
{
parent::__construct();
if (!is_null($bisio_id))
$this->load($bisio_id);
}
/**
* Laedt die Funktion mit der ID $buchungsnr
* @param $buchungsnr ID der zu ladenden Email
* @return true wenn ok, false im Fehlerfall
*/
public function load($bisio_id)
{
if (!is_numeric($bisio_id))
{
$this->errormsg = 'ID muss eine gueltige Zahl sein';
return false;
}
$qry = "SELECT * FROM bis.tbl_bisio WHERE bisio_id=".$this->db_add_param($bisio_id, FHC_INTEGER).";";
if ($this->db_query($qry))
{
if ($row = $this->db_fetch_object())
{
$this->bisio_id = $row->bisio_id;
$this->mobilitaetsprogramm_code = $row->mobilitaetsprogramm_code;
$this->nation_code = $row->nation_code;
$this->von = $row->von;
$this->bis = $row->bis;
$this->student_uid = $row->student_uid;
$this->updateamum = $row->updateamum;
$this->updatevon = $row->updatevon;
$this->insertamum = $row->insertamum;
$this->insertvon = $row->insertvon;
$this->ext_id = $row->ext_id;
$this->ort = $row->ort;
$this->universitaet = $row->universitaet;
$this->lehreinheit_id = $row->lehreinheit_id;
$this->ects_angerechnet = $row->ects_angerechnet;
$this->ects_erworben = $row->ects_erworben;
return true;
}
else
{
$this->errormsg = 'Datensatz wurde nicht gefunden';
return false;
}
}
else
{
$this->errormsg = 'Fehler beim Laden der Daten';
return false;
}
}
/**
* Prueft die Variablen auf Gueltigkeit
* @return true wenn ok, false im Fehlerfall
*/
protected function validate()
{
if (!is_numeric($this->mobilitaetsprogramm_code))
{
$this->errormsg = 'Mobilitaetsprogramm ist ungueltig';
return false;
}
if (mb_strlen($this->nation_code) > 3)
{
$this->errormsg = 'Nation ist ungueltig';
return false;
}
if (mb_strlen($this->zweck_code) > 20)
{
$this->errormsg = 'Zweck ist ungueltig';
return false;
}
if (mb_strlen($this->student_uid) > 32)
{
$this->errormsg = 'Student_UID ist ungueltig';
return false;
}
if ($this->von != '' && !mb_ereg("([0-9]{4})-([0-9]{2})-([0-9]{2})", $this->von))
{
$this->errormsg = 'VON-Datum hat ein ungueltiges Format';
return false;
}
if ($this->bis != '' && !mb_ereg("([0-9]{4})-([0-9]{2})-([0-9]{2})", $this->bis))
{
$this->errormsg = 'BIS-Datum hat ein ungueltiges Format';
return false;
}
if ($this->ects_erworben != '' && !is_numeric($this->ects_erworben))
{
$this->errormsg = 'Erworbene ECTS sind ungültig';
return false;
}
if ($this->ects_angerechnet != '' && !is_numeric($this->ects_angerechnet))
{
$this->errormsg = 'Angerechnete ECTS sind ungültig';
return false;
}
if ($this->ects_erworben != ''
&& $this->ects_angerechnet != ''
&& $this->ects_angerechnet > $this->ects_erworben
)
{
$this->errormsg = 'Angerechnete ECTS darf nicht groesser als erworbene ECTS sein.';
return false;
}
return true;
}
/**
* Speichert den aktuellen Datensatz in die Datenbank
* Wenn $neu auf true gesetzt ist wird ein neuer Datensatz angelegt
* andernfalls wird der Datensatz mit der ID in $kontakt_id aktualisiert
* @param $new true wenn insert false wenn update
* @return true wenn ok, false im Fehlerfall
*/
public function save($new=null)
{
//Variablen pruefen
if (!$this->validate())
return false;
if ($new == null)
$new = $this->new;
if ($new)
{
//Neuen Datensatz einfuegen
$qry='BEGIN;INSERT INTO bis.tbl_bisio (mobilitaetsprogramm_code, nation_code, von, bis,
student_uid, updateamum, updatevon, insertamum, insertvon, ort, universitaet, lehreinheit_id,
ects_angerechnet, ects_erworben) VALUES('.
$this->db_add_param($this->mobilitaetsprogramm_code, FHC_INTEGER).', '.
$this->db_add_param($this->nation_code).', '.
$this->db_add_param($this->von).', '.
$this->db_add_param($this->bis).', '.
$this->db_add_param($this->student_uid).', '.
$this->db_add_param($this->updateamum).', '.
$this->db_add_param($this->updatevon).', '.
$this->db_add_param($this->insertamum).', '.
$this->db_add_param($this->insertvon).', '.
$this->db_add_param($this->ort).', '.
$this->db_add_param($this->universitaet).', '.
$this->db_add_param($this->lehreinheit_id, FHC_INTEGER).','.
$this->db_add_param($this->ects_angerechnet).', '.
$this->db_add_param($this->ects_erworben).');';
}
else
{
//Updaten des bestehenden Datensatzes
$qry = 'UPDATE bis.tbl_bisio SET '.
' mobilitaetsprogramm_code='.$this->db_add_param($this->mobilitaetsprogramm_code, FHC_INTEGER).','.
' nation_code='.$this->db_add_param($this->nation_code).','.
' von='.$this->db_add_param($this->von).','.
' bis='.$this->db_add_param($this->bis).','.
' student_uid='.$this->db_add_param($this->student_uid).','.
' updateamum='.$this->db_add_param($this->updateamum).','.
' updatevon='.$this->db_add_param($this->updatevon).','.
' ort='.$this->db_add_param($this->ort).','.
' universitaet='.$this->db_add_param($this->universitaet).','.
' lehreinheit_id='.$this->db_add_param($this->lehreinheit_id, FHC_INTEGER).', '.
' ects_angerechnet='.$this->db_add_param($this->ects_angerechnet).', '.
' ects_erworben='.$this->db_add_param($this->ects_erworben).
" WHERE bisio_id=".$this->db_add_param($this->bisio_id, FHC_INTEGER).";";
}
if ($this->db_query($qry))
{
if ($new)
{
$qry = "SELECT currval('bis.tbl_bisio_bisio_id_seq') as id";
if ($this->db_query($qry))
{
if ($row = $this->db_fetch_object())
{
$this->bisio_id = $row->id;
$this->db_query('COMMIT;');
}
else
{
$this->errormsg = 'Fehler beim Auslesen der Sequence';
$this->db_query('ROLLBACK;');
return false;
}
}
else
{
$this->errormsg = 'Fehler beim Auslesen der Sequence';
$this->db_query('ROLLBACK;');
return false;
}
}
return true;
}
else
{
$this->errormsg = 'Fehler beim Speichern der Daten';
return true;
}
}
/**
* Loescht den Datenensatz mit der ID die uebergeben wird
* @param bisio_id ID die geloescht werden soll
* @return true wenn ok, false im Fehlerfall
*/
public function delete($bisio_id)
{
if (!is_numeric($bisio_id))
{
$this->errormsg = 'ID ist ungueltig';
return false;
}
$qry = "DELETE FROM bis.tbl_bisio WHERE bisio_id=".$this->db_add_param($bisio_id, FHC_INTEGER).";";
if ($this->db_query($qry))
return true;
else
{
$this->errormsg = 'Fehler beim Loeschen des Datensatzes';
return false;
}
}
/**
* Liefert alle Incomming/Outgoing
* Eintraege eines Studenten
* @param $uid
* @return true wenn ok, false wenn fehler
*/
public function getIO($uid)
{
$qry = "SELECT tbl_bisio.*,
tbl_mobilitaetsprogramm.kurzbz as mobilitaetsprogramm_kurzbz
FROM
bis.tbl_bisio,
bis.tbl_mobilitaetsprogramm
WHERE
student_uid=".$this->db_add_param($uid)." AND
tbl_mobilitaetsprogramm.mobilitaetsprogramm_code=tbl_bisio.mobilitaetsprogramm_code
ORDER BY bis;";
if ($this->db_query($qry))
{
while ($row = $this->db_fetch_object())
{
$io = new bisio();
$io->bisio_id = $row->bisio_id;
$io->mobilitaetsprogramm_code = $row->mobilitaetsprogramm_code;
$io->mobilitaetsprogramm_kurzbz = $row->mobilitaetsprogramm_kurzbz;
$io->nation_code = $row->nation_code;
$io->von = $row->von;
$io->bis = $row->bis;
$io->student_uid = $row->student_uid;
$io->updateamum = $row->updateamum;
$io->updatevon = $row->updatevon;
$io->insertamum = $row->insertamum;
$io->insertvon = $row->insertvon;
$io->ext_id = $row->ext_id;
$io->ort = $row->ort;
$io->universitaet = $row->universitaet;
$io->lehreinheit_id = $row->lehreinheit_id;
$io->ects_angerechnet = $row->ects_angerechnet;
$io->ects_erworben = $row->ects_erworben;
$this->result[] = $io;
}
return true;
}
else
{
$this->errormsg = 'Fehler beim Laden der Daten';
return false;
}
}
/**
* Laedt alle Foerderungen
*/
public function getFoerderungen($bisio_id = null)
{
if (is_null($bisio_id))
{
$qry = 'SELECT * FROM bis.tbl_aufenthaltfoerderung ORDER BY aufenthaltfoerderung_code;';
}
else
{
$qry = 'SELECT
*
FROM
bis.tbl_aufenthaltfoerderung
JOIN bis.tbl_bisio_aufenthaltfoerderung USING(aufenthaltfoerderung_code)
WHERE
tbl_bisio_aufenthaltfoerderung.bisio_id='.$this->db_add_param($bisio_id, FHC_INTEGER).'
ORDER BY aufenthaltfoerderung_code;';
}
if ($this->db_query($qry))
{
while($row = $this->db_fetch_object())
{
$io = new bisio();
$io->aufenthaltfoerderung_code = $row->aufenthaltfoerderung_code;
$io->bezeichnung = $row->bezeichnung;
$this->result[] = $io;
}
return true;
}
else
{
$this->errormsg = 'Fehler beim Laden der Daten';
return false;
}
}
/**
* Laedt alle Zwecke
*/
public function getZweck($bisio_id = null, $outgoing = null, $incoming = null)
{
if (is_null($bisio_id))
{
$qry = 'SELECT * FROM bis.tbl_zweck WHERE 1=1';
if ($outgoing === true)
$qry .= " AND outgoing = true";
if ($incoming === true)
$qry .= " AND incoming = true";
$qry .= ' ORDER BY zweck_code;';
}
else
{
$qry = 'SELECT
*
FROM
bis.tbl_zweck
JOIN bis.tbl_bisio_zweck USING(zweck_code)
WHERE
tbl_bisio_zweck.bisio_id='.$this->db_add_param($bisio_id, FHC_INTEGER).'
ORDER BY zweck_code;';
}
if ($this->db_query($qry))
{
while ($row = $this->db_fetch_object())
{
$io = new bisio();
$io->zweck_code = $row->zweck_code;
$io->kurzbz = $row->kurzbz;
$io->bezeichnung = $row->bezeichnung;
$this->result[] = $io;
}
return true;
}
else
{
$this->errormsg = 'Fehler beim Laden der Daten';
return false;
}
}
/**
* Prueft ob ein Zweck bereits zu einem Auslandssemester zugeordnet ist
* @param $bisio_id ID des Auslandssemester Eintrages
* @param $zweck_code Code des Zweck
* @return true wenn vorhanden, false wenn nicht.
*/
public function ZweckExists($bisio_id, $zweck_code)
{
$qry = "
SELECT
*
FROM
bis.tbl_bisio_zweck
WHERE
bisio_id = ".$this->db_add_param($bisio_id, FHC_INTEGER)."
AND zweck_code = ".$this->db_add_param($zweck_code);
if ($result = $this->db_query($qry))
{
if ($this->db_num_rows($result) > 0)
return true;
else
return false;
}
else
{
$this->errormsg = 'Fehler beim Laden der Daten';
return false;
}
}
/**
* Speichert einen Zweck zu einem Auslandssemester
* @return true wenn erfolgreich, false im Fehlerfall
*/
public function saveZweck()
{
if (!$this->ZweckExists($this->bisio_id, $this->zweck_code))
{
$qry = 'INSERT INTO bis.tbl_bisio_zweck (bisio_id, zweck_code) VALUES('.
$this->db_add_param($this->bisio_id, FHC_INTEGER).', '.
$this->db_add_param($this->zweck_code).');';
if ($this->db_query($qry))
{
return true;
}
else
{
$this->errormsg = 'Fehler beim Speichern der Daten';
return false;
}
}
else
{
$this->errormsg = 'Eintrag ist bereits zugeordnet';
return false;
}
}
/**
* Entfernt einen Zweck zu einem Auslandssemester
* @return true wenn erfolgreich, false im Fehlerfall
*/
public function deleteZweck()
{
$qry = '
DELETE FROM
bis.tbl_bisio_zweck
WHERE
bisio_id = '.$this->db_add_param($this->bisio_id, FHC_INTEGER).'
AND zweck_code = '.$this->db_add_param($this->zweck_code).';';
if ($this->db_query($qry))
{
return true;
}
else
{
$this->errormsg = 'Fehler beim Löschen der Daten';
return false;
}
}
/**
* Prueft ob eine Foerderung bereits zu einem Auslandssemester zugeordnet ist
* @param $bisio_id ID des Auslandssemester Eintrages
* @param $aufenthaltfoerderung_code Code der Foerderung
* @return true wenn vorhanden, false wenn nicht.
*/
public function AufenthaltFoerderungExists($bisio_id, $aufenthaltfoerderung_code)
{
$qry = "
SELECT
*
FROM
bis.tbl_bisio_aufenthaltfoerderung
WHERE
bisio_id = ".$this->db_add_param($bisio_id, FHC_INTEGER)."
AND aufenthaltfoerderung_code = ".$this->db_add_param($aufenthaltfoerderung_code, FHC_INTEGER);
if ($result = $this->db_query($qry))
{
if ($this->db_num_rows($result) > 0)
return true;
else
return false;
}
else
{
$this->errormsg = 'Fehler beim Laden der Daten';
return false;
}
}
/**
* Speichert einen Zweck zu einem Auslandssemester
* @return true wenn erfolgreich, false im Fehlerfall
*/
public function saveAufenthaltFoerderung()
{
if ($this->aufenthaltfoerderung_code == '' || !is_numeric($this->aufenthaltfoerderung_code))
{
$this->errormsg = 'Aufenthalt Förderung ist ungültig';
return false;
}
if ($this->bisio_id == '' || !is_numeric($this->bisio_id))
{
$this->errormsg = 'Bisio_id ist ungültig';
return false;
}
if (!$this->AufenthaltFoerderungExists($this->bisio_id, $this->aufenthaltfoerderung_code))
{
$qry = 'INSERT INTO bis.tbl_bisio_aufenthaltfoerderung (bisio_id, aufenthaltfoerderung_code) VALUES('.
$this->db_add_param($this->bisio_id, FHC_INTEGER).', '.
$this->db_add_param($this->aufenthaltfoerderung_code).');';
if ($this->db_query($qry))
{
return true;
}
else
{
$this->errormsg = 'Fehler beim Speichern der Daten';
return false;
}
}
else
{
$this->errormsg = 'Eintrag ist bereits zugeordnet';
return false;
}
}
/**
* Entfernt eine Foerderung zu einem Auslandssemester
* @return true wenn erfolgreich, false im Fehlerfall
*/
public function deleteAufenthaltFoerderung()
{
$qry = '
DELETE FROM
bis.tbl_bisio_aufenthaltfoerderung
WHERE
bisio_id = '.$this->db_add_param($this->bisio_id, FHC_INTEGER).'
AND aufenthaltfoerderung_code = '.$this->db_add_param($this->aufenthaltfoerderung_code, FHC_INTEGER).';';
if ($this->db_query($qry))
{
return true;
}
else
{
$this->errormsg = 'Fehler beim Löschen der Daten';
return false;
}
}
}
?>
+44
View File
@@ -0,0 +1,44 @@
<?php
/* Copyright (C) 2019 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 Österreicher <oesi@technikum-wien.at>
*/
require_once('../config/vilesci.config.inc.php');
require_once('../include/rdf.class.php');
require_once('../include/basis_db.class.php');
require_once('../include/bisio.class.php');
$oRdf = new rdf('AUFENTHALTFOERDERUNG','http://www.technikum-wien.at/aufenthaltfoerderung');
$oRdf->sendHeader();
$io = new bisio();
if(isset($_GET['bisio_id']))
$io->getFoerderungen($_GET['bisio_id']);
else
$io->getFoerderungen();
foreach($io->result as $row)
{
$i=$oRdf->newObjekt($row->aufenthaltfoerderung_code);
$oRdf->obj[$i]->setAttribut('aufenthaltfoerderung_code',$row->aufenthaltfoerderung_code,true);
$oRdf->obj[$i]->setAttribut('bezeichnung',$row->bezeichnung,true);
$oRdf->addSequence($row->aufenthaltfoerderung_code);
}
$oRdf->sendRdfText();
?>
+3 -3
View File
@@ -115,17 +115,17 @@ function draw_content($row)
<IO:von><![CDATA['.$datum->convertISODate($row->von).']]></IO:von>
<IO:bis_iso><![CDATA['.$row->bis.']]></IO:bis_iso>
<IO:bis><![CDATA['.$datum->convertISODate($row->bis).']]></IO:bis>
<IO:zweck_code><![CDATA['.$row->zweck_code.']]></IO:zweck_code>
<IO:zweck_bezeichnung><![CDATA['.$row->zweck_bezeichnung.']]></IO:zweck_bezeichnung>
<IO:student_uid><![CDATA['.$row->student_uid.']]></IO:student_uid>
<IO:lehreinheit_id><![CDATA['.$row->lehreinheit_id.']]></IO:lehreinheit_id>
<IO:ort><![CDATA['.$row->ort.']]></IO:ort>
<IO:universitaet><![CDATA['.$row->universitaet.']]></IO:universitaet>
<IO:lehrveranstaltung_id><![CDATA['.$lehrveranstaltung_id.']]></IO:lehrveranstaltung_id>
<IO:studiensemester_kurzbz><![CDATA['.$studiensemester_kurzbz.']]></IO:studiensemester_kurzbz>
<IO:ects_angerechnet><![CDATA['.$row->ects_angerechnet.']]></IO:ects_angerechnet>
<IO:ects_erworben><![CDATA['.$row->ects_erworben.']]></IO:ects_erworben>
</RDF:Description>
</RDF:li>';
}
?>
</RDF:Seq>
</RDF:RDF>
</RDF:RDF>
+19 -7
View File
@@ -29,6 +29,7 @@ header("Pragma: no-cache");
header("Content-type: application/xhtml+xml");
require_once('../config/vilesci.config.inc.php');
require_once('../include/basis_db.class.php');
require_once('../include/bisio.class.php');
echo '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>';
@@ -41,13 +42,25 @@ echo '
>
<RDF:Seq about="'.$rdf_url.'/liste">';
$qry = 'SELECT * FROM bis.tbl_zweck ORDER BY kurzbz';
$db = new basis_db();
if($db->db_query($qry))
$bisio = new bisio();
if(isset($_GET['bisio_id']))
{
$bisio->getZweck($_GET['bisio_id']);
}
else
{
$incoming = null;
$outgoing = null;
if (isset($_GET['type']) && $_GET['type'] == 'incoming')
$incoming = true;
if (isset($_GET['type']) && $_GET['type'] == 'outgoing')
$outgoing = true;
$bisio->getZweck(null, $outgoing, $incoming);
}
foreach($bisio->result as $row)
{
while($row = $db->db_fetch_object())
{
echo '
<RDF:li>
<RDF:Description id="'.$row->zweck_code.'" about="'.$rdf_url.'/'.$row->zweck_code.'" >
@@ -56,8 +69,7 @@ if($db->db_query($qry))
<ZWECK:bezeichnung><![CDATA['.$row->bezeichnung.']]></ZWECK:bezeichnung>
</RDF:Description>
</RDF:li>';
}
}
?>
</RDF:Seq>
</RDF:RDF>
</RDF:RDF>
+118 -3
View File
@@ -2961,7 +2961,7 @@ if ($result = $db->db_query("SELECT 0 FROM pg_class WHERE relname = 'tbl_zeitauf
if (!$db->db_query($qry))
echo '<strong>campus.tbl_zeitaufzeichnung_gd_id_seq '.$db->db_last_error().'</strong><br>';
else
echo '<br>Granted privileges to <strong>vilesci</strong> on campus.tbl_zeitaufzeichnung_gd_id_seq';
echo '<br>Granted privileges to <strong>web</strong> on campus.tbl_zeitaufzeichnung_gd_id_seq';
// GRANT SELECT, UPDATE ON SEQUENCE campus.tbl_zeitaufzeichnung_gd_id_seq TO vilesci;
$qry = 'GRANT SELECT, UPDATE ON SEQUENCE campus.tbl_zeitaufzeichnung_gd_id_seq TO vilesci;';
@@ -3138,12 +3138,126 @@ if(!@$db->db_query("SELECT insertamum FROM public.tbl_vorlagestudiengang LIMIT 1
echo '<br>Neue Spalten insertamum,insertvon,updateamum und updatevon in public.tbl_vorlagestudiengang hinzugefügt';
}
// Add column ects_erworben to bis.tbl_bisio
if(!$result = @$db->db_query("SELECT ects_erworben FROM bis.tbl_bisio LIMIT 1"))
{
$qry = "ALTER TABLE bis.tbl_bisio ADD COLUMN ects_erworben numeric(5,2);";
if(!$db->db_query($qry))
echo '<strong>bis.tbl_bisio: '.$db->db_last_error().'</strong><br>';
else
echo '<br>bis.tbl_bisio: Spalte ects_erworben hinzugefuegt';
}
// Add column ects_angerechnet to bis.tbl_bisio
if(!$result = @$db->db_query("SELECT ects_angerechnet FROM bis.tbl_bisio LIMIT 1"))
{
$qry = "ALTER TABLE bis.tbl_bisio ADD COLUMN ects_angerechnet numeric(5,2);";
if(!$db->db_query($qry))
echo '<strong>bis.tbl_bisio: '.$db->db_last_error().'</strong><br>';
else
echo '<br>bis.tbl_bisio: Spalte ects_angerechnet hinzugefuegt';
}
// Add Table bis.tbl_aufenthaltfoerderung
if(!$result = @$db->db_query("SELECT 1 FROM bis.tbl_aufenthaltfoerderung LIMIT 1"))
{
$qry = "
CREATE TABLE bis.tbl_aufenthaltfoerderung
(
aufenthaltfoerderung_code integer NOT NULL,
bezeichnung varchar(64)
);
ALTER TABLE bis.tbl_aufenthaltfoerderung ADD CONSTRAINT pk_aufenthaltfoerderung PRIMARY KEY (aufenthaltfoerderung_code);
COMMENT ON TABLE bis.tbl_aufenthaltfoerderung IS 'Key-Table of Outgoing Sponsorship';
INSERT INTO bis.tbl_aufenthaltfoerderung(aufenthaltfoerderung_code, bezeichnung) VALUES(1,'EU-Förderung');
INSERT INTO bis.tbl_aufenthaltfoerderung(aufenthaltfoerderung_code, bezeichnung) VALUES(2,'Beihilfe von Bund, Land, Gemeinde');
INSERT INTO bis.tbl_aufenthaltfoerderung(aufenthaltfoerderung_code, bezeichnung) VALUES(3,'Förderung durch Universität/Hochschule');
INSERT INTO bis.tbl_aufenthaltfoerderung(aufenthaltfoerderung_code, bezeichnung) VALUES(4,'andere Förderung');
INSERT INTO bis.tbl_aufenthaltfoerderung(aufenthaltfoerderung_code, bezeichnung) VALUES(5,'keine Förderung');
CREATE TABLE bis.tbl_bisio_aufenthaltfoerderung
(
bisio_id integer NOT NULL,
aufenthaltfoerderung_code integer NOT NULL
);
ALTER TABLE bis.tbl_bisio_aufenthaltfoerderung ADD CONSTRAINT pk_aufenthaltfoerderung_bisio PRIMARY KEY (bisio_id, aufenthaltfoerderung_code);
COMMENT ON TABLE bis.tbl_bisio_aufenthaltfoerderung IS 'Connects Outgoing Program with Sponsorship';
ALTER TABLE bis.tbl_bisio_aufenthaltfoerderung ADD CONSTRAINT fk_tbl_bisio_aufenthaltfoerderung_bisio FOREIGN KEY (bisio_id) REFERENCES bis.tbl_bisio (bisio_id) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE bis.tbl_bisio_aufenthaltfoerderung ADD CONSTRAINT fk_tbl_bisio_aufenthaltfoerderung_aufenthaltfoerderung FOREIGN KEY (aufenthaltfoerderung_code) REFERENCES bis.tbl_aufenthaltfoerderung (aufenthaltfoerderung_code) ON DELETE RESTRICT ON UPDATE CASCADE;
GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE bis.tbl_aufenthaltfoerderung TO web;
GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE bis.tbl_aufenthaltfoerderung TO vilesci;
GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE bis.tbl_bisio_aufenthaltfoerderung TO web;
GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE bis.tbl_bisio_aufenthaltfoerderung TO vilesci;
";
if(!$db->db_query($qry))
echo '<strong>bis.tbl_aufenthaltfoerderung: '.$db->db_last_error().'</strong><br>';
else
echo '<br>bis.tbl_aufenthaltfoerderung hinzugefügt, Tabelle bis.tbl_bisio_aufenthaltfoerderung hinzugefuegt';
}
// Add table bis.tbl_bisio_zweck
if(!$result = @$db->db_query("SELECT 1 FROM bis.tbl_bisio_zweck LIMIT 1"))
{
$qry = "
ALTER TABLE bis.tbl_bisio ALTER COLUMN zweck_code DROP NOT NULL;
CREATE TABLE bis.tbl_bisio_zweck
(
bisio_id integer NOT NULL,
zweck_code varchar(20) NOT NULL
);
COMMENT ON TABLE bis.tbl_bisio_zweck IS 'Connects Internships with Reasons';
ALTER TABLE bis.tbl_bisio_zweck ADD CONSTRAINT pk_tbl_bisio_zweck PRIMARY KEY (bisio_id, zweck_code);
ALTER TABLE bis.tbl_bisio_zweck ADD CONSTRAINT fk_tbl_bisio_zweck_bisio FOREIGN KEY (bisio_id) REFERENCES bis.tbl_bisio (bisio_id) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE bis.tbl_bisio_zweck ADD CONSTRAINT fk_tbl_bisio_zweck_zweck FOREIGN KEY (zweck_code) REFERENCES bis.tbl_zweck (zweck_code) ON DELETE RESTRICT ON UPDATE CASCADE;
INSERT INTO bis.tbl_bisio_zweck(bisio_id, zweck_code) SELECT bisio_id, zweck_code FROM bis.tbl_bisio WHERE zweck_code is not null;
COMMENT ON COLUMN bis.tbl_bisio.zweck_code IS 'DEPRECATED';
GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE bis.tbl_bisio_zweck TO web;
GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE bis.tbl_bisio_zweck TO vilesci;
";
if(!$db->db_query($qry))
echo '<strong>bis.tbl_bisio_zweck: '.$db->db_last_error().'</strong><br>';
else
echo '<br>bis.tbl_bisio_zweck hinzugefuegt, Spalte bis.tbl_bisio.zweck_code als DEPRECATED markiert.';
}
// Add Column incoming and outgoing to bis.tbl_zweck
// change Datatype of bis.tbl_zweck.bezeichnung from varchar(32) to varchar(64)
if(!$result = @$db->db_query("SELECT incoming FROM bis.tbl_zweck LIMIT 1"))
{
$qry = "
ALTER TABLE bis.tbl_zweck ALTER COLUMN bezeichnung TYPE varchar(64);
ALTER TABLE bis.tbl_zweck ADD COLUMN incoming boolean NOT NULL DEFAULT true;
ALTER TABLE bis.tbl_zweck ADD COLUMN outgoing boolean NOT NULL DEFAULT true;
INSERT INTO bis.tbl_zweck(zweck_code, kurzbz, bezeichnung, incoming, outgoing) VALUES(4, 'DMD','Diplom-/Masterarbeit bzw. Dissertation', false, true);
INSERT INTO bis.tbl_zweck(zweck_code, kurzbz, bezeichnung, incoming, outgoing) VALUES(5, 'SK','Besuch von Sprachkursen', false, true);
INSERT INTO bis.tbl_zweck(zweck_code, kurzbz, bezeichnung, incoming, outgoing) VALUES(6, 'LT','Lehrtätigkeit', false, true);
";
if(!$db->db_query($qry))
echo '<strong>bis.tbl_zweck: '.$db->db_last_error().'</strong><br>';
else
echo '<br>bis.tbl_zweck Spalte incoming und outgoing hinzugefügt, neue Codexeinträge ergänzt.';
}
// *** Pruefung und hinzufuegen der neuen Attribute und Tabellen
echo '<H2>Pruefe Tabellen und Attribute!</H2>';
$tabellen=array(
"bis.tbl_bisorgform" => array("bisorgform_kurzbz","code","bezeichnung"),
"bis.tbl_archiv" => array("archiv_id","studiensemester_kurzbz","meldung","html","studiengang_kz","insertamum","insertvon","typ"),
"bis.tbl_aufenthaltfoerderung" => array("aufenthaltfoerderung_code", "bezeichnung"),
"bis.tbl_bisio_aufenthaltfoerderung" => array("bisio_id","aufenthaltfoerderung_code"),
"bis.tbl_ausbildung" => array("ausbildungcode","ausbildungbez","ausbildungbeschreibung"),
"bis.tbl_berufstaetigkeit" => array("berufstaetigkeit_code","berufstaetigkeit_bez","berufstaetigkeit_kurzbz"),
"bis.tbl_beschaeftigungsart1" => array("ba1code","ba1bez","ba1kurzbz"),
@@ -3151,7 +3265,8 @@ $tabellen=array(
"bis.tbl_beschaeftigungsausmass" => array("beschausmasscode","beschausmassbez","min","max"),
"bis.tbl_besqual" => array("besqualcode","besqualbez"),
"bis.tbl_bisfunktion" => array("bisverwendung_id","studiengang_kz","sws","updateamum","updatevon","insertamum","insertvon","ext_id"),
"bis.tbl_bisio" => array("bisio_id","mobilitaetsprogramm_code","nation_code","von","bis","zweck_code","student_uid","updateamum","updatevon","insertamum","insertvon","ext_id","ort","universitaet","lehreinheit_id"),
"bis.tbl_bisio" => array("bisio_id","mobilitaetsprogramm_code","nation_code","von","bis","zweck_code","student_uid","updateamum","updatevon","insertamum","insertvon","ext_id","ort","universitaet","lehreinheit_id","ects_erworben","ects_angerechnet"),
"bis.tbl_bisio_zweck" => array("bisio_id","zweck_code"),
"bis.tbl_bisverwendung" => array("bisverwendung_id","ba1code","ba2code","vertragsstunden","beschausmasscode","verwendung_code","mitarbeiter_uid","hauptberufcode","hauptberuflich","habilitation","beginn","ende","updateamum","updatevon","insertamum","insertvon","ext_id","dv_art","inkludierte_lehre","zeitaufzeichnungspflichtig"),
"bis.tbl_bundesland" => array("bundesland_code","kurzbz","bezeichnung"),
"bis.tbl_entwicklungsteam" => array("mitarbeiter_uid","studiengang_kz","besqualcode","beginn","ende","updateamum","updatevon","insertamum","insertvon","ext_id"),
@@ -3171,7 +3286,7 @@ $tabellen=array(
"bis.tbl_zgv" => array("zgv_code","zgv_bez","zgv_kurzbz","bezeichnung"),
"bis.tbl_zgvmaster" => array("zgvmas_code","zgvmas_bez","zgvmas_kurzbz","bezeichnung"),
"bis.tbl_zgvdoktor" => array("zgvdoktor_code", "zgvdoktor_bez", "zgvdoktor_kurzbz","bezeichnung"),
"bis.tbl_zweck" => array("zweck_code","kurzbz","bezeichnung"),
"bis.tbl_zweck" => array("zweck_code","kurzbz","bezeichnung","incoming","outgoing"),
"bis.tbl_zgvgruppe" => array("gruppe_kurzbz","bezeichnung"),
"bis.tbl_zgvgruppe_zuordnung" => array("zgvgruppe_id" ,"studiengang_kz","zgv_code","zgvmas_code","gruppe_kurzbz"),
"campus.tbl_abgabe" => array("abgabe_id","abgabedatei","abgabezeit","anmerkung"),
+32 -4
View File
@@ -36,6 +36,7 @@ require_once('../../include/datum.class.php');
require_once('../../include/studiengang.class.php');
require_once('../../include/functions.inc.php');
require_once('../../include/benutzerberechtigung.class.php');
require_once('../../include/bisio.class.php');
if (!$db = new basis_db())
die('Es konnte keine Verbindung zum Server aufgebaut werden.');
@@ -243,7 +244,7 @@ $qry_in="
WHERE
bismelden=TRUE
AND tbl_student.studiengang_kz=".$db->db_add_param($stg_kz)."
AND (status_kurzbz='Incoming' AND student_uid NOT IN (SELECT student_uid FROM bis.tbl_bisio))
AND (status_kurzbz='Incoming' AND NOT EXISTS (SELECT 1 FROM bis.tbl_bisio WHERE student_uid=tbl_student.student_uid))
ORDER BY student_uid, nachname, vorname
";
if($result_in = $db->db_query($qry_in))
@@ -1116,7 +1117,6 @@ function GenerateXMLStudentBlock($row)
$gast=$rowio->nation_code;
$avon=date("dmY", $datumobj->mktime_fromdate($rowio->von));
$abis=date("dmY", $datumobj->mktime_fromdate($rowio->bis));
$zweck=$rowio->zweck_code;
$datei.="
<IO>
@@ -1128,8 +1128,36 @@ function GenerateXMLStudentBlock($row)
$datei.="
<AufenthaltBis>".$abis."</AufenthaltBis>";
}
$datei.="
<AufenthaltZweckCode>".$zweck."</AufenthaltZweckCode>
$bisio_zweck = new bisio();
$bisio_zweck->getZweck($rowio->bisio_id);
foreach ($bisio_zweck->result as $row_zweck)
{
$datei.="
<AufenthaltZweckCode>".$row_zweck->zweck_code."</AufenthaltZweckCode>";
}
if ($aktstatus != 'Incoming' && $rowio->ects_erworben != '')
{
$datei.="
<ECTSerworben>".$rowio->ects_erworben."</ECTSerworben>";
}
if ($aktstatus != 'Incoming' && $rowio->ects_angerechnet != '')
{
$datei.="
<ECTSangerechnet>".$rowio->ects_angerechnet."</ECTSangerechnet>";
}
if ($aktstatus != 'Incoming')
{
$bisio_foerderung = new bisio();
$bisio_foerderung->getFoerderungen($rowio->bisio_id);
foreach ($bisio_foerderung->result as $row_foerderung)
{
$datei.="
<AufenthaltFoerderungCode>".$row_foerderung->aufenthaltfoerderung_code."</AufenthaltFoerderungCode>";
}
}
$datei.="
</IO>";
if($aktstatus!='Incoming')
{