ProjektmanagementTool Planner

This commit is contained in:
Christian Paminger
2011-08-04 05:45:00 +00:00
parent 17c6247d28
commit e17883f1e7
13 changed files with 5133 additions and 0 deletions
+496
View File
@@ -0,0 +1,496 @@
<?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>
*/
require_once('../config/vilesci.config.inc.php');
?>
var menuUndoDatasource=0;
var STPLlastDetailUrl='leer';
//Speichert die Position der Scrollbalken in der Wochenuebersicht
TimeTableWeekPositionX=0;
TimeTableWeekPositionY=0;
// ----------------------------------------------------------
// ------- CLASS Progressmeter ------------------------------
function Progressmeter(progress_id)
{
var id=progress_id;
var runningprogress=0;
this.StopPM=StopPM;
this.StartPM=StartPM;
function StartPM()
{
// Progressmeter starten.
document.getElementById(id).setAttribute('mode','undetermined');
runningprogress++;
}
function StopPM()
{
runningprogress--;
if(runningprogress<0)
runningprogress=0;
// Progressmeter stoppen wenn alle fertig sind
if(runningprogress==0)
document.getElementById(id).setAttribute('mode','determined');
}
}
// ------ EndOf CLASS Progressmeter ------------------------------
var globalProgressmeter=new Progressmeter('statusbar-progressmeter');
//globalProgressmeter.StartPM();
function closeWindow()
{
//Warnung wenn Daten veraendert aber noch nicht gespeichert wurden
if(MitarbeiterDetailValueChanged)
{
if(!confirm('Achtung! Mitarbeiterdaten wurden veraendert aber noch nicht gespeichert. Programm wirklich beenden? \n(Die geaenderten Daten gehen dabei verloren)'))
return false;
}
MitarbeiterDetailValueChanged=false;
window.close();
}
function onLoad()
{
try
{
initLektorTree();
//Studenten Tab beim starten markieren
//document.getElementById('main-content-tabs').selectedItem=document.getElementById('tab-studenten');
//Funktion ueberschreiben damit sie nicht nochmal aufgerufen wird
//wenn zb ein IFrame geladen wird
onLoad=function() {return false};
}
catch(e)
{
debug('catched'+e);
onLoad=function() {return false};
}
}
function loadRightFrame()
{
}
function loadURL(event)
{
var contentFrame = document.getElementById('contentFrame');
var url = event.target.getAttribute('value');
if (url) contentFrame.setAttribute('src', url);
}
// ****
// * Aendert die Stundenplantabelle
// ****
function stpltableChange(db_stpl_table)
{
variableChange('db_stpl_table', null, db_stpl_table);
return true;
}
// ****
// * Wechselt von Studiensemester 'stsem' um 'wert' Studiensemester vor bzw zurueck
// ****
function studiensemesterChange(stsem, wert)
{
if(typeof(wert)=='undefined')
{
wert=0;
if(typeof(stsem)=='undefined')
{
var items = document.getElementsByTagName('menuitem');
for(i in items)
{
if(items[i].id=='menu-properies-studiensemester-name' && items[i].getAttribute("checked")=='true')
stsem = items[i].label;
}
}
}
else
stsem = getStudiensemester();
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
// Request absetzen
var url = '<?php echo APP_ROOT ?>content/fasDBDML.php';
var req = new phpRequest(url,'','');
req.add('type', 'variablechange');
req.add('stsem', stsem);
req.add('wert', wert);
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
{
//Statusbar setzen
document.getElementById("statusbarpanel-text").label = "Studiensemester erfolgreich geaendert";
document.getElementById("statusbarpanel-semester").label = val.dbdml_data;
//Menue setzen
var items = document.getElementsByTagName('menuitem');
for(i in items)
{
if(items[i].label==val.dbdml_data && items[i].id=='menu-properies-studiensemester-name')
{
items[i].setAttribute('checked',true);
break;
}
}
//MitarbeiterDetailStudiensemester_id = dbdml_errormsg;
//Ansichten Refreshen
try
{
StudentTreeRefresh();
}
catch(e)
{}
try
{
LvTreeRefresh();
}
catch(e)
{}
}
return true;
}
// ****
// * Oeffnet ein Fenster zum Aendern eines Variablenwertes
// ****
function variableChangeValue(variable)
{
var variablevalue = getvariable(variable);
if(variablevalue = prompt('Bitte geben Sie den neuen Wert fuer '+variable+' ein', variablevalue))
{
variableChange(variable, '', variablevalue);
}
}
// ****
// * Aendert den Wert der Variable IgnoreKollision
// ****
function toggleIgnoreKollision()
{
if(getvariable('ignore_kollision')=='true')
variableChange('ignore_kollision','menu-prefs-ignore_kollision', 'false');
else
variableChange('ignore_kollision','menu-prefs-ignore_kollision', 'true');
}
// ****
// * Sendet einen Request zum Aendern einer Variable
// ****
function variableChange(variable, id, wert)
{
item = document.getElementById(id);
if(typeof(wert)==='undefined')
{
if(item.getAttribute('checked')=='true')
checked='true';
else
checked='false';
}
else
checked=wert;
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
// Request absetzen
var url = '<?php echo APP_ROOT ?>content/fasDBDML.php';
var req = new phpRequest(url,'','');
req.add('type', 'variablechange');
req.add('name', variable);
req.add('wert', checked);
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
{
if(variable=='ignore_kollision')
updateignorekollision();
if(variable=='db_stpl_table')
{
document.getElementById("statusbarpanel-db_table").label = wert;
updatedbstpltable();
}
//Statusbar setzen
document.getElementById("statusbarpanel-text").label = "Variable erfolgreich geaendert";
}
}
// ****
// * Aktualisiert die IngnoreKollision Anzeige
// * sowohl in der Toolbar als auch im Menue
// ****
function updateignorekollision()
{
var panel = document.getElementById('statusbarpanel-ignore_kollision');
if(getvariable('ignore_kollision')=='true')
{
panel.label='Kollisionscheck AUS';
panel.style.backgroundColor='red';
document.getElementById('menu-prefs-ignore_kollision').setAttribute('checked','true');
}
else
{
panel.label='Kollisionscheck AN';
panel.style.backgroundColor='';
document.getElementById('menu-prefs-ignore_kollision').setAttribute('checked','false');
}
}
// ****
// * Markiert den Eintrag in der Statusleiste rot wenn auf die
// * echte stpl tabelle zugegriffen wird
// ****
function updatedbstpltable()
{
var panel = document.getElementById('statusbarpanel-db_table');
if(panel.label=='stundenplan')
{
panel.style.backgroundColor='red';
}
else
{
panel.style.backgroundColor='transparent';
}
}
// ****
// * Laedt den Wert einer Variable aus der DB
// ****
function getvariable(variable)
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
// Request absetzen
var url = '<?php echo APP_ROOT ?>content/fasDBDML.php';
var req = new phpRequest(url,'','');
req.add('type', 'getvariable');
req.add('name', variable);
var response = req.executePOST();
var val = new ParseReturnValue(response)
if (!val.dbdml_return)
{
if(val.dbdml_errormsg=='')
alert(response)
else
alert(val.dbdml_errormsg)
return false;
}
else
{
return val.dbdml_data;
}
}
// ****
// * Liefert das eingestellte Studiensemester
// ****
function getStudiensemesterVariable()
{
if(stsem = getvariable('semester_aktuell'))
{
//Statusbar setzen
document.getElementById("statusbarpanel-text").label = "Studiensemester erfolgreich geaendert";
document.getElementById("statusbarpanel-semester").label = stsem;
//Menue setzen
var items = document.getElementsByTagName('menuitem');
for(i in items)
{
if(items[i].label==stsem && items[i].id=='menu-properies-studiensemester-name')
{
items[i].setAttribute('checked',true);
break;
}
}
//Ansichten Refreshen
try
{
StudentTreeRefresh();
}
catch(e)
{}
try
{
LvTreeRefresh();
}
catch(e)
{}
}
}
// ****
// * Laedt das Undo Menue Neu
// ****
function loadUndoList()
{
menu = document.getElementById('menu-edit-undo');
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
if(menuUndoDatasource==0)
{
//Wenn noch keine Datasource angegeben ist, dann wird eine neue hinzugefuegt
var url = '<?php echo APP_ROOT; ?>rdf/undo.rdf.php?'+gettimestamp();
//Alte DS entfernen
var oldDatasources = menu.database.GetDataSources();
while(oldDatasources.hasMoreElements())
{
menu.database.RemoveDataSource(oldDatasources.getNext());
}
var rdfService = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService);
menuUndoDatasource = rdfService.GetDataSource(url);
menuUndoDatasource.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource);
menu.database.AddDataSource(menuUndoDatasource);
}
else
{
//Wenn die Datasource bereits geladen wurde dann nur neu laden
menuUndoDatasource.Refresh(true); //blocking
menu.builder.rebuild();
}
return true;
}
// ****
// * Fuehrt den Undo Befehl aus
// ****
function UnDo(log_id, bezeichnung)
{
if(confirm('Wollen Sie folgenden Befehl wirklich Rueckgaengig machen: '+bezeichnung))
{
//Request absetzen
var req = new phpRequest('tempusDBDML.php','','');
req.add('type','undo');
req.add('log_id',log_id);
var response = req.executePOST();
var val = new ParseReturnValue(response)
if (!val.dbdml_return)
{
alert(val.dbdml_errormsg)
}
else
{
LvTreeRefresh();
onJumpDate(0);
}
}
}
// ****
// * Oeffnet die ToDoListe fuers Tempus
// ****
function HelpOpenToDo()
{
window.open('ToDo_Tempus.html','ToDo');
}
// ****
// * Zeigt das Fenster zur Kollisionspruefung auf Studentenebene an
// ****
function KollisionStudentShow()
{
window.open('<?php echo APP_ROOT;?>vilesci/lehre/stpl_benutzer_kollision_frameset.html', 'Kollision Student');
}
// ****
// * Zeigt das Fenster zur LVPlanWartung
// ****
function LVPlanWartungShow()
{
window.open('<?php echo APP_ROOT;?>vilesci/lehre/lvplanwartung.php', 'LVPLanWartung');
}
// ****
// * Zeigt das Fenster zur Kollisionspruefung mit Reservierungen
// ****
function ResCheckShow()
{
window.open('<?php echo APP_ROOT;?>vilesci/lehre/check/res_check.php', 'KollisionReservierung');
}
// ****
// * Oeffnet das Handbuch
// ****
function OpenManualTempus()
{
window.open('<?php echo APP_ROOT ?>content/Tempus.pdf','Manual');
}
// ****
// * Oeffnet den About Dialog
// ****
function OpenAboutDialog()
{
window.open('<?php echo APP_ROOT ?>content/about.xul.php','About','height=520,width=500,left=350,top=350,hotkeys=0,resizable=yes,status=no,scrollbars=yes,toolbar=no,location=no,menubar=no,dependent=yes');
}
+354
View File
@@ -0,0 +1,354 @@
<?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>.
*/
include('../config/vilesci.config.inc.php');
?>
var currentAuswahl=new auswahlValues();
var LvTreeDatasource;
var StudentTreeDatasource;
function auswahlValues()
{
this.stg_kz=null;
this.sem=null;
this.ver=null;
this.grp=null;
this.gruppe=null;
this.lektor_uid=null;
}
function onProjektSelect()
{
//document.getElementById('tempus-lva-filter').value='';
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
//var contentFrame=document.getElementById('iframeTimeTableWeek');
var tree=document.getElementById('tree-projekt');
// Kommentar bitte!
if(tree.currentIndex==-1)
return;
var col=tree.columns ? tree.columns["tree-projekt-bezeichnung"] : "tree-projekt-bezeichnung";
var bezeichnung=tree.view.getCellText(tree.currentIndex,col);
col=tree.columns ? tree.columns["tree-projekt-oe"] : "tree-projekt-oe";
var oe=tree.view.getCellText(tree.currentIndex,col);
col=tree.columns ? tree.columns["tree-projekt-projekt_kurzbz"] : "tree-projekt-projekt_kurzbz";
var projekt_kurzbz=tree.view.getCellText(tree.currentIndex,col);
col=tree.columns ? tree.columns["tree-projekt-projekt_phase"] : "tree-projekt-projekt_phase";
var projekt_phase=tree.view.getCellText(tree.currentIndex,col);
col=tree.columns ? tree.columns["tree-projekt-projekt_phase_id"] : "tree-projekt-projekt_phase_id";
var projekt_phase_id=tree.view.getCellText(tree.currentIndex,col);
alert(projekt_phase_id);
col = tree.columns ? tree.columns["typ"] : "typ";
var typ=tree.view.getCellText(tree.currentIndex,col);
col = tree.columns ? tree.columns["stsem"] : "stsem";
var stsem=tree.view.getCellText(tree.currentIndex,col);
var daten=window.TimeTableWeek.document.getElementById('TimeTableWeekData');
var datum=parseInt(daten.getAttribute("datum"));
var attributes="&stg_kz="+stg_kz+"&sem="+sem+"&ver="+ver+"&grp="+grp+"&gruppe="+gruppe;
var url = "<?php echo APP_ROOT; ?>content/lvplanung/timetable-week.xul.php";
if (gruppe!=null && gruppe!=0 &gruppe!='')
var type="?type=gruppe";
else
var type="?type=verband";
url+=type+attributes+"&datum="+datum;
if (url)
{
//alert(url);
contentFrame.setAttribute('src', url);
}
currentAuswahl.stg_kz=stg_kz;
currentAuswahl.sem=sem;
currentAuswahl.ver=ver;
currentAuswahl.grp=grp;
currentAuswahl.gruppe=gruppe;
// Semesterplan
var semesterplan=document.getElementById('tabpanels-main');
var panelIndex=semesterplan.getAttribute("selectedIndex");
if (panelIndex==1)
{
//alert (url);
var contentFrame=document.getElementById('iframeTimeTableSemester');
var url = "<?php echo APP_ROOT; ?>content/lvplanung/timetable-week.xul.php";
if (gruppe!=null && gruppe!=0 &gruppe!='')
var type="?type=gruppe";
else
var type="?type=verband";
url+=type+attributes+"&semesterplan=true&"+gettimestamp();
if (url)
contentFrame.setAttribute('src', url);
}
var order = LehrstundeGetSortOrder();
// LVAs
var vboxLehrveranstalungPlanung=document.getElementById('vboxLehrveranstalungPlanung');
var attribute='../rdf/lehreinheit-lvplan.rdf.php'+type+"&stg_kz="+stg_kz+"&sem="+sem+"&ver="+ver+"&grp="+grp+"&gruppe="+gruppe+"&order="+order;
vboxLehrveranstalungPlanung.setAttribute('datasources',attribute);
// -------------- Studenten --------------------------
try
{
stsem = getStudiensemester();
url = "<?php echo APP_ROOT; ?>rdf/student.rdf.php?studiengang_kz="+stg_kz+"&semester="+sem+"&verband="+ver+"&gruppe="+grp+"&gruppe_kurzbz="+gruppe+"&studiensemester_kurzbz="+stsem+"&typ=student&"+gettimestamp();
var treeStudent=document.getElementById('student-tree');
//Alte DS entfernen
var oldDatasources = treeStudent.database.GetDataSources();
while(oldDatasources.hasMoreElements())
{
treeStudent.database.RemoveDataSource(oldDatasources.getNext());
}
try
{
StudentTreeDatasource.removeXMLSinkObserver(StudentTreeSinkObserver);
treeStudent.builder.removeListener(StudentTreeListener);
}
catch(e)
{}
var rdfService = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService);
StudentTreeDatasource = rdfService.GetDataSource(url);
StudentTreeDatasource.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource);
StudentTreeDatasource.QueryInterface(Components.interfaces.nsIRDFXMLSink);
treeStudent.database.AddDataSource(StudentTreeDatasource);
StudentTreeDatasource.addXMLSinkObserver(StudentTreeSinkObserver);
treeStudent.builder.addListener(StudentTreeListener);
//Detailfelder Deaktivieren
StudentDetailReset();
StudentDetailDisableFields(true);
StudentPrestudentDisableFields(true);
StudentKontoDisableFields(true);
StudentAkteDisableFields(true);
StudentIODisableFields(true);
StudentNoteDisableFields(true);
document.getElementById('student-kontakt').setAttribute('src','');
document.getElementById('student-betriebsmittel').setAttribute('src','');
StudentAbschlusspruefungDisableFields(true);
}
catch(e){}
// Lehrveranstaltung
try
{
url = '<?php echo APP_ROOT; ?>rdf/lehrveranstaltung_einheiten.rdf.php?stg_kz='+stg_kz+'&sem='+sem+'&ver='+ver+'&grp='+grp+'&gruppe='+gruppe+'&'+gettimestamp();
var treeLV=document.getElementById('lehrveranstaltung-tree');
//Alte DS entfernen
var oldDatasources = treeLV.database.GetDataSources();
while(oldDatasources.hasMoreElements())
{
treeLV.database.RemoveDataSource(oldDatasources.getNext());
}
var rdfService = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService);
LvTreeDatasource = rdfService.GetDataSource(url);
LvTreeDatasource.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource);
LvTreeDatasource.QueryInterface(Components.interfaces.nsIRDFXMLSink);
treeLV.database.AddDataSource(LvTreeDatasource);
LvTreeDatasource.addXMLSinkObserver(LvTreeSinkObserver);
treeLV.builder.addListener(LvTreeListener);
}
catch(e)
{
debug(e);
}
}
function onOrtSelect()
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var contentFrame=document.getElementById('iframeTimeTableWeek');
var treeOrt=document.getElementById('tree-ort');
var col=treeOrt.columns ? treeOrt.columns["ort_kurzbz"] : "ort_kurzbz";
var ort=treeOrt.view.getCellText(treeOrt.currentIndex,col);
var daten=window.TimeTableWeek.document.getElementById('TimeTableWeekData');
var datum=parseInt(daten.getAttribute("datum"));
if(ort=='')
return false;
var attributes="?type=ort&ort="+ort+"&datum="+datum;
var url = "<?php echo APP_ROOT; ?>content/lvplanung/timetable-week.xul.php";
url+=attributes+'&'+gettimestamp();
if (url)
contentFrame.setAttribute('src', url);
// Semesterplan
var semesterplan=document.getElementById('tabpanels-main');
var panelIndex=semesterplan.getAttribute("selectedIndex");
if (panelIndex==1)
{
//alert (url);
var contentFrame=document.getElementById('iframeTimeTableSemester');
var url = "<?php echo APP_ROOT; ?>content/lvplanung/timetable-week.xul.php";
url+=attributes+"&semesterplan=true&"+gettimestamp();
if (url)
contentFrame.setAttribute('src', url);
}
}
function onLektorSelect(event)
{
document.getElementById('tempus-lva-filter').value='';
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var contentFrame=document.getElementById('iframeTimeTableWeek');
var treeLektor=document.getElementById('tree-lektor');
var col=treeLektor.columns ? treeLektor.columns["uid"] : "uid";
//debug(col+'-'+treeLektor.currentIndex);
try
{
var uid=treeLektor.view.getCellText(treeLektor.currentIndex,col);
}
catch(e)
{
}
if(uid=='')
return;
//var treeVerband=document.getElementById('tree-verband');
//var stg_kz=treeVerband.view.getCellText(treeVerband.currentIndex,"stg_kz");
var daten=window.TimeTableWeek.document.getElementById('TimeTableWeekData');
var datum=parseInt(daten.getAttribute("datum"));
var attributes="?type=lektor&pers_uid="+uid+"&datum="+datum;
var url = "<?php echo APP_ROOT; ?>content/lvplanung/timetable-week.xul.php";
url+=attributes+'&'+gettimestamp();
if (url)
contentFrame.setAttribute('src', url);
// Semesterplan
var semesterplan=document.getElementById('tabpanels-main');
var panelIndex=semesterplan.getAttribute("selectedIndex");
if (panelIndex==1)
{
//alert (url);
var contentFrame=document.getElementById('iframeTimeTableSemester');
var url = "<?php echo APP_ROOT; ?>content/lvplanung/timetable-week.xul.php";
url+=attributes+"&semesterplan=true&"+gettimestamp();
if (url)
contentFrame.setAttribute('src', url);
}
var order = LehrstundeGetSortOrder();
// LVAs
var vboxLehrveranstalungPlanung=document.getElementById('vboxLehrveranstalungPlanung');
vboxLehrveranstalungPlanung.setAttribute('datasources','../rdf/lehreinheit-lvplan.rdf.php?'+"type=lektor&lektor="+uid+"&order="+order+"&"+gettimestamp());
var tree=document.getElementById('tree-lektor');
//Wenn nichts markiert wurde -> beenden
if(tree.currentIndex==-1)
return;
var row = { };
var col = { };
var child = { };
tree.treeBoxObject.getCellAt(event.pageX, event.pageY, row, col, child)
//Wenn es keine Row ist sondern ein Header oder Scrollbar dann abbrechen
if (!col.value)
return false;
//Wenn eine andere row markiert ist als angeklickt wurde -> beenden.
//Dies kommt vor wenn ein Subtree geoeffnet wird
if(row.value!=tree.currentIndex)
return;
col = tree.columns ? tree.columns["uid"] : "uid";
var uid=tree.view.getCellText(tree.currentIndex,col);
var stg_idx = tree.view.getParentIndex(tree.currentIndex);
var col = tree.columns ? tree.columns["studiengang_kz"] : "studiengang_kz";
var stg_kz=tree.view.getCellText(stg_idx,col);
document.getElementById('LehrveranstaltungEditor').setAttribute('stg_kz',stg_kz);
document.getElementById('LehrveranstaltungEditor').setAttribute('uid',uid);
// Lehrveranstaltung des Lektors laden
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
try
{
//alert(stg_kz);
url = '<?php echo APP_ROOT; ?>rdf/lehrveranstaltung_einheiten.rdf.php?stg_kz='+stg_kz+'&uid='+uid+'&'+gettimestamp();
var treeLV=document.getElementById('lehrveranstaltung-tree');
//Alte DS entfernen
var oldDatasources = treeLV.database.GetDataSources();
try
{
LvTreeDatasource.removeXMLSinkObserver(LvTreeSinkObserver);
treeLV.builder.removeListener(LvTreeListener);
}
catch(e)
{}
while(oldDatasources.hasMoreElements())
{
treeLV.database.RemoveDataSource(oldDatasources.getNext());
}
var rdfService = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService);
LvTreeDatasource = rdfService.GetDataSource(url);
LvTreeDatasource.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource);
LvTreeDatasource.QueryInterface(Components.interfaces.nsIRDFXMLSink);
treeLV.database.AddDataSource(LvTreeDatasource);
LvTreeDatasource.addXMLSinkObserver(LvTreeSinkObserver);
treeLV.builder.addListener(LvTreeListener);
document.getElementById('lehrveranstaltung-toolbar-lehrauftrag').hidden=false;
}
catch(e)
{
debug(e);
}
}
function loadURL(event)
{
var contentFrame = document.getElementById('contentFrame');
var url = event.target.getAttribute('value');
if (url) contentFrame.setAttribute('src', url);
};
function parseRDFString(str, url)
{
try {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
} catch(e) {
alert(e);
return;
}
var memoryDS = Components.classes["@mozilla.org/rdf/datasource;1?name=in-memory-datasource"].createInstance(Components.interfaces.nsIRDFDataSource);
var ios=Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService);
baseUri=ios.newURI(url,null,null);
var parser=Components.classes["@mozilla.org/rdf/xml-parser;1"].createInstance(Components.interfaces.nsIRDFXMLParser);
parser.parseString(memoryDS,baseUri,str);
return memoryDS;
}
+162
View File
@@ -0,0 +1,162 @@
<?php
require_once('../config/vilesci.config.inc.php');
header("Content-type: application/vnd.mozilla.xul+xml");
echo '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>';
/*echo '<?xul-overlay href="'.APP_ROOT.'content/student/studentenoverlay.xul.php?xulapp=planner"?>';
echo '<?xul-overlay href="'.APP_ROOT.'content/lvplanung/lehrveranstaltungoverlay.xul.php"?>';
echo '<?xul-overlay href="'.APP_ROOT.'content/lvplanung/stpl-week-overlay.xul.php"?>';*/
echo '<?xul-overlay href="'.APP_ROOT.'content/projekt/projekttask.overlay.xul.php"?>';
?>
<!DOCTYPE overlay >
<!-- [<?php require_once("../locale/de-AT/planner.dtd"); ?>] -->
<overlay id="PlannerOverlay"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
>
<script type="application/x-javascript" src="<?php echo APP_ROOT; ?>content/fasoverlay.js.php" />
<script type="application/x-javascript" src="<?php echo APP_ROOT; ?>content/planner.overlay.js.php" />
<script type="application/x-javascript" src="chrome://global/content/nsTransferable.js"/>
<script type="application/x-javascript" src="<?php echo APP_ROOT; ?>content/DragAndDrop.js"/>
<script type="application/x-javascript" src="<?php echo APP_ROOT; ?>content/dragboard.js.php"/>
<vbox id="box-projekt">
<popupset>
<popup id="projekttask-tree-popup">
<menuitem label="Entfernen" oncommand="LeDelete();" id="projekttask-tree-popup-entf" disabled="false"/>
</popup>
</popupset>
<toolbox>
<toolbar id="projekttask-nav-toolbar">
<toolbarbutton id="projekttask-toolbar-neu" label="Neues Projekt" oncommand="ProjektNeu();" disabled="true" image="../skin/images/NeuDokument.png" tooltiptext="Neues Projekt anlegen" />
<toolbarbutton id="projekttask-toolbar-del" label="Loeschen" oncommand="LeDelete();" disabled="true" image="../skin/images/DeleteIcon.png" tooltiptext="Lehreinheiten löschen"/>
<toolbarbutton id="projekttask-toolbar-refresh" label="Aktualisieren" oncommand="LvTreeRefresh()" disabled="false" image="../skin/images/refresh.png" tooltiptext="Liste neu laden"/>
<toolbarbutton id="projekttask-toolbar-lehrauftrag" label="Lehrauftrag" oncommand="LvCreateLehrauftrag()" disabled="false" image="../skin/images/person.gif" tooltiptext="Lehrauftrag ausdrucken" hidden="true"/>
<!--<toolbarbutton id="projekttask-toolbar-refresh" label="Load" oncommand="debugload()" disabled="false"/>-->
</toolbar>
</toolbox>
<tree id="tree-projekt" onselect="onProjektSelect();"
seltype="single" hidecolumnpicker="false" flex="1"
datasources="../rdf/projektphase.rdf.php?foo=<?php echo time(); ?>" ref="http://www.technikum-wien.at/projektphase/alle-projektphasen"
enableColumnDrag="true"
ondraggesture="nsDragAndDrop.startDrag(event,lvbgrpDDObserver);"
ondragdrop="nsDragAndDrop.drop(event,verbandtreeDDObserver)"
ondragover="nsDragAndDrop.dragOver(event,verbandtreeDDObserver)"
ondragenter="nsDragAndDrop.dragEnter(event,verbandtreeDDObserver)"
ondragexit="nsDragAndDrop.dragExit(event,verbandtreeDDObserver)"
>
<treecols>
<treecol id="tree-projekt-bezeichnung" label="Bezeichnung" flex="15" primary="true" />
<splitter class="tree-splitter"/>
<treecol id="tree-projekt-oe" label="OE" flex="2" hidden="true" />
<splitter class="tree-splitter"/>
<treecol id="tree-projekt-projekt_kurzbz" label="Projekt" flex="2" hidden="true"/>
<splitter class="tree-splitter"/>
<treecol id="tree-projekt-projekt_phase" label="Phase" flex="2" hidden="true"/>
<splitter class="tree-splitter"/>
<treecol id="tree-projekt-projekt_phase_id" label="PhaseID" flex="2" hidden="true"/>
<splitter class="tree-splitter"/>
<treecol id="tree-projekt-titel" label="Titel" flex="2" hidden="true"/>
<splitter class="tree-splitter"/>
<treecol id="tree-projekt-nummer" label="Nummer" flex="1" hidden="false"/>
<splitter class="tree-splitter"/>
<treecol id="tree-projekt-beginn" label="Beginn" flex="1" hidden="false"/>
<splitter class="tree-splitter"/>
<treecol id="tree-projekt-ende" label="Ende" flex="1" hidden="false"/>
</treecols>
<template>
<rule>
<treechildren>
<treeitem uri="rdf:*">
<treerow>
<treecell label="rdf:http://www.technikum-wien.at/projektphase/rdf#bezeichnung"/>
<treecell label="rdf:http://www.technikum-wien.at/projektphase/rdf#oe_kurzbz"/>
<treecell label="rdf:http://www.technikum-wien.at/projektphase/rdf#projekt_kurzbz"/>
<treecell label="rdf:http://www.technikum-wien.at/projektphase/rdf#projekt_phase"/>
<treecell label="rdf:http://www.technikum-wien.at/projektphase/rdf#projekt_phase_id"/>
<treecell label="rdf:http://www.technikum-wien.at/projektphase/rdf#titel"/>
<treecell label="rdf:http://www.technikum-wien.at/projektphase/rdf#nummer"/>
<treecell label="rdf:http://www.technikum-wien.at/projektphase/rdf#beginn"/>
<treecell label="rdf:http://www.technikum-wien.at/projektphase/rdf#ende"/>
</treerow>
</treeitem>
</treechildren>
</rule>
</template>
</tree>
</vbox>
<!--<tree id="tree-ort" onselect="onOrtSelect();"
seltype="single" hidecolumnpicker="false" flex="1"
datasources="../rdf/ort.rdf.php" ref="http://www.technikum-wien.at/ort/alle-orte">
<treecols>
<treecol id="raumtyp" label="Raumtyp" flex="2" primary="true" persist="hidden, width, ordinal"/>
<splitter class="tree-splitter"/>
<treecol id="ort_kurzbz" label="Raum" flex="4" hidden="true" persist="hidden, width, ordinal"/>
<splitter class="tree-splitter"/>
<treecol id="hierarchie" label="HI" flex="1" hidden="true" persist="hidden, width, ordinal"/>
<splitter class="tree-splitter"/>
<treecol id="ort_bezeichnung" label="Bezeichnung" flex="3" hidden="true" persist="hidden, width, ordinal"/>
<splitter class="tree-splitter"/>
<treecol id="max_person" label="MaxP" flex="1" hidden="true" persist="hidden, width, ordinal"/>
<splitter class="tree-splitter"/>
<treecol id="raumtypen" label="Raumtypen" flex="1" hidden="true" persist="hidden, width, ordinal"/>
<splitter class="tree-splitter"/>
<treecol id="stockwerk" label="Stockwerk" flex="1" hidden="true" persist="hidden, width, ordinal"/>
<splitter class="tree-splitter"/>
<treecol id="planbezeichnung" label="Planbezeichnung" flex="1" hidden="true" persist="hidden, width, ordinal"/>
</treecols>
<template>
<rule>
<treechildren>
<treeitem uri="rdf:*">
<treerow>
<treecell label="rdf:http://www.technikum-wien.at/ort/rdf#raumtyp"/>
<treecell label="rdf:http://www.technikum-wien.at/ort/rdf#ort_kurzbz"/>
<treecell label="rdf:http://www.technikum-wien.at/ort/rdf#hierarchie"/>
<treecell label="rdf:http://www.technikum-wien.at/ort/rdf#ort_bezeichnung"/>
<treecell label="rdf:http://www.technikum-wien.at/ort/rdf#max_person"/>
<treecell label="rdf:http://www.technikum-wien.at/ort/rdf#raumtypen"/>
<treecell label="rdf:http://www.technikum-wien.at/ort/rdf#stockwerk"/>
<treecell label="rdf:http://www.technikum-wien.at/ort/rdf#planbezeichnung"/>
</treerow>
</treeitem>
</treechildren>
</rule>
</template>
</tree>-->
<vbox id="vbox-main">
<popupset>
<popup id="fasoverlay-lektor-tree-popup">
<menuitem label="Mail senden" oncommand="LektorFunktionMail();" />
<menuseparator />
<menuitem label="Entfernen" oncommand="LektorFunktionDel();" />
</popup>
</popupset>
<tabbox id="tabbox-main" flex="3" orient="vertical">
<tabs orient="horizontal">
<tab id="tab-projekttask" label="Tasks" />
<tab id="tab-semester" label="Semesterplan" />
<tab id="tab-studenten" label="Studenten" />
<tab id="tab-lfvt" label="Lehrveranstaltung" />
</tabs>
<tabpanels id="tabpanels-main" flex="1">
<!-- Projekttask -->
<vbox id="box-projekttask" />
<!-- Semesterplan -->
<vbox id="vboxTimeTableSemester" />
<!-- Studenten -->
<vbox id="studentenEditor" />
<!-- Lehrfachverteilung -->
<vbox id="LehrveranstaltungEditor" />
</tabpanels>
</tabbox>
</vbox>
</overlay>
+295
View File
@@ -0,0 +1,295 @@
<?php
header("Content-type: application/vnd.mozilla.xul+xml");
echo '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>';
require_once('../config/vilesci.config.inc.php');
require_once('../include/functions.inc.php');
require_once('../include/benutzerberechtigung.class.php');
require_once('../include/studiensemester.class.php');
$uid=get_uid();
$error_msg='';
loadVariables($uid);
$rechte = new benutzerberechtigung();
$rechte->getBerechtigungen($uid);
/*echo '<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>';*/
echo '<?xml-stylesheet href="'.APP_ROOT.'skin/planner.css" type="text/css"?>';
echo '<?xul-overlay href="'.APP_ROOT.'content/planner.overlay.xul.php"?>';
echo '<?xml-stylesheet href="'.APP_ROOT.'content/bindings.css" type="text/css" ?>';
echo '<?xml-stylesheet href="datepicker/datepicker.css" type="text/css"?>';
?>
<!DOCTYPE window [
<?php require("../locale/de-AT/planner.dtd"); ?>
]>
<window
id="planner"
title="&window.title; &window.version;"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
orient="vertical"
width="800"
height="600"
persist="screenX screenY width height sizemode"
onload="onLoad()"
>
<script type="application/x-javascript" src="<?php echo APP_ROOT; ?>content/planner.js.php" />
<script type="application/x-javascript" src="chrome://global/content/nsTransferable.js"/>
<script type="application/x-javascript" src="<?php echo APP_ROOT; ?>content/DragAndDrop.js"/>
<commandset id="maincommands">
<command id="menu-file-close:command" oncommand="closeWindow();"/>
<command id="menu-properties-studiensemester:command" oncommand="studiensemesterChange();"/>
<command id="menu-prefs-stpltable-stundenplan:command" oncommand="stpltableChange('stundenplan');"/>
<command id="menu-prefs-stpltable-stundenplandev:command" oncommand="stpltableChange('stundenplandev');"/>
<command id="menu-prefs-ignore_kollision:command" oncommand="variableChange('ignore_kollision','menu-prefs-ignore_kollision');"/>
<command id="menu-prefs-ignore_zeitsperre:command" oncommand="variableChange('ignore_zeitsperre','menu-prefs-ignore_zeitsperre');"/>
<command id="menu-prefs-ignore_reservierung:command" oncommand="variableChange('ignore_reservierung','menu-prefs-ignore_reservierung');"/>
<command id="menu-prefs-kollision_student:command" oncommand="variableChange('kollision_student','menu-prefs-kollision_student');"/>
<command id="menu-prefs-max_kollision:command" oncommand="variableChangeValue('max_kollision');"/>
<command id="menu-extras-kollisionstudent:command" oncommand="KollisionStudentShow();"/>
<command id="menu-extras-lvplanwartung:command" oncommand="LVPlanWartungShow();"/>
<command id="menu-extras-rescheck:command" oncommand="ResCheckShow();"/>
<command id="menu-help-about:command" oncommand="OpenAboutDialog()"/>
<command id="menu-help-todo:command" oncommand="HelpOpenToDo();"/>
<command id="menu-help-manual:command" oncommand="OpenManualPlanner();"/>
</commandset>
<keyset id="mainkeys">
<key
id = "menu-file-close:key"
key = "&menu-file-close.key;"
observes = "menu-file-close:command"
modifiers = "accel" />
<key id="keycode_ignore_kollision" keycode="VK_F9" oncommand="toggleIgnoreKollision()"/>
</keyset>
<toolbox id="main-toolbox">
<menubar id="menu" >
<menu id="menu-file" label="&menu-file.label;" accesskey="&menu-file.accesskey;">
<menupopup id="menu-file-popup">
<menuitem
id = "menu-file-close"
key = "menu-file-close:key"
label = "&menu-file-close.label;"
command = "menu-file-close:command"
accesskey = "&menu-file-close.accesskey;"/>
</menupopup>
</menu>
<menu id="menu-edit" label="&menu-edit.label;" accesskey="&menu-edit.accesskey;" onclick="">
<menupopup id="menu-edit-popup" onpopupshowing="loadUndoList();">
<menu id="menu-edit-undo" label="&menu-edit-undo.label;"
datasources="rdf:null"
ref="http://www.technikum-wien.at/undo/liste"
>
<template>
<rule>
<menupopup id="menu-edit-undo-popup">
<menuitem uri="rdf:*" label="rdf:http://www.technikum-wien.at/undo/rdf#beschreibung"
value="rdf:http://www.technikum-wien.at/undo/rdf#log_id"
onclick="UnDo(this.value, this.label);"/>
</menupopup>
</rule>
</template>
</menu>
</menupopup>
</menu>
<menu id="menu-prefs" label="&menu-prefs.label;" accesskey="&menu-prefs.accesskey;">
<menupopup id="menu-prefs-popup">
<menu
id = "menu-properies-studiensemester"
label = "Studiensemester">
<menupopup id="menu-properties-popup">
<?php
$stsemobj = new studiensemester();
$stsemobj->getAll();
foreach ($stsemobj->studiensemester as $stsem)
{
echo "
<menuitem
id = 'menu-properies-studiensemester-name'
label = '$stsem->studiensemester_kurzbz'
type = 'radio'
command = 'menu-properties-studiensemester:command'
checked = ".($semester_aktuell==$stsem->studiensemester_kurzbz?"'true' ":"'false'")." />";
}
?>
</menupopup>
</menu>
<?php
if($rechte->isBerechtigt('lv-plan'))
{
?>
<menu id="menu-prefs-stpltable" label="&menu-prefs-stpltable.label;" accesskey="&menu-prefs-stpltable.accesskey;">
<menupopup id="menu-prefs-stpltable-popup">
<menuitem
id ="menu-prefs-stpltable-stundenplan"
type ="radio"
key ="menu-prefs-stpltable-stundenplan:key"
label ="&menu-prefs-stpltable-stundenplan.label;"
command ="menu-prefs-stpltable-stundenplan:command"
accesskey ="&menu-prefs-stpltable-stundenplan.accesskey;"
checked ="<?php echo ($db_stpl_table=='stundenplan'?'true':'false');?>" />
<menuitem
id ="menu-prefs-stpltable-stundenplandev"
type ="radio"
key ="menu-prefs-stpltable-stundenplandev:key"
label ="&menu-prefs-stpltable-stundenplandev.label;"
command ="menu-prefs-stpltable-stundenplandev:command"
accesskey ="&menu-prefs-stpltable-stundenplandev.accesskey;"
checked ="<?php echo ($db_stpl_table=='stundenplandev'?'true':'false');?>" />
</menupopup>
</menu>
<menuitem
id ="menu-prefs-ignore_kollision"
type ="checkbox"
key ="menu-prefs-ignore_kollision:key"
label ="&menu-prefs-ignore_kollision.label;"
command ="menu-prefs-ignore_kollision:command"
accesskey ="&menu-prefs-ignore_kollision.accesskey;"
checkbox ="true"
checked ="<?php echo $ignore_kollision;?>"
/>
<menuitem
id ="menu-prefs-ignore_zeitsperre"
type ="checkbox"
key ="menu-prefs-ignore_zeitsperre:key"
label ="&menu-prefs-ignore_zeitsperre.label;"
command ="menu-prefs-ignore_zeitsperre:command"
accesskey ="&menu-prefs-ignore_zeitsperre.accesskey;"
checkbox ="true"
checked ="<?php echo $ignore_zeitsperre;?>"
/>
<menuitem
id ="menu-prefs-ignore_reservierung"
type ="checkbox"
key ="menu-prefs-ignore_reservierung:key"
label ="&menu-prefs-ignore_reservierung.label;"
command ="menu-prefs-ignore_reservierung:command"
accesskey ="&menu-prefs-ignore_reservierung.accesskey;"
checkbox ="true"
checked ="<?php echo $ignore_reservierung;?>"
/>
<menuitem
id ="menu-prefs-kollision_student"
type ="checkbox"
key ="menu-prefs-kollision_student:key"
label ="&menu-prefs-kollision_student.label;"
command ="menu-prefs-kollision_student:command"
accesskey ="&menu-prefs-kollision_student.accesskey;"
checkbox ="true"
checked ="<?php echo $kollision_student;?>"
/>
<menuitem
id ="menu-prefs-max_kollision"
key ="menu-prefs-max_kollision:key"
label ="&menu-prefs-max_kollision.label;"
command ="menu-prefs-max_kollision:command"
accesskey ="&menu-prefs-max_kollision.accesskey;"
value ="<?php echo $max_kollision;?>"
/>
<?php
}
?>
</menupopup>
</menu>
<menu id="menu-extras" label="&menu-extras.label;" accesskey="&menu-extras.accesskey;">
<menupopup id="menu-extras-popup">
<menuitem
id = "menu-extras-kollisionstudent"
key = "menu-extras-kollisionstudent:key"
label = "&menu-extras-kollisionstudent.label;"
command = "menu-extras-kollisionstudent:command"
accesskey = "&menu-extras-kollisionstudent.accesskey;"/>
<menuitem
id = "menu-extras-lvplanwartung"
key = "menu-extras-lvplanwartung:key"
label = "&menu-extras-lvplanwartung.label;"
command = "menu-extras-lvplanwartung:command"
accesskey = "&menu-extras-lvplanwartung.accesskey;"/>
<menuitem
id = "menu-extras-rescheck"
key = "menu-extras-rescheck:key"
label = "&menu-extras-rescheck.label;"
command = "menu-extras-rescheck:command"
accesskey = "&menu-extras-rescheck.accesskey;"/>
</menupopup>
</menu>
<menu id="menu-help" label="&menu-help.label;" accesskey="&menu-help.accesskey;">
<menupopup id="menu-about-popup">
<menuitem
id = "menu-help-about"
key = "menu-help-about:key"
label = "&menu-help-about.label;"
command = "menu-help-about:command"
accesskey = "&menu-help-about.accesskey;"/>
<menuitem
id = "menu-help-manual"
key = "menu-help-manual:key"
label = "&menu-help-manual.label;"
command = "menu-help-manual:command"
accesskey = "&menu-help-manual.accesskey;"/>
<menuitem
id = "menu-help-todo"
key = "&menu-help-todo.key;"
label = "&menu-help-todo.label;"
command = "menu-help-todo:command"
accesskey = "&menu-help-todo.accesskey;"/>
</menupopup>
</menu>
</menubar>
</toolbox>
<hbox flex="1">
<tabbox id="tabbox-left" orient="vertical" flex="1">
<tabs orient="horizontal">
<tab id="tab-projekt" label="Projekt" />
<tab id="tab-ressource" label="Ressource" />
<tab id="tab-lektor" label="Lektor" />
</tabs>
<tabpanels id="tabpanels-left" flex="1">
<vbox id="box-projekt" />
<tree id="tree-ressource" />
<tree id="tree-lektor" />
</tabpanels>
</tabbox>
<splitter collapse="before" persist="state">
<grippy />
</splitter>
<vbox id="vbox-main" flex="15" />
</hbox>
<statusbar id="status-bar" persist="collapsed">
<statusbarpanel class="statusbarpanel-iconic" id="logo-icon" />
<statusbarpanel>
<toolbarbutton id="statusbarpanel-studiensemester-left"
tooltiptext="1 Studiensemester zurueck"
image="../skin/images/left.png"
oncommand="studiensemesterChange('', -1)"
/>
<toolbarbutton id="statusbarpanel-semester" label="<?php echo $semester_aktuell; ?>" oncommand="getStudiensemesterVariable()"/>
<toolbarbutton id="statusbarpanel-studiensemester-right"
tooltiptext="1 Studiensemester vor"
image="../skin/images/right.png"
oncommand="studiensemesterChange('', 1)"
/>
</statusbarpanel>
<?php
if($rechte->isBerechtigt('system/developer'))
echo '<statusbarpanel label="'.DB_NAME.'"/>';
?>
<statusbarpanel id="statusbarpanel-db_table" label="<?php echo $db_stpl_table; ?>"/>
<statusbarpanel>
<toolbarbutton id="statusbarpanel-ignore_kollision" label="Kollisionscheck <?php echo ($ignore_kollision=='true'?'AUS':'AN'); ?>" <?php echo ($ignore_kollision=='true'?'style="background-color: RED;"':'');?> oncommand="updateignorekollision()"/>
</statusbarpanel>
<statusbarpanel id="statusbarpanel-text" label="<?php echo htmlspecialchars($error_msg); ?>" flex="4" crop="right" />
<statusbarpanel id="progress-panel" class="statusbarpanel-progress">
<progressmeter id="statusbar-progressmeter" class="progressmeter-statusbar" mode="determined" value="0%"/>
</statusbarpanel>
<statusbarpanel class="statusbarpanel-iconic" id="example-status" />
</statusbar>
</window>
File diff suppressed because it is too large Load Diff
+140
View File
@@ -0,0 +1,140 @@
<?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>
*/
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" standalone="yes" ?>';
echo '<?xul-overlay href="'.APP_ROOT.'content/projekt/projekttaskdetail.overlay.xul.php"?>';
echo '<?xul-overlay href="'.APP_ROOT.'content/projekt/projekttasknoten.overlay.xul.php"?>';
?>
<overlay id="ProjekttaskOverlay"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
>
<script type="application/x-javascript" src="<?php echo APP_ROOT; ?>content/phpRequest.js.php" />
<script type="application/x-javascript" src="<?php echo APP_ROOT; ?>content/projekt/projekttask.overlay.js.php" />
<script type="application/x-javascript" src="<?php echo APP_ROOT; ?>content/functions.js.php" />
<!-- ************************ -->
<!-- * Projekttask * -->
<!-- ************************ -->
<vbox id="box-projekttask" flex="1" uid="" stg_kz="">
<popupset>
<popup id="projekttask-tree-popup">
<menuitem label="Entfernen" oncommand="LeDelete();" id="projekttask-tree-popup-entf" disabled="false"/>
</popup>
</popupset>
<toolbox>
<toolbar id="projekttask-nav-toolbar">
<toolbarbutton id="projekttask-toolbar-neu" label="Neue Lehreinheit" oncommand="LeNeu();" disabled="true" image="../skin/images/NeuDokument.png" tooltiptext="Neue Lehreinheit anlegen" />
<toolbarbutton id="projekttask-toolbar-del" label="Loeschen" oncommand="LeDelete();" disabled="true" image="../skin/images/DeleteIcon.png" tooltiptext="Lehreinheiten löschen"/>
<toolbarbutton id="projekttask-toolbar-refresh" label="Aktualisieren" oncommand="LvTreeRefresh()" disabled="false" image="../skin/images/refresh.png" tooltiptext="Liste neu laden"/>
<toolbarbutton id="projekttask-toolbar-lehrauftrag" label="Lehrauftrag" oncommand="LvCreateLehrauftrag()" disabled="false" image="../skin/images/person.gif" tooltiptext="Lehrauftrag ausdrucken" hidden="true"/>
<!--<toolbarbutton id="projekttask-toolbar-refresh" label="Load" oncommand="debugload()" disabled="false"/>-->
</toolbar>
</toolbox>
<!-- ************* -->
<!-- * Auswahl * -->
<!-- ************* rdf:null -->
<!-- Bem.: style="visibility:collapse" versteckt eine Spalte -->
<tree id="projekttask-tree" seltype="single" hidecolumnpicker="false" flex="1"
datasources="../../rdf/projekttask.rdf.php?foo=123" ref="http://www.technikum-wien.at/projekttask/alle-projekttasks"
style="margin:0px;" enableColumnDrag="true"
onselect="LeAuswahl(this);"
persist="height"
onkeypress="LvTreeKeyPress(event)"
flags="dont-build-content"
context="projekttask-tree-popup"
>
<treecols>
<treecol id="projekttask-treecol-bezeichnung" label="Bezeichnung" flex="5" hidden="false" primary="true" persist="hidden, width, ordinal"
class="sortDirectionIndicator"
sort="rdf:http://www.technikum-wien.at/projekttask/rdf#bezeichnung"/>
<splitter class="tree-splitter"/>
<treecol id="projekttask-treecol-projektphase_id" label="ProjektphaseID" flex="2" hidden="true" persist="hidden, width, ordinal"
class="sortDirectionIndicator"
sort="rdf:http://www.technikum-wien.at/projekttask/rdf#projektphase_id"/>
<splitter class="tree-splitter"/>
<treecol id="projekttask-treecol-projekttask_id" label="ProjekttaskID" flex="2" hidden="true" persist="hidden, width, ordinal"
class="sortDirectionIndicator"
sort="rdf:http://www.technikum-wien.at/projekttask/rdf#projekttask_id"/>
<splitter class="tree-splitter"/>
<treecol id="projekttask-treecol-beschreibung" label="Beschreibung" flex="5" hidden="true" persist="hidden, width, ordinal"
class="sortDirectionIndicator"
sort="rdf:http://www.technikum-wien.at/projekttask/rdf#beschreibung"/>
<splitter class="tree-splitter"/>
<treecol id="projekttask-treecol-aufwand" label="Aufwand" flex="2" hidden="false" persist="hidden, width, ordinal"
class="sortDirectionIndicator"
sort="rdf:http://www.technikum-wien.at/projekttask/rdf#sprache" />
<splitter class="tree-splitter"/>
<treecol id="projekttask-treecol-mantis_id" label="MantisID" flex="2" hidden="false" persist="hidden, width, ordinal"
class="sortDirectionIndicator"
sort="rdf:http://www.technikum-wien.at/projekttask/rdf#ects" />
<splitter class="tree-splitter"/>
</treecols>
<template>
<treechildren flex="1" >
<treeitem uri="rdf:*">
<treerow dbID="rdf:http://www.technikum-wien.at/projekttask/rdf#projekttask_id" >
<treecell label="rdf:http://www.technikum-wien.at/projekttask/rdf#bezeichnung"/>
<treecell label="rdf:http://www.technikum-wien.at/projekttask/rdf#projektphase_id"/>
<treecell label="rdf:http://www.technikum-wien.at/projekttask/rdf#projekttask_id"/>
<treecell label="rdf:http://www.technikum-wien.at/projekttask/rdf#beschreibung"/>
<treecell label="rdf:http://www.technikum-wien.at/projekttask/rdf#aufwand"/>
<treecell label="rdf:http://www.technikum-wien.at/projekttask/rdf#mantis_id"/>
</treerow>
</treeitem>
</treechildren>
</template>
</tree>
<splitter collapse="after" persist="state">
<grippy />
</splitter>
<!-- ************ -->
<!-- * Detail * -->
<!-- ************ -->
<vbox flex="1" style="overflow:auto;margin:0px;" persist="height">
<tabbox id="projekttask-tabbox" flex="3" orient="vertical">
<tabs orient="horizontal" id="projekttask-tabs">
<tab id="projekttask-tab-detail" label="Details" />
<tab id="projekttask-tab-mantis" label="Mantis" />
<tab id="projekttask-tab-noten" label="Noten" />
</tabs>
<tabpanels id="projekttask-tabpanels-main" flex="1">
<vbox id="projekttask-detail" />
<vbox id="projekttask-mantis" />
<vbox id="projekttask-noten" />
</tabpanels>
</tabbox>
</vbox>
</vbox>
</overlay>
+474
View File
@@ -0,0 +1,474 @@
<?php
/* Copyright (C) 2007 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>
*/
/**
* Klasse projektarbeit
* @create 08-02-2007
*/
require_once(dirname(__FILE__).'/basis_db.class.php');
class projekt extends basis_db
{
public $new; // boolean
public $result = array(); // adresse Objekt
//Tabellenspalten
public $projekt_kurzbz; //string
public $nummer; //string
public $titel; //string
public $beschreibung; //string
public $beginn; //date
public $ende; //date
public $oe_kurzbz; //string
public $ext_id; // integer
public $insertamum; // timestamp
public $insertvon; // bigint
public $updateamum; // timestamp
public $updatevon; // bigint
/**
* Konstruktor
* @param $projekt_kurzbz ID der Projektarbeit, die geladen werden soll (Default=null)
*/
public function __construct($projekt_kurzbz=null)
{
parent::__construct();
if($projekt_kurzbz != null)
$this->load($projekt_kurzbz);
}
/**
* Laedt die Projektarbeit mit der ID $projekt_kurzbz
* @param $projekt_kurzbz ID der zu ladenden Projektarbeit
* @return true wenn ok, false im Fehlerfall
*/
public function load($projekt_kurzbz)
{
if(!is_numeric($projekt_kurzbz))
{
$this->errormsg = 'Projektarbeit_id muss eine gueltige Zahl sein';
return false;
}
$qry = "SELECT * FROM fue.tbl_projekt WHERE projekt_kurzbz='$projekt_kurzbz'";
if($this->db_query($qry))
{
if($row = $this->db_fetch_object())
{
$this->projekt_kurzbz = $row->projekt_kurzbz;
$this->projekttyp_kurzbz = $row->projekttyp_kurzbz;
$this->titel = $row->titel;
$this->titel_english = $row->titel_english;
$this->lehreinheit_id = $row->lehreinheit_id;
$this->student_uid = $row->student_uid;
$this->firma_id = $row->firma_id;
$this->note = $row->note;
$this->punkte = $row->punkte;
$this->beginn = $row->beginn;
$this->ende = $row->ende;
$this->faktor = $row->faktor;
$this->freigegeben = ($row->freigegeben=='t'?true:false);
$this->gesperrtbis = $row->gesperrtbis;
$this->stundensatz = $row->stundensatz;
$this->gesamtstunden = $row->gesamtstunden;
$this->themenbereich = $row->themenbereich;
$this->anmerkung = $row->anmerkung;
$this->ext_id = $row->ext_id;
$this->insertamum = $row->insertamum;
$this->insertvon = $row->insertvon;
$this->updateamum = $row->updateamum;
$this->updatevon = $row->updatevon;
return true;
}
else
{
$this->errormsg = 'Datensatz wurde nicht gefunden';
return false;
}
}
else
{
$this->errormsg = 'Fehler beim Laden der Daten';
return false;
}
}
/**
* Laedt die Projektarbeit mit der ID $projekt_kurzbz
* @param $projekt_kurzbz ID der zu ladenden Projektarbeit
* @return true wenn ok, false im Fehlerfall
*/
public function getProjekte($uid=null)
{
$qry = "SELECT * FROM fue.tbl_projekt ORDER BY oe_kurzbz";
if($this->db_query($qry))
{
while($row = $this->db_fetch_object())
{
$obj = new projekt();
$obj->projekt_kurzbz = $row->projekt_kurzbz;
$obj->nummer = $row->nummer;
$obj->titel = $row->titel;
$obj->beschreibung = $row->beschreibung;
$obj->beginn = $row->beginn;
$obj->ende = $row->ende;
$obj->oe_kurzbz = $row->oe_kurzbz;
$this->result[] = $obj;
}
return true;
}
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()
{
//Gesamtlaenge pruefen
if ($this->projekttyp_kurzbz==null)
{
$this->errormsg='Projekttyp_kurzbz darf nicht NULL sein!';
}
if ($this->lehreinheit_id==null)
{
$this->errormsg='Lehreinheit_id darf nicht NULL sein!';
}
if(mb_strlen($this->projekttyp_kurzbz)>16)
{
$this->errormsg = 'Projektyp_kurzbz darf nicht länger als 16 Zeichen sein';
return false;
}
if(mb_strlen($this->titel)>1024)
{
$this->errormsg = 'Titel darf nicht länger als 1024 Zeichen sein';
return false;
}
if(mb_strlen($this->titel_english)>1024)
{
$this->errormsg = 'Titel darf nicht länger als 1024 Zeichen sein';
return false;
}
if(mb_strlen($this->themenbereich)>64)
{
$this->errormsg = 'Themenbereich darf nicht länger als 64 Zeichen sein';
return false;
}
if(mb_strlen($this->anmerkung)>256)
{
$this->errormsg = 'Anmerkung darf nicht länger als 256 Zeichen sein';
return false;
}
/*if(!is_numeric($this->note))
{
$this->errormsg = 'Note muß ein numerischer Wert sein - student_uid: '.$this->student_uid;
return false;
}*/
if($this->punkte!='' && !is_numeric($this->punkte))
{
$this->errormsg = 'Punkte muss ein numerischer Wert sein';
return false;
}
if($this->faktor!='' && !is_numeric($this->faktor))
{
$this->errormsg = 'Faktor muss ein numerischer Wert sein';
return false;
}
if($this->stundensatz!='' && !is_numeric($this->stundensatz))
{
$this->errormsg = 'Stundensatz muss ein numerischer Wert sein';
return false;
}
if($this->gesamtstunden!='' && !is_numeric($this->gesamtstunden))
{
$this->errormsg = 'Gesamtstunden muss ein numerischer Wert sein';
return false;
}
if(!is_bool($this->freigegeben))
{
$this->errormsg = 'freigegeben ist ungueltig';
return false;
}
$this->errormsg = '';
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 $projekt_kurzbz aktualisiert
* @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 lehre.tbl_projektarbeit (projekttyp_kurzbz, titel, lehreinheit_id, student_uid, firma_id, note, punkte,
beginn, ende, faktor, freigegeben, gesperrtbis, stundensatz, gesamtstunden, themenbereich, anmerkung,
ext_id, insertamum, insertvon, updateamum, updatevon, titel_english) VALUES('.
$this->addslashes($this->projekttyp_kurzbz).', '.
$this->addslashes($this->titel).', '.
$this->addslashes($this->lehreinheit_id).', '.
$this->addslashes($this->student_uid).', '.
$this->addslashes($this->firma_id).', '.
$this->addslashes($this->note).', '.
$this->addslashes($this->punkte).', '.
$this->addslashes($this->beginn).', '.
$this->addslashes($this->ende).', '.
$this->addslashes($this->faktor).', '.
($this->freigegeben?'true':'false').', '.
$this->addslashes($this->gesperrtbis).', '.
$this->addslashes($this->stundensatz).', '.
$this->addslashes($this->gesamtstunden).', '.
$this->addslashes($this->themenbereich).', '.
$this->addslashes($this->anmerkung).', '.
$this->addslashes($this->ext_id).', now(), '.
$this->addslashes($this->insertvon).', now(), '.
$this->addslashes($this->updatevon).','.
$this->addslashes($this->titel_english).');';
}
else
{
//Updaten des bestehenden Datensatzes
//Pruefen ob projekt_kurzbz eine gueltige Zahl ist
if(!is_numeric($this->projekt_kurzbz))
{
$this->errormsg = 'projekt_kurzbz muss eine gueltige Zahl sein';
return false;
}
$qry='UPDATE lehre.tbl_projektarbeit SET '.
'projekttyp_kurzbz='.$this->addslashes($this->projekttyp_kurzbz).', '.
'titel='.$this->addslashes($this->titel).', '.
'titel_english='.$this->addslashes($this->titel_english).', '.
'lehreinheit_id='.$this->addslashes($this->lehreinheit_id).', '.
'student_uid='.$this->addslashes($this->student_uid).', '.
'firma_id='.$this->addslashes($this->firma_id).', '.
'note='.$this->addslashes($this->note).', '.
'punkte='.$this->addslashes($this->punkte).', '.
'beginn='.$this->addslashes($this->beginn).', '.
'ende='.$this->addslashes($this->ende).', '.
'faktor='.$this->addslashes($this->faktor).', '.
'freigegeben='.($this->freigegeben?'true':'false').', '.
'gesperrtbis='.$this->addslashes($this->gesperrtbis).', '.
'stundensatz='.$this->addslashes($this->stundensatz).', '.
'gesamtstunden='.$this->addslashes($this->gesamtstunden).', '.
'themenbereich='.$this->addslashes($this->themenbereich).', '.
'anmerkung='.$this->addslashes($this->anmerkung).', '.
'updateamum= now(), '.
'updatevon='.$this->addslashes($this->updatevon).' '.
'WHERE projekt_kurzbz='.$this->addslashes($this->projekt_kurzbz).';';
}
if($this->db_query($qry))
{
if($new)
{
//Sequence auslesen
$qry = "SELECT currval('lehre.tbl_projektarbeit_projekt_kurzbz_seq') as id;";
if($this->db_query($qry))
{
if($row = $this->db_fetch_object())
{
$this->projekt_kurzbz = $row->id;
$this->db_query('COMMIT');
return true;
}
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 false;
}
}
/**
* Loescht den Datenensatz mit der ID die uebergeben wird
* @param $projekt_kurzbz ID die geloescht werden soll
* @return true wenn ok, false im Fehlerfall
*/
public function delete($projekt_kurzbz)
{
if(!is_numeric($projekt_kurzbz))
{
$this->errormsg = 'Projektarbeit_id ist ungueltig';
return true;
}
$qry = "DELETE FROM lehre.tbl_projektarbeit WHERE projekt_kurzbz='$projekt_kurzbz'";
if($this->db_query($qry))
{
return true;
}
else
{
$this->errormsg = 'Fehler beim Loeschen des Datensatzes';
return false;
}
}
/**
* Laedt alle Projektarbeiten eines Studenten
* @param student_uid
* @return true wenn ok, false wenn Fehler
*/
public function getProjektarbeit($student_uid)
{
$qry = "SELECT * FROM lehre.tbl_projektarbeit WHERE student_uid='".addslashes($student_uid)."'";
if($this->db_query($qry))
{
while($row = $this->db_fetch_object())
{
$obj = new projektarbeit();
$obj->projekt_kurzbz = $row->projekt_kurzbz;
$obj->projekttyp_kurzbz = $row->projekttyp_kurzbz;
$obj->titel = $row->titel;
$obj->titel_english = $row->titel_english;
$obj->lehreinheit_id = $row->lehreinheit_id;
$obj->student_uid = $row->student_uid;
$obj->firma_id = $row->firma_id;
$obj->note = $row->note;
$obj->punkte = $row->punkte;
$obj->beginn = $row->beginn;
$obj->ende = $row->ende;
$obj->faktor = $row->faktor;
$obj->freigegeben = ($row->freigegeben=='t'?true:false);
$obj->gesperrtbis = $row->gesperrtbis;
$obj->stundensatz = $row->stundensatz;
$obj->gesamtstunden = $row->gesamtstunden;
$obj->themenbereich = $row->themenbereich;
$obj->anmerkung = $row->anmerkung;
$obj->ext_id = $row->ext_id;
$obj->insertamum = $row->insertamum;
$obj->insertvon = $row->insertvon;
$obj->updateamum = $row->updateamum;
$obj->updatevon = $row->updatevon;
$this->result[] = $obj;
}
return true;
}
else
{
$this->errormsg = 'Fehler beim Laden der Daten';
return false;
}
}
/**
* Laedt alle Projektarbeiten eines Studienganges/Studiensemesters
* @param studiengang_kz, studiensemester_kurzbz
* @return true wenn ok, false wenn Fehler
*/
public function getProjektarbeitStudiensemester($studiengang_kz, $studiensemester_kurzbz)
{
$qry = "SELECT
tbl_projektarbeit.*
FROM
lehre.tbl_projektarbeit, lehre.tbl_lehreinheit, lehre.tbl_lehrveranstaltung
WHERE
tbl_projektarbeit.lehreinheit_id=tbl_lehreinheit.lehreinheit_id AND
tbl_lehreinheit.lehrveranstaltung_id = tbl_lehrveranstaltung.lehrveranstaltung_id AND
tbl_lehrveranstaltung.studiengang_kz='".addslashes($studiengang_kz)."' AND
tbl_lehreinheit.studiensemester_kurzbz='".addslashes($studiensemester_kurzbz)."'";
if($this->db_query($qry))
{
while($row = $this->db_fetch_object())
{
$obj = new projektarbeit();
$obj->projekt_kurzbz = $row->projekt_kurzbz;
$obj->projekttyp_kurzbz = $row->projekttyp_kurzbz;
$obj->titel = $row->titel;
$obj->titel_english = $row->titel_english;
$obj->lehreinheit_id = $row->lehreinheit_id;
$obj->student_uid = $row->student_uid;
$obj->firma_id = $row->firma_id;
$obj->note = $row->note;
$obj->punkte = $row->punkte;
$obj->beginn = $row->beginn;
$obj->ende = $row->ende;
$obj->faktor = $row->faktor;
$obj->freigegeben = ($row->freigegeben=='t'?true:false);
$obj->gesperrtbis = $row->gesperrtbis;
$obj->stundensatz = $row->stundensatz;
$obj->gesamtstunden = $row->gesamtstunden;
$obj->themenbereich = $row->themenbereich;
$obj->anmerkung = $row->anmerkung;
$obj->ext_id = $row->ext_id;
$obj->insertamum = $row->insertamum;
$obj->insertvon = $row->insertvon;
$obj->updateamum = $row->updateamum;
$obj->updatevon = $row->updatevon;
$this->result[] = $obj;
}
return true;
}
else
{
$this->errormsg = 'Fehler beim Laden der Daten';
return false;
}
}
}
?>
+474
View File
@@ -0,0 +1,474 @@
<?php
/* Copyright (C) 2007 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>
*/
/**
* Klasse projekttask
* @create 2011-05-23
*/
require_once(dirname(__FILE__).'/basis_db.class.php');
class projektphase extends basis_db
{
public $new; // boolean
public $result = array(); // adresse Objekt
//Tabellenspalten
public $projektphase_id; //integer
public $projekt_kurzbz; //string
public $projektphase_fk; //string
public $bezeichnung; //string
public $beschreibung; //string
public $start; //date
public $ende; //date
public $personentage; //integer
public $budget; // numeric
public $insertamum; // timestamp
public $insertvon; // bigint
public $updateamum; // timestamp
public $updatevon; // bigint
/**
* Konstruktor
* @param $projekt_kurzbz ID der Projektarbeit, die geladen werden soll (Default=null)
*/
public function __construct($projektphase_id=null)
{
parent::__construct();
if($projektphase_id != null)
$this->load($projektphase_id);
}
/**
* Laedt die Projektphase mit der ID $projektphase_id
* @param $projektphase_id ID der zu ladenden Projektphase
* @return true wenn ok, false im Fehlerfall
*/
public function load($projektphase_id)
{
if(!is_numeric($projektphase_id))
{
$this->errormsg = 'Projektarbeit_id muss eine gueltige Zahl sein';
return false;
}
$qry = "SELECT * FROM fue.tbl_projektphase WHERE projektphase_id='$projektphase_id'";
if($this->db_query($qry))
{
if($row = $this->db_fetch_object())
{
$this->projekt_kurzbz = $row->projekt_kurzbz;
$this->projektphase_id = $row->projektphase_id;
$this->projektphase_fk = $row->projektphase_fk;
$this->bezeichnung = $row->bezeichnung;
$this->beschreibung = $row->beschreibung;
$this->start = $row->start;
$this->ende = $row->ende;
$this->personentage = $row->personentage;
$this->budget = $row->budget;
$this->insertamum = $row->insertamum;
$this->insertvon = $row->insertvon;
$this->updateamum = $row->updateamum;
$this->updatevon = $row->updatevon;
return true;
}
else
{
$this->errormsg = 'Datensatz wurde nicht gefunden';
return false;
}
}
else
{
$this->errormsg = 'Fehler beim Laden der Daten';
return false;
}
}
/**
* Laedt die Projektphasen mit zu einem Projekt
* @param $projekt_kurzbz Projekt der zu ladenden Projektphasen
* @return true wenn ok, false im Fehlerfall
*/
public function getProjektphasen($projekt_kurzbz)
{
$this->result=array();
$qry = "SELECT * FROM fue.tbl_projektphase WHERE projekt_kurzbz='$projekt_kurzbz' ORDER BY start;";
//echo "\n".$qry."\n";
if($this->db_query($qry))
{
while($row = $this->db_fetch_object())
{
$obj = new projektphase();
$obj->projekt_kurzbz = $row->projekt_kurzbz;
$obj->projektphase_id = $row->projektphase_id;
$obj->projektphase_fk = $row->projektphase_fk;
$obj->bezeichnung = $row->bezeichnung;
$obj->beschreibung = $row->beschreibung;
$obj->start = $row->start;
$obj->ende = $row->ende;
//$obj->personentage = $row->personentage;
$obj->budget = $row->budget;
$obj->insertamum = $row->insertamum;
$obj->insertvon = $row->insertvon;
$obj->updateamum = $row->updateamum;
$obj->updatevon = $row->updatevon;
$this->result[] = $obj;
}
//var_dump($this->result);
return true;
}
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()
{
//Gesamtlaenge pruefen
if ($this->projekttyp_kurzbz==null)
{
$this->errormsg='Projekttyp_kurzbz darf nicht NULL sein!';
}
if ($this->lehreinheit_id==null)
{
$this->errormsg='Lehreinheit_id darf nicht NULL sein!';
}
if(mb_strlen($this->projekttyp_kurzbz)>16)
{
$this->errormsg = 'Projektyp_kurzbz darf nicht länger als 16 Zeichen sein';
return false;
}
if(mb_strlen($this->titel)>1024)
{
$this->errormsg = 'Titel darf nicht länger als 1024 Zeichen sein';
return false;
}
if(mb_strlen($this->titel_english)>1024)
{
$this->errormsg = 'Titel darf nicht länger als 1024 Zeichen sein';
return false;
}
if(mb_strlen($this->themenbereich)>64)
{
$this->errormsg = 'Themenbereich darf nicht länger als 64 Zeichen sein';
return false;
}
if(mb_strlen($this->anmerkung)>256)
{
$this->errormsg = 'Anmerkung darf nicht länger als 256 Zeichen sein';
return false;
}
/*if(!is_numeric($this->note))
{
$this->errormsg = 'Note muß ein numerischer Wert sein - student_uid: '.$this->student_uid;
return false;
}*/
if($this->punkte!='' && !is_numeric($this->punkte))
{
$this->errormsg = 'Punkte muss ein numerischer Wert sein';
return false;
}
if($this->faktor!='' && !is_numeric($this->faktor))
{
$this->errormsg = 'Faktor muss ein numerischer Wert sein';
return false;
}
if($this->stundensatz!='' && !is_numeric($this->stundensatz))
{
$this->errormsg = 'Stundensatz muss ein numerischer Wert sein';
return false;
}
if($this->gesamtstunden!='' && !is_numeric($this->gesamtstunden))
{
$this->errormsg = 'Gesamtstunden muss ein numerischer Wert sein';
return false;
}
if(!is_bool($this->freigegeben))
{
$this->errormsg = 'freigegeben ist ungueltig';
return false;
}
$this->errormsg = '';
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 $projekt_kurzbz aktualisiert
* @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 lehre.tbl_projektarbeit (projekttyp_kurzbz, titel, lehreinheit_id, student_uid, firma_id, note, punkte,
beginn, ende, faktor, freigegeben, gesperrtbis, stundensatz, gesamtstunden, themenbereich, anmerkung,
ext_id, insertamum, insertvon, updateamum, updatevon, titel_english) VALUES('.
$this->addslashes($this->projekttyp_kurzbz).', '.
$this->addslashes($this->titel).', '.
$this->addslashes($this->lehreinheit_id).', '.
$this->addslashes($this->student_uid).', '.
$this->addslashes($this->firma_id).', '.
$this->addslashes($this->note).', '.
$this->addslashes($this->punkte).', '.
$this->addslashes($this->beginn).', '.
$this->addslashes($this->ende).', '.
$this->addslashes($this->faktor).', '.
($this->freigegeben?'true':'false').', '.
$this->addslashes($this->gesperrtbis).', '.
$this->addslashes($this->stundensatz).', '.
$this->addslashes($this->gesamtstunden).', '.
$this->addslashes($this->themenbereich).', '.
$this->addslashes($this->anmerkung).', '.
$this->addslashes($this->ext_id).', now(), '.
$this->addslashes($this->insertvon).', now(), '.
$this->addslashes($this->updatevon).','.
$this->addslashes($this->titel_english).');';
}
else
{
//Updaten des bestehenden Datensatzes
//Pruefen ob projekt_kurzbz eine gueltige Zahl ist
if(!is_numeric($this->projekt_kurzbz))
{
$this->errormsg = 'projekt_kurzbz muss eine gueltige Zahl sein';
return false;
}
$qry='UPDATE lehre.tbl_projektarbeit SET '.
'projekttyp_kurzbz='.$this->addslashes($this->projekttyp_kurzbz).', '.
'titel='.$this->addslashes($this->titel).', '.
'titel_english='.$this->addslashes($this->titel_english).', '.
'lehreinheit_id='.$this->addslashes($this->lehreinheit_id).', '.
'student_uid='.$this->addslashes($this->student_uid).', '.
'firma_id='.$this->addslashes($this->firma_id).', '.
'note='.$this->addslashes($this->note).', '.
'punkte='.$this->addslashes($this->punkte).', '.
'beginn='.$this->addslashes($this->beginn).', '.
'ende='.$this->addslashes($this->ende).', '.
'faktor='.$this->addslashes($this->faktor).', '.
'freigegeben='.($this->freigegeben?'true':'false').', '.
'gesperrtbis='.$this->addslashes($this->gesperrtbis).', '.
'stundensatz='.$this->addslashes($this->stundensatz).', '.
'gesamtstunden='.$this->addslashes($this->gesamtstunden).', '.
'themenbereich='.$this->addslashes($this->themenbereich).', '.
'anmerkung='.$this->addslashes($this->anmerkung).', '.
'updateamum= now(), '.
'updatevon='.$this->addslashes($this->updatevon).' '.
'WHERE projekt_kurzbz='.$this->addslashes($this->projekt_kurzbz).';';
}
if($this->db_query($qry))
{
if($new)
{
//Sequence auslesen
$qry = "SELECT currval('lehre.tbl_projektarbeit_projekt_kurzbz_seq') as id;";
if($this->db_query($qry))
{
if($row = $this->db_fetch_object())
{
$this->projekt_kurzbz = $row->id;
$this->db_query('COMMIT');
return true;
}
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 false;
}
}
/**
* Loescht den Datenensatz mit der ID die uebergeben wird
* @param $projekt_kurzbz ID die geloescht werden soll
* @return true wenn ok, false im Fehlerfall
*/
public function delete($projekt_kurzbz)
{
if(!is_numeric($projekt_kurzbz))
{
$this->errormsg = 'Projektarbeit_id ist ungueltig';
return true;
}
$qry = "DELETE FROM lehre.tbl_projektarbeit WHERE projekt_kurzbz='$projekt_kurzbz'";
if($this->db_query($qry))
{
return true;
}
else
{
$this->errormsg = 'Fehler beim Loeschen des Datensatzes';
return false;
}
}
/**
* Laedt alle Projektarbeiten eines Studenten
* @param student_uid
* @return true wenn ok, false wenn Fehler
*/
public function getProjektarbeit($student_uid)
{
$qry = "SELECT * FROM lehre.tbl_projektarbeit WHERE student_uid='".addslashes($student_uid)."'";
if($this->db_query($qry))
{
while($row = $this->db_fetch_object())
{
$obj = new projektarbeit();
$obj->projekt_kurzbz = $row->projekt_kurzbz;
$obj->projekttyp_kurzbz = $row->projekttyp_kurzbz;
$obj->titel = $row->titel;
$obj->titel_english = $row->titel_english;
$obj->lehreinheit_id = $row->lehreinheit_id;
$obj->student_uid = $row->student_uid;
$obj->firma_id = $row->firma_id;
$obj->note = $row->note;
$obj->punkte = $row->punkte;
$obj->beginn = $row->beginn;
$obj->ende = $row->ende;
$obj->faktor = $row->faktor;
$obj->freigegeben = ($row->freigegeben=='t'?true:false);
$obj->gesperrtbis = $row->gesperrtbis;
$obj->stundensatz = $row->stundensatz;
$obj->gesamtstunden = $row->gesamtstunden;
$obj->themenbereich = $row->themenbereich;
$obj->anmerkung = $row->anmerkung;
$obj->ext_id = $row->ext_id;
$obj->insertamum = $row->insertamum;
$obj->insertvon = $row->insertvon;
$obj->updateamum = $row->updateamum;
$obj->updatevon = $row->updatevon;
$this->result[] = $obj;
}
return true;
}
else
{
$this->errormsg = 'Fehler beim Laden der Daten';
return false;
}
}
/**
* Laedt alle Projektarbeiten eines Studienganges/Studiensemesters
* @param studiengang_kz, studiensemester_kurzbz
* @return true wenn ok, false wenn Fehler
*/
public function getProjektarbeitStudiensemester($studiengang_kz, $studiensemester_kurzbz)
{
$qry = "SELECT
tbl_projektarbeit.*
FROM
lehre.tbl_projektarbeit, lehre.tbl_lehreinheit, lehre.tbl_lehrveranstaltung
WHERE
tbl_projektarbeit.lehreinheit_id=tbl_lehreinheit.lehreinheit_id AND
tbl_lehreinheit.lehrveranstaltung_id = tbl_lehrveranstaltung.lehrveranstaltung_id AND
tbl_lehrveranstaltung.studiengang_kz='".addslashes($studiengang_kz)."' AND
tbl_lehreinheit.studiensemester_kurzbz='".addslashes($studiensemester_kurzbz)."'";
if($this->db_query($qry))
{
while($row = $this->db_fetch_object())
{
$obj = new projektarbeit();
$obj->projekt_kurzbz = $row->projekt_kurzbz;
$obj->projekttyp_kurzbz = $row->projekttyp_kurzbz;
$obj->titel = $row->titel;
$obj->titel_english = $row->titel_english;
$obj->lehreinheit_id = $row->lehreinheit_id;
$obj->student_uid = $row->student_uid;
$obj->firma_id = $row->firma_id;
$obj->note = $row->note;
$obj->punkte = $row->punkte;
$obj->beginn = $row->beginn;
$obj->ende = $row->ende;
$obj->faktor = $row->faktor;
$obj->freigegeben = ($row->freigegeben=='t'?true:false);
$obj->gesperrtbis = $row->gesperrtbis;
$obj->stundensatz = $row->stundensatz;
$obj->gesamtstunden = $row->gesamtstunden;
$obj->themenbereich = $row->themenbereich;
$obj->anmerkung = $row->anmerkung;
$obj->ext_id = $row->ext_id;
$obj->insertamum = $row->insertamum;
$obj->insertvon = $row->insertvon;
$obj->updateamum = $row->updateamum;
$obj->updatevon = $row->updatevon;
$this->result[] = $obj;
}
return true;
}
else
{
$this->errormsg = 'Fehler beim Laden der Daten';
return false;
}
}
}
?>
+483
View File
@@ -0,0 +1,483 @@
<?php
/* Copyright (C) 2007 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>
*/
/**
* Klasse projekttask
* @create 2011-05-23
*/
require_once(dirname(__FILE__).'/basis_db.class.php');
class projekttask extends basis_db
{
public $new; // boolean
public $result = array(); // adresse Objekt
//Tabellenspalten
public $projekttask_id; //integer
public $projektphase_id; //integer
public $bezeichnung; //string
public $beschreibung; //string
public $aufwand; //string
public $mantis_id; // integer
//public $beginn; //date
//public $ende; //date
public $insertamum; // timestamp
public $insertvon; // bigint
public $updateamum; // timestamp
public $updatevon; // bigint
/**
* Konstruktor
* @param $projekt_kurzbz ID der Projektarbeit, die geladen werden soll (Default=null)
*/
public function __construct($projekttask_id=null)
{
parent::__construct();
if($projekttask_id != null)
$this->load($projekttask_id);
}
/**
* Laedt die Projektarbeit mit der ID $projekt_kurzbz
* @param $projekt_kurzbz ID der zu ladenden Projektarbeit
* @return true wenn ok, false im Fehlerfall
*/
public function load($projekttask_id)
{
if(!is_numeric($projekttask_id))
{
$this->errormsg = 'Projektarbeit_id muss eine gueltige Zahl sein';
return false;
}
$qry = "SELECT * FROM fue.tbl_projekttask WHERE projekttask_id='$projekttask_id'";
if($this->db_query($qry))
{
if($row = $this->db_fetch_object())
{
$this->projekt_kurzbz = $row->projekt_kurzbz;
$this->projekttyp_kurzbz = $row->projekttyp_kurzbz;
$this->titel = $row->titel;
$this->titel_english = $row->titel_english;
$this->lehreinheit_id = $row->lehreinheit_id;
$this->student_uid = $row->student_uid;
$this->firma_id = $row->firma_id;
$this->note = $row->note;
$this->punkte = $row->punkte;
$this->beginn = $row->beginn;
$this->ende = $row->ende;
$this->faktor = $row->faktor;
$this->freigegeben = ($row->freigegeben=='t'?true:false);
$this->gesperrtbis = $row->gesperrtbis;
$this->stundensatz = $row->stundensatz;
$this->gesamtstunden = $row->gesamtstunden;
$this->themenbereich = $row->themenbereich;
$this->anmerkung = $row->anmerkung;
$this->ext_id = $row->ext_id;
$this->insertamum = $row->insertamum;
$this->insertvon = $row->insertvon;
$this->updateamum = $row->updateamum;
$this->updatevon = $row->updatevon;
return true;
}
else
{
$this->errormsg = 'Datensatz wurde nicht gefunden';
return false;
}
}
else
{
$this->errormsg = 'Fehler beim Laden der Daten';
return false;
}
}
/**
* Laedt die Projektarbeit mit der ID $projekt_kurzbz
* @param $projektphase_id ID der Projektphase, wenn null greift $projekt_kurzbz
* @param $projekt_kurzbz ID des Projekts wenn keine Projektphase angegeben
* @return true wenn ok, false im Fehlerfall
*/
public function getProjekttasks($projektphase_id,$projekt_kurzbz=null)
{
if (!is_null($projektphase_id))
$qry = 'SELECT * FROM fue.tbl_projekttask WHERE projektphase_id='.$projektphase_id.';';
else
$qry='';
if($this->db_query($qry))
{
while($row = $this->db_fetch_object())
{
$obj = new projekttask();
$obj->projekttask_id = $row->projekttask_id;
$obj->projektphase_id = $row->projektphase_id;
$obj->bezeichnung = $row->bezeichnung;
$obj->beschreibung = $row->beschreibung;
$obj->aufwand = $row->aufwand;
$obj->mantis_id = $row->mantis_id;
//$obj->beginn = $row->beginn;
//$obj->ende = $row->ende;
$obj->insertamum = $row->insertamum;
$obj->insertvon = $row->insertvon;
$obj->updateamum = $row->updateamum;
$obj->updatevon = $row->updatevon;
$this->result[] = $obj;
}
return true;
}
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()
{
//Gesamtlaenge pruefen
if ($this->projekttyp_kurzbz==null)
{
$this->errormsg='Projekttyp_kurzbz darf nicht NULL sein!';
}
if ($this->lehreinheit_id==null)
{
$this->errormsg='Lehreinheit_id darf nicht NULL sein!';
}
if(mb_strlen($this->projekttyp_kurzbz)>16)
{
$this->errormsg = 'Projektyp_kurzbz darf nicht länger als 16 Zeichen sein';
return false;
}
if(mb_strlen($this->titel)>1024)
{
$this->errormsg = 'Titel darf nicht länger als 1024 Zeichen sein';
return false;
}
if(mb_strlen($this->titel_english)>1024)
{
$this->errormsg = 'Titel darf nicht länger als 1024 Zeichen sein';
return false;
}
if(mb_strlen($this->themenbereich)>64)
{
$this->errormsg = 'Themenbereich darf nicht länger als 64 Zeichen sein';
return false;
}
if(mb_strlen($this->anmerkung)>256)
{
$this->errormsg = 'Anmerkung darf nicht länger als 256 Zeichen sein';
return false;
}
/*if(!is_numeric($this->note))
{
$this->errormsg = 'Note muß ein numerischer Wert sein - student_uid: '.$this->student_uid;
return false;
}*/
if($this->punkte!='' && !is_numeric($this->punkte))
{
$this->errormsg = 'Punkte muss ein numerischer Wert sein';
return false;
}
if($this->faktor!='' && !is_numeric($this->faktor))
{
$this->errormsg = 'Faktor muss ein numerischer Wert sein';
return false;
}
if($this->stundensatz!='' && !is_numeric($this->stundensatz))
{
$this->errormsg = 'Stundensatz muss ein numerischer Wert sein';
return false;
}
if($this->gesamtstunden!='' && !is_numeric($this->gesamtstunden))
{
$this->errormsg = 'Gesamtstunden muss ein numerischer Wert sein';
return false;
}
if(!is_bool($this->freigegeben))
{
$this->errormsg = 'freigegeben ist ungueltig';
return false;
}
$this->errormsg = '';
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 $projekt_kurzbz aktualisiert
* @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 lehre.tbl_projektarbeit (projekttyp_kurzbz, titel, lehreinheit_id, student_uid, firma_id, note, punkte,
beginn, ende, faktor, freigegeben, gesperrtbis, stundensatz, gesamtstunden, themenbereich, anmerkung,
ext_id, insertamum, insertvon, updateamum, updatevon, titel_english) VALUES('.
$this->addslashes($this->projekttyp_kurzbz).', '.
$this->addslashes($this->titel).', '.
$this->addslashes($this->lehreinheit_id).', '.
$this->addslashes($this->student_uid).', '.
$this->addslashes($this->firma_id).', '.
$this->addslashes($this->note).', '.
$this->addslashes($this->punkte).', '.
$this->addslashes($this->beginn).', '.
$this->addslashes($this->ende).', '.
$this->addslashes($this->faktor).', '.
($this->freigegeben?'true':'false').', '.
$this->addslashes($this->gesperrtbis).', '.
$this->addslashes($this->stundensatz).', '.
$this->addslashes($this->gesamtstunden).', '.
$this->addslashes($this->themenbereich).', '.
$this->addslashes($this->anmerkung).', '.
$this->addslashes($this->ext_id).', now(), '.
$this->addslashes($this->insertvon).', now(), '.
$this->addslashes($this->updatevon).','.
$this->addslashes($this->titel_english).');';
}
else
{
//Updaten des bestehenden Datensatzes
//Pruefen ob projekt_kurzbz eine gueltige Zahl ist
if(!is_numeric($this->projekt_kurzbz))
{
$this->errormsg = 'projekt_kurzbz muss eine gueltige Zahl sein';
return false;
}
$qry='UPDATE lehre.tbl_projektarbeit SET '.
'projekttyp_kurzbz='.$this->addslashes($this->projekttyp_kurzbz).', '.
'titel='.$this->addslashes($this->titel).', '.
'titel_english='.$this->addslashes($this->titel_english).', '.
'lehreinheit_id='.$this->addslashes($this->lehreinheit_id).', '.
'student_uid='.$this->addslashes($this->student_uid).', '.
'firma_id='.$this->addslashes($this->firma_id).', '.
'note='.$this->addslashes($this->note).', '.
'punkte='.$this->addslashes($this->punkte).', '.
'beginn='.$this->addslashes($this->beginn).', '.
'ende='.$this->addslashes($this->ende).', '.
'faktor='.$this->addslashes($this->faktor).', '.
'freigegeben='.($this->freigegeben?'true':'false').', '.
'gesperrtbis='.$this->addslashes($this->gesperrtbis).', '.
'stundensatz='.$this->addslashes($this->stundensatz).', '.
'gesamtstunden='.$this->addslashes($this->gesamtstunden).', '.
'themenbereich='.$this->addslashes($this->themenbereich).', '.
'anmerkung='.$this->addslashes($this->anmerkung).', '.
'updateamum= now(), '.
'updatevon='.$this->addslashes($this->updatevon).' '.
'WHERE projekt_kurzbz='.$this->addslashes($this->projekt_kurzbz).';';
}
if($this->db_query($qry))
{
if($new)
{
//Sequence auslesen
$qry = "SELECT currval('lehre.tbl_projektarbeit_projekt_kurzbz_seq') as id;";
if($this->db_query($qry))
{
if($row = $this->db_fetch_object())
{
$this->projekt_kurzbz = $row->id;
$this->db_query('COMMIT');
return true;
}
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 false;
}
}
/**
* Loescht den Datenensatz mit der ID die uebergeben wird
* @param $projekt_kurzbz ID die geloescht werden soll
* @return true wenn ok, false im Fehlerfall
*/
public function delete($projekt_kurzbz)
{
if(!is_numeric($projekt_kurzbz))
{
$this->errormsg = 'Projektarbeit_id ist ungueltig';
return true;
}
$qry = "DELETE FROM lehre.tbl_projektarbeit WHERE projekt_kurzbz='$projekt_kurzbz'";
if($this->db_query($qry))
{
return true;
}
else
{
$this->errormsg = 'Fehler beim Loeschen des Datensatzes';
return false;
}
}
/**
* Laedt alle Projektarbeiten eines Studenten
* @param student_uid
* @return true wenn ok, false wenn Fehler
*/
public function getProjektarbeit($student_uid)
{
$qry = "SELECT * FROM lehre.tbl_projektarbeit WHERE student_uid='".addslashes($student_uid)."'";
if($this->db_query($qry))
{
while($row = $this->db_fetch_object())
{
$obj = new projektarbeit();
$obj->projekt_kurzbz = $row->projekt_kurzbz;
$obj->projekttyp_kurzbz = $row->projekttyp_kurzbz;
$obj->titel = $row->titel;
$obj->titel_english = $row->titel_english;
$obj->lehreinheit_id = $row->lehreinheit_id;
$obj->student_uid = $row->student_uid;
$obj->firma_id = $row->firma_id;
$obj->note = $row->note;
$obj->punkte = $row->punkte;
$obj->beginn = $row->beginn;
$obj->ende = $row->ende;
$obj->faktor = $row->faktor;
$obj->freigegeben = ($row->freigegeben=='t'?true:false);
$obj->gesperrtbis = $row->gesperrtbis;
$obj->stundensatz = $row->stundensatz;
$obj->gesamtstunden = $row->gesamtstunden;
$obj->themenbereich = $row->themenbereich;
$obj->anmerkung = $row->anmerkung;
$obj->ext_id = $row->ext_id;
$obj->insertamum = $row->insertamum;
$obj->insertvon = $row->insertvon;
$obj->updateamum = $row->updateamum;
$obj->updatevon = $row->updatevon;
$this->result[] = $obj;
}
return true;
}
else
{
$this->errormsg = 'Fehler beim Laden der Daten';
return false;
}
}
/**
* Laedt alle Projektarbeiten eines Studienganges/Studiensemesters
* @param studiengang_kz, studiensemester_kurzbz
* @return true wenn ok, false wenn Fehler
*/
public function getProjektarbeitStudiensemester($studiengang_kz, $studiensemester_kurzbz)
{
$qry = "SELECT
tbl_projektarbeit.*
FROM
lehre.tbl_projektarbeit, lehre.tbl_lehreinheit, lehre.tbl_lehrveranstaltung
WHERE
tbl_projektarbeit.lehreinheit_id=tbl_lehreinheit.lehreinheit_id AND
tbl_lehreinheit.lehrveranstaltung_id = tbl_lehrveranstaltung.lehrveranstaltung_id AND
tbl_lehrveranstaltung.studiengang_kz='".addslashes($studiengang_kz)."' AND
tbl_lehreinheit.studiensemester_kurzbz='".addslashes($studiensemester_kurzbz)."'";
if($this->db_query($qry))
{
while($row = $this->db_fetch_object())
{
$obj = new projektarbeit();
$obj->projekt_kurzbz = $row->projekt_kurzbz;
$obj->projekttyp_kurzbz = $row->projekttyp_kurzbz;
$obj->titel = $row->titel;
$obj->titel_english = $row->titel_english;
$obj->lehreinheit_id = $row->lehreinheit_id;
$obj->student_uid = $row->student_uid;
$obj->firma_id = $row->firma_id;
$obj->note = $row->note;
$obj->punkte = $row->punkte;
$obj->beginn = $row->beginn;
$obj->ende = $row->ende;
$obj->faktor = $row->faktor;
$obj->freigegeben = ($row->freigegeben=='t'?true:false);
$obj->gesperrtbis = $row->gesperrtbis;
$obj->stundensatz = $row->stundensatz;
$obj->gesamtstunden = $row->gesamtstunden;
$obj->themenbereich = $row->themenbereich;
$obj->anmerkung = $row->anmerkung;
$obj->ext_id = $row->ext_id;
$obj->insertamum = $row->insertamum;
$obj->insertvon = $row->insertvon;
$obj->updateamum = $row->updateamum;
$obj->updatevon = $row->updatevon;
$this->result[] = $obj;
}
return true;
}
else
{
$this->errormsg = 'Fehler beim Laden der Daten';
return false;
}
}
}
?>
+86
View File
@@ -0,0 +1,86 @@
<!ENTITY window.title "Planner">
<!ENTITY window.version "0.1 vom 12.April.2011">
<!ENTITY menu-file.label "Datei">
<!ENTITY menu-file.accesskey "D">
<!ENTITY menu-file-close.key "D">
<!ENTITY menu-file-close.label "Beenden">
<!ENTITY menu-file-close.accesskey "B">
<!ENTITY menu-help.label "Hilfe">
<!ENTITY menu-help.accesskey "H">
<!ENTITY menu-help-close.key "H">
<!ENTITY menu-help-close.label "Ueber">
<!ENTITY menu-help-close.accesskey "U">
<!ENTITY menu-edit.label "Bearbeiten">
<!ENTITY menu-edit.accesskey "B">
<!ENTITY menu-edit-undo.key "">
<!ENTITY menu-edit-undo.label "Undo">
<!ENTITY menu-edit-undo.accesskey "">
<!ENTITY menu-prefs.label "Einstellungen">
<!ENTITY menu-prefs.accesskey "E">
<!ENTITY menu-prefs-stpltable.label "Stpl-Tabelle">
<!ENTITY menu-prefs-stpltable.accesskey "T">
<!ENTITY menu-prefs-stpltable-stundenplan.key "s">
<!ENTITY menu-prefs-stpltable-stundenplan.label "stundenplan">
<!ENTITY menu-prefs-stpltable-stundenplan.accesskey "s">
<!ENTITY menu-prefs-stpltable-stundenplandev.key "d">
<!ENTITY menu-prefs-stpltable-stundenplandev.label "stundenplandev">
<!ENTITY menu-prefs-stpltable-stundenplandev.accesskey "d">
<!ENTITY menu-prefs-ignore_reservierung.key "r">
<!ENTITY menu-prefs-ignore_reservierung.label "ignore_reservierung">
<!ENTITY menu-prefs-ignore_reservierung.accesskey "r">
<!ENTITY menu-prefs-ignore_zeitsperre.key "z">
<!ENTITY menu-prefs-ignore_zeitsperre.label "ignore_zeitsperre">
<!ENTITY menu-prefs-ignore_zeitsperre.accesskey "z">
<!ENTITY menu-prefs-ignore_kollision.key "k">
<!ENTITY menu-prefs-ignore_kollision.label "ignore_kollision">
<!ENTITY menu-prefs-ignore_kollision.accesskey "k">
<!ENTITY menu-prefs-kollision_student.key "s">
<!ENTITY menu-prefs-kollision_student.label "kollision_student">
<!ENTITY menu-prefs-kollision_student.accesskey "s">
<!ENTITY menu-prefs-max_kollision.key "m">
<!ENTITY menu-prefs-max_kollision.label "max_kollision">
<!ENTITY menu-prefs-max_kollision.accesskey "m">
<!ENTITY menu-help-about.key "U">
<!ENTITY menu-help-about.label "Über FHComplete">
<!ENTITY menu-help-about.accesskey "U">
<!ENTITY menu-help-todo.key "T">
<!ENTITY menu-help-todo.label "ToDo">
<!ENTITY menu-help-todo.accesskey "T">
<!ENTITY menu-help-manual.key "H">
<!ENTITY menu-help-manual.label "Handbuch">
<!ENTITY menu-help-manual.accesskey "H">
<!ENTITY menu-extras.label "Extras">
<!ENTITY menu-extras.accesskey "E">
<!ENTITY menu-extras-kollisionstudent.key "K">
<!ENTITY menu-extras-kollisionstudent.label "Kollision Student">
<!ENTITY menu-extras-kollisionstudent.accesskey "K">
<!ENTITY menu-extras-lvplanwartung.key "W">
<!ENTITY menu-extras-lvplanwartung.label "LVPlan Wartung">
<!ENTITY menu-extras-lvplanwartung.accesskey "W">
<!ENTITY menu-extras-rescheck.key "R">
<!ENTITY menu-extras-rescheck.label "Kollisionspruefung mit Reservierungen">
<!ENTITY menu-extras-rescheck.accesskey "R">
+89
View File
@@ -0,0 +1,89 @@
<?php
/* Copyright (C) 2009 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>
*/
header("Content-type: application/xhtml+xml");
echo '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>';
require_once('../config/vilesci.config.inc.php');
require_once('../include/functions.inc.php');
require_once('../include/benutzerberechtigung.class.php');
require_once('../include/projekt.class.php');
$rdf_url='http://www.technikum-wien.at/projekt/';
$projekt_obj = new projekt();
$projekt_obj->getProjekte();
//var_dump($projekt_obj);
?>
<RDF:RDF
xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:PROJEKT="<?php echo $rdf_url; ?>rdf#"
>
<?php
$descr='';
$sequenz='';
$lastOE=null;
for ($i=0;$i<count($projekt_obj->result);$i++)
{
$currentOE=$projekt_obj->result[$i]->oe_kurzbz;
//echo $currentOE;
$nextOE=(($i<count($projekt_obj->result)-1)?$projekt_obj->result[$i+1]->oe_kurzbz:null);
//echo $nextOE;
$projekt=$projekt_obj->result[$i];
// Bin ich schon in der naechsten OE? Oder vielleicht in der ersten?
if ($lastOE!=$currentOE || $i==0)
$descr.='<RDF:Description RDF:about="'.$rdf_url.$projekt->oe_kurzbz.'" >
<PROJEKT:bezeichnung>'.$projekt->oe_kurzbz.'</PROJEKT:bezeichnung>
<PROJEKT:oe_kurzbz>'.$projekt->oe_kurzbz.'</PROJEKT:oe_kurzbz>
<PROJEKT:projekt_kurzbz></PROJEKT:projekt_kurzbz>
<PROJEKT:nummer></PROJEKT:nummer>
<PROJEKT:titel></PROJEKT:titel>
<PROJEKT:beschreibung></PROJEKT:beschreibung>
<PROJEKT:beginn></PROJEKT:beginn>
<PROJEKT:ende></PROJEKT:ende>
</RDF:Description>'."\n";
$descr.='<RDF:Description RDF:about="'.$rdf_url.$projekt->oe_kurzbz.'/'.$projekt->projekt_kurzbz.'" >
<PROJEKT:bezeichnung>'.$projekt->titel.'</PROJEKT:bezeichnung>
<PROJEKT:oe_kurzbz></PROJEKT:oe_kurzbz>
<PROJEKT:projekt_kurzbz>'.$projekt->projekt_kurzbz.'</PROJEKT:projekt_kurzbz>
<PROJEKT:nummer>'.$projekt->nummer.'</PROJEKT:nummer>
<PROJEKT:titel>'.$projekt->titel.'</PROJEKT:titel>
<PROJEKT:beschreibung>'.$projekt->beschreibung.'</PROJEKT:beschreibung>
<PROJEKT:beginn>'.$projekt->beginn.'</PROJEKT:beginn>
<PROJEKT:ende>'.$projekt->ende.'</PROJEKT:ende>
</RDF:Description>'."\n";
if ($lastOE!=$currentOE)
$sequenz.='<RDF:li RDF:resource="'.$rdf_url.$projekt->oe_kurzbz.'" />
<RDF:li>
<RDF:Seq RDF:about="'.$rdf_url.$projekt->oe_kurzbz.'" >'."\n";
if ($nextOE!=$currentOE || $i==count($projekt_obj->result)-1)
$sequenz.='<RDF:li RDF:resource="'.$rdf_url.$projekt->oe_kurzbz.'/'.$projekt->projekt_kurzbz.'" />
</RDF:Seq>
</RDF:li>'."\n";
elseif ($lastOE==$currentOE || $nextOE==$currentOE || count($projekt_obj->result)==1)
$sequenz.='<RDF:li RDF:resource="'.$rdf_url.$projekt->oe_kurzbz.'/'.$projekt->projekt_kurzbz.'" />'."\n";
$lastOE=$currentOE;
}
$sequenz='<RDF:Seq about="'.$rdf_url.'alle-projekte">'."\n\t".$sequenz.'
</RDF:Seq>'."\n";
echo $descr."\n";
echo $sequenz;
?>
</RDF:RDF>
+165
View File
@@ -0,0 +1,165 @@
<?php
/* Copyright (C) 2009 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>
*/
header("Content-type: application/xhtml+xml");
echo '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>';
require_once('../config/vilesci.config.inc.php');
require_once('../include/functions.inc.php');
require_once('../include/benutzerberechtigung.class.php');
require_once('../include/projekt.class.php');
require_once('../include/projektphase.class.php');
$rdf_url='http://www.technikum-wien.at/projektphase/';
$projekt_obj = new projekt();
$projekt_obj->getProjekte();
$projektphase_obj = new projektphase();
$sequenzProjektphase = array();
//var_dump($projekt_obj);
?>
<RDF:RDF
xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:PROJEKTPHASE="<?php echo $rdf_url; ?>rdf#"
>
<?php
$descr='';
$sequenz='';
$lastOE=null;
for ($i=0;$i<count($projekt_obj->result);$i++)
{
$currentOE=$projekt_obj->result[$i]->oe_kurzbz;
//echo $currentOE;
$nextOE=(($i<count($projekt_obj->result)-1)?$projekt_obj->result[$i+1]->oe_kurzbz:null);
//echo $nextOE;
$projekt=$projekt_obj->result[$i];
// Bin ich schon in der naechsten OE? Oder vielleicht in der ersten?
if ($lastOE!=$currentOE || $i==0)
$descr.='<RDF:Description RDF:about="'.$rdf_url.$projekt->oe_kurzbz.'" >
<PROJEKTPHASE:bezeichnung>'.$projekt->oe_kurzbz.'</PROJEKTPHASE:bezeichnung>
<PROJEKTPHASE:oe_kurzbz>'.$projekt->oe_kurzbz.'</PROJEKTPHASE:oe_kurzbz>
<PROJEKTPHASE:projekt_kurzbz></PROJEKTPHASE:projekt_kurzbz>
<PROJEKTPHASE:projekt_phase></PROJEKTPHASE:projekt_phase>
<PROJEKTPHASE:projekt_phase_id></PROJEKTPHASE:projekt_phase_id>
<PROJEKTPHASE:nummer></PROJEKTPHASE:nummer>
<PROJEKTPHASE:titel></PROJEKTPHASE:titel>
<PROJEKTPHASE:beschreibung></PROJEKTPHASE:beschreibung>
<PROJEKTPHASE:beginn></PROJEKTPHASE:beginn>
<PROJEKTPHASE:ende></PROJEKTPHASE:ende>
</RDF:Description>'."\n";
$descr.='<RDF:Description RDF:about="'.$rdf_url.$projekt->oe_kurzbz.'/'.$projekt->projekt_kurzbz.'" >
<PROJEKTPHASE:bezeichnung>'.$projekt->titel.'</PROJEKTPHASE:bezeichnung>
<PROJEKTPHASE:oe_kurzbz></PROJEKTPHASE:oe_kurzbz>
<PROJEKTPHASE:projekt_kurzbz>'.$projekt->projekt_kurzbz.'</PROJEKTPHASE:projekt_kurzbz>
<PROJEKTPHASE:projekt_phase></PROJEKTPHASE:projekt_phase>
<PROJEKTPHASE:projekt_phase_id></PROJEKTPHASE:projekt_phase_id>
<PROJEKTPHASE:nummer>'.$projekt->nummer.'</PROJEKTPHASE:nummer>
<PROJEKTPHASE:titel>'.$projekt->titel.'</PROJEKTPHASE:titel>
<PROJEKTPHASE:beschreibung>'.$projekt->beschreibung.'</PROJEKTPHASE:beschreibung>
<PROJEKTPHASE:beginn>'.$projekt->beginn.'</PROJEKTPHASE:beginn>
<PROJEKTPHASE:ende>'.$projekt->ende.'</PROJEKTPHASE:ende>
</RDF:Description>'."\n";
$projektphase_obj->getProjektphasen($projekt->projekt_kurzbz);
$tmpStr='';
for ($j=0;$j<count($projektphase_obj->result);$j++)
{
$projektphase=$projektphase_obj->result[$j];
//var_dump($projektphase);
$descr.='<RDF:Description RDF:about="'.$rdf_url.$projekt->oe_kurzbz.'/'.$projekt->projekt_kurzbz.'/'.$projektphase->projektphase_id.'" >
<PROJEKTPHASE:bezeichnung>'.$projektphase->bezeichnung.'</PROJEKTPHASE:bezeichnung>
<PROJEKTPHASE:oe_kurzbz></PROJEKTPHASE:oe_kurzbz>
<PROJEKTPHASE:projekt_kurzbz>'.$projektphase->projekt_kurzbz.'</PROJEKTPHASE:projekt_kurzbz>
<PROJEKTPHASE:projekt_phase>'.$projektphase->bezeichnung.'</PROJEKTPHASE:projekt_phase>
<PROJEKTPHASE:projekt_phase_id>'.$projektphase->projektphase_id.'</PROJEKTPHASE:projekt_phase_id>
<PROJEKTPHASE:nummer></PROJEKTPHASE:nummer>
<PROJEKTPHASE:titel>'.$projektphase->bezeichnung.'</PROJEKTPHASE:titel>
<PROJEKTPHASE:beschreibung>'.$projektphase->beschreibung.'</PROJEKTPHASE:beschreibung>
<PROJEKTPHASE:beginn>'.$projektphase->start.'</PROJEKTPHASE:beginn>
<PROJEKTPHASE:ende>'.$projektphase->ende.'</PROJEKTPHASE:ende>
<PROJEKTPHASE:ende>'.$projektphase->ende.'</PROJEKTPHASE:ende>'."\n";
$descr.='</RDF:Description>'."\n";
if (is_null($projektphase->projektphase_fk))
{
if ($j==0)
$tmpStr=' <RDF:li>
<RDF:Seq RDF:about="'.$rdf_url.$projekt->oe_kurzbz.'/'.$projekt->projekt_kurzbz.'">'."\n";
$tmpStr.=' <RDF:li RDF:resource="'.$rdf_url.$projekt->oe_kurzbz.'/'.$projekt->projekt_kurzbz.'/'.$projektphase->projektphase_id.'" />'."\n";
$tmpStr.=check_subprojektphasen(&$projekt,&$projektphase_obj,$projektphase->projektphase_id);
if ($j==count($projektphase_obj->result)-1)
$tmpStr.=' </RDF:Seq>
</RDF:li>'."\n";
$sequenzProjektphase[$projekt->projekt_kurzbz]=$tmpStr;
}
}
//var_dump($sequenzProjektphase);
if ($lastOE!=$currentOE)
{
$sequenz.=' <RDF:li RDF:resource="'.$rdf_url.$projekt->oe_kurzbz.'" />
<RDF:li>
<RDF:Seq RDF:about="'.$rdf_url.$projekt->oe_kurzbz.'" >'."\n";
}
// Neue OE oder letzter Datensatz? Dann muss Sequenz geschlossen werden.
if ($nextOE!=$currentOE || $i==count($projekt_obj->result)-1)
{
$sequenz.=' <RDF:li RDF:resource="'.$rdf_url.$projekt->oe_kurzbz.'/'.$projekt->projekt_kurzbz.'" />'."\n";
if (isset($sequenzProjektphase[$projekt->projekt_kurzbz]))
$sequenz.=$sequenzProjektphase[$projekt->projekt_kurzbz];
$sequenz.=' </RDF:Seq>
</RDF:li>'."\n";
}
elseif ($lastOE==$currentOE || $nextOE==$currentOE || count($projekt_obj->result)==1)
{
$sequenz.='<RDF:li RDF:resource="'.$rdf_url.$projekt->oe_kurzbz.'/'.$projekt->projekt_kurzbz.'" />'."\n";
if (isset($sequenzProjektphase[$projekt->projekt_kurzbz]))
$sequenz.=$sequenzProjektphase[$projekt->projekt_kurzbz];
}
$lastOE=$currentOE;
}
$sequenz='<RDF:Seq about="'.$rdf_url.'alle-projektphasen">'."\n\t".$sequenz.'
</RDF:Seq>'."\n";
echo $descr."\n";
echo $sequenz;
function check_subprojektphasen($projekt,$projektphase_obj,$projektphase_id)
{
global $rdf_url;
$tmpStr='';
$i=0;
for ($j=0;$j<count($projektphase_obj->result);$j++)
{
$projektphase=$projektphase_obj->result[$j];
if ($projektphase->projektphase_fk==$projektphase_id)
{
//var_dump($projektphase);
if ($i==0)
$tmpStr=' <RDF:li>
<RDF:Seq RDF:about="'.$rdf_url.$projekt->oe_kurzbz.'/'.$projekt->projekt_kurzbz.'/'.$projektphase_id.'">'."\n";
$tmpStr.=' <RDF:li RDF:resource="'.$rdf_url.$projekt->oe_kurzbz.'/'.$projekt->projekt_kurzbz.'/'.$projektphase->projektphase_id.'" />'."\n";
$i++;
}
}
if ($i>0)
$tmpStr.=' </RDF:Seq>
</RDF:li>'."\n";
return $tmpStr;
}
?>
</RDF:RDF>
+84
View File
@@ -0,0 +1,84 @@
<?php
/* Copyright (C) 2009 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>
*/
header("Content-type: application/xhtml+xml");
echo '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>';
require_once('../config/vilesci.config.inc.php');
require_once('../include/functions.inc.php');
require_once('../include/benutzerberechtigung.class.php');
require_once('../include/projekttask.class.php');
$rdf_url='http://www.technikum-wien.at/projekttask/';
$projektphase_id=4; //zum Testen, ansonsten null
if (isset($_GET['projektphase_id']))
$projektphase_id=$_GET['projektphase_id'];
$projekttask_obj = new projekttask();
$projekttask_obj->getProjekttasks($projektphase_id);
//var_dump($projekttask_obj);
?>
<RDF:RDF
xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:PROJEKTTASK="<?php echo $rdf_url; ?>rdf#"
>
<?php
$descr='';
$sequenz='';
$lastPT=null;
for ($i=0;$i<count($projekttask_obj->result);$i++)
{
$projekttask=$projekttask_obj->result[$i];
$currentPT=$projekttask->projekttask_id;
$nextPT=(($i<count($projekttask_obj->result)-1)?$projekttask_obj->result[$i+1]->projekttask_id:null);
$descr.='<RDF:Description RDF:about="'.$rdf_url.$projekttask->projektphase_id.'/'.$projekttask->projekttask_id.'" >
<PROJEKTTASK:projekttask_id>'.$projekttask->projekttask_id.'</PROJEKTTASK:projekttask_id>
<PROJEKTTASK:projektphase_id>'.$projekttask->projektphase_id.'</PROJEKTTASK:projektphase_id>
<PROJEKTTASK:bezeichnung>'.$projekttask->bezeichnung.'</PROJEKTTASK:bezeichnung>
<PROJEKTTASK:beschreibung>'.$projekttask->beschreibung.'</PROJEKTTASK:beschreibung>
<PROJEKTTASK:aufwand>'.$projekttask->aufwand.'</PROJEKTTASK:aufwand>
<PROJEKTTASK:mantis_id>'.$projekttask->mantis_id.'</PROJEKTTASK:mantis_id>
</RDF:Description>'."\n";
if ($lastPT!=$currentPT)
$sequenz.=' <RDF:li RDF:resource="'.$rdf_url.$projekttask->projektphase_id.'/'.$projekttask->projekttask_id.'" />
<RDF:li>
<RDF:Seq RDF:about="'.$rdf_url.$projekttask->projektphase_id.'/'.$projekttask->projekttask_id.'" >'."\n";
// Neue OE oder letzter Datensatz? Dann muss Sequenz geschlossen werden.
if ($nextPT!=$currentPT || $i==count($projekttask_obj->result)-1)
{
$sequenz.=' <RDF:li RDF:resource="'.$rdf_url.$projekttask->projektphase_id.'/'.$projekttask->projekttask_id.'" />'."\n";
$sequenz.=' </RDF:Seq>
</RDF:li>'."\n";
}
elseif ($lastPT==$currentPT || $nextPT==$currentPT || count($projekttask_obj->result)==1)
$sequenz.='<RDF:li RDF:resource="'.$rdf_url.$projekttask->projektphase_id.'/'.$projekttask->projekttask_id.'" />'."\n";
$lastPT=$currentPT;
}
$sequenz='<RDF:Seq about="'.$rdf_url.'alle-projekttasks">'."\n\t".$sequenz.'
</RDF:Seq>'."\n";
echo $descr."\n";
echo $sequenz;
?>
</RDF:RDF>