- Notizen XBL

- Dokumentenzuordnung zu Projekten
This commit is contained in:
Andreas Österreicher
2011-09-08 11:46:20 +00:00
parent 20ab17df53
commit 89c5c25da0
12 changed files with 1079 additions and 26 deletions
+1 -1
View File
@@ -104,7 +104,7 @@ $berechtigte_oe = $rechte->getOEkurzbz('basis/cms')
function openDMS()
{
window.open ("<?php echo APP_ROOT;?>cms/tinymce_dms.php","DMS","resizable=1,width=800,height=600");
window.open ("<?php echo APP_ROOT;?>cms/tinymce_dms.php","DMS","resizable=1,width=800,height=600,scrollbars=1");
}
</script>
</head>
+46 -7
View File
@@ -23,7 +23,7 @@ require_once('../config/cis.config.inc.php');
require_once('../include/functions.inc.php');
require_once('../include/dms.class.php');
$user = get_uid();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//DE"
"http://www.w3.org/TR/html4/strict.dtd">
@@ -149,13 +149,16 @@ require_once('../include/dms.class.php');
<body>
<?php
$user = get_uid();
$kategorie_kurzbz = isset($_REQUEST['kategorie_kurzbz'])?$_REQUEST['kategorie_kurzbz']:'';
$searchstring = isset($_REQUEST['searchstring'])?$_REQUEST['searchstring']:'';
$importFile = isset($_REQUEST['importFile'])?$_REQUEST['importFile']:'';
$versionId = isset($_REQUEST['versionid'])?$_REQUEST['versionid']:'';
$renameId = isset($_GET['renameid'])?$_GET['renameid']:'';
$version = isset($_GET['version'])?$_GET['version']:'';
$projekt_kurzbz = isset($_REQUEST['projekt_kurzbz'])?$_REQUEST['projekt_kurzbz']:'';
$projektphase_id = isset($_REQUEST['projektphase_id'])?$_REQUEST['projektphase_id']:'';
$openupload = isset($_GET['openupload'])?$_GET['openupload']:false;
$newVersionID = isset($_GET['newVersionID'])?$_GET['newVersionID']:false;
$suche = false;
$mimetypes = array(
@@ -196,6 +199,7 @@ if($importFile != '')
else
{
$dms->version='0';
$dms->kategorie_kurzbz=$kategorie_kurzbz;
}
$dms->insertamum=date('Y-m-d H:i:s');
@@ -203,12 +207,17 @@ if($importFile != '')
$dms->mimetype= mime_content_type(IMPORT_PATH.$importFile);
$dms->filename = $filename;
$dms->name = $importFile;
$dms->kategorie_kurzbz=$kategorie_kurzbz;
if($dms->save(true))
{
echo 'File wurde erfolgreich hochgeladen. Filename:'.$filename.' ID:'.$dms->dms_id;
$dms_id=$dms->dms_id;
if($projekt_kurzbz!='' || $projektphase_id!='')
{
if(!$dms->saveProjektzuordnung($dms_id, $projekt_kurzbz, $projektphase_id))
echo $dms->errormsg;
}
}
else
echo 'Fehler beim Speichern der Daten';
@@ -254,6 +263,7 @@ if(isset($_POST['fileupload']))
else
{
$dms->version='0';
$dms->kategorie_kurzbz=$kategorie_kurzbz;
}
$dms->insertamum=date('Y-m-d H:i:s');
@@ -261,12 +271,17 @@ if(isset($_POST['fileupload']))
$dms->mimetype=$_FILES['userfile']['type'];
$dms->filename = $filename;
$dms->name = $_FILES['userfile']['name'];
$dms->kategorie_kurzbz=$kategorie_kurzbz;
if($dms->save(true))
{
echo 'File wurde erfolgreich hochgeladen. Filename:'.$filename.' ID:'.$dms->dms_id;
$dms_id=$dms->dms_id;
if($projekt_kurzbz!='' || $projektphase_id!='')
{
if(!$dms->saveProjektzuordnung($dms_id, $projekt_kurzbz, $projektphase_id))
echo $dms->errormsg;
}
}
else
{
@@ -396,12 +411,33 @@ else
<input type="hidden" name="kategorie_kurzbz" id="kategorie_kurzbz" value="'.$kategorie_kurzbz.'">
<input type="hidden" name="dms_id" id="dms_id" value="">
<input type="file" name="userfile">
<input type="hidden" name="projekt_kurzbz" value="'.$projekt_kurzbz.'">
<input type="hidden" name="projektphase_id" value="'.$projektphase_id.'">
<input type="submit" name="fileupload" value="Upload">
</form>
<h3>Files im Import Ordner</h3>';
drawFilesFromImport();
echo'
</div>';
if($openupload)
{
echo '<script>
$(document).ready(function()
{
';
if($newVersionID!='')
{
$dms_obj = new dms();
$dms_obj->load($newVersionID);
echo 'upload("'.$newVersionID.'","'.$dms_obj->name.'");';
}
else
echo 'upload();';
echo '
});
</script>';
}
}
@@ -454,7 +490,8 @@ function drawAllVersions($id)
*/
function drawFilesFromImport()
{
global $kategorie_kurzbz;
global $kategorie_kurzbz, $projekt_kurzbz, $projektphase_id;
if ($handle = opendir(IMPORT_PATH))
{
echo '<table> <form action ="'.$_SERVER['PHP_SELF'].'" method="POST" name="import" >';
@@ -484,6 +521,8 @@ function drawFilesFromImport()
<input type="hidden" name="dms_id_import" id="dms_id_import" value="">
<input type="hidden" name="importFile" value="">
<input type="hidden" name="kategorie_kurzbz" id="kategorie_kurzbz" value="'.$kategorie_kurzbz.'">
<input type="hidden" name="projekt_kurzbz" value="'.$projekt_kurzbz.'">
<input type="hidden" name="projektphase_id" value="'.$projektphase_id.'">
</form></table>';
closedir($handle);
}
+5
View File
@@ -20,4 +20,9 @@ box.Standort
box.Firma
{
-moz-binding: url('bindings.xml.php#Firma');
}
box.Notiz
{
-moz-binding: url('notiz.xml.php#Notiz');
}
+66
View File
@@ -0,0 +1,66 @@
<?php
/* Copyright (C) 2011 FH 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: Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at>
*/
require_once('../config/vilesci.config.inc.php');
?>
// ****
// * Laedt die zu bearbeitenden Daten
// ****
function NotizInit(id)
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
if(id!='')
{
//Daten holen
var url = '<?php echo APP_ROOT ?>rdf/notiz.rdf.php?notiz_id='+id+'&'+gettimestamp();
var rdfService = Components.classes["@mozilla.org/rdf/rdf-service;1"].
getService(Components.interfaces.nsIRDFService);
var dsource = rdfService.GetDataSourceBlocking(url);
var subject = rdfService.GetResource("http://www.technikum-wien.at/notiz/" + id);
var predicateNS = "http://www.technikum-wien.at/notiz/rdf";
//RDF parsen
titel = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#titel" ));
}
else
{
//Defaultwerte bei Neuem Datensatz
titel='';
}
document.getElementById('notiz-textbox-titel').value=titel;
}
// ****
// * Speichern der Daten
// ****
function NotizSpeichern()
{
alert('Noch nicht implementiert');
}
+74
View File
@@ -0,0 +1,74 @@
<?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>.
*/
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");
include('../config/vilesci.config.inc.php');
echo '<?xml version="1.0" encoding="UTF-8"?>'."\n";
echo '<?xml-stylesheet href="'.APP_ROOT.'skin/tempus.css" type="text/css"?>';
echo '<?xml-stylesheet href="'.APP_ROOT.'content/bindings.css" type="text/css"?>';
if(isset($_GET['id']) && is_numeric($_GET['id']))
$id=$_GET['id'];
else
$id='';
?>
<window id="window-notiz" title="Notiz"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="NotizInit('<?php echo ($id!=''?$id:'');?>')"
>
<script type="application/x-javascript" src="<?php echo APP_ROOT; ?>content/notiz.window.js.php" />
<script type="application/x-javascript" src="<?php echo APP_ROOT; ?>content/functions.js.php" />
<vbox>
<textbox id="notiz-textbox-notiz_id" hidden="true"/>
<groupbox id="notiz-groupbox" flex="1">
<caption label="Details"/>
<grid id="notiz-grid-detail" style="overflow:auto;margin:4px;" flex="1">
<columns >
<column flex="1"/>
<column flex="5"/>
</columns>
<rows>
<row>
<label value="Titel" control="notiz-textbox-titel"/>
<textbox id="notiz-textbox-titel" maxlength="256"/>
</row>
</rows>
</grid>
<hbox>
<spacer flex="1" />
<button id="notiz-button-speichern" oncommand="NotizSpeichern()" label="Speichern" />
</hbox>
</groupbox>
</vbox>
</window>
+268
View File
@@ -0,0 +1,268 @@
<?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>.
*/
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"?>';
?>
<bindings xmlns="http://www.mozilla.org/xbl"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:xbl="http://www.mozilla.org/xbl"
xmlns:html="http://www.w3.org/1999/xhtml"
>
<!--
Binding fuer die Notizen
-->
<binding id="Notiz">
<content>
<xul:vbox flex="1">
<xul:popupset>
<xul:popup anonid="notiz-tree-popup">
<xul:menuitem label="Erledigt"/>
</xul:popup>
</xul:popupset>
<xul:toolbox>
<xul:toolbar >
<xul:toolbarbutton label="Neue Notiz" oncommand="document.getBindingParent(this).NeueNotiz()" image="../skin/images/NeuDokument.png" tooltiptext="Neue Notiz anlegen" />
<xul:toolbarbutton label="Aktualisieren" oncommand="document.getBindingParent(this).RefreshNotiz()" disabled="false" image="../skin/images/refresh.png" tooltiptext="Liste neu laden"/>
</xul:toolbar>
</xul:toolbox>
<xul:tree anonid="tree-notiz"
seltype="single" hidecolumnpicker="false" flex="1" style="height: 150px"
datasources="rdf:null" ref="http://www.technikum-wien.at/notiz/liste"
>
<xul:treecols>
<xul:treecol anonid="treecol-notiz-titel" label="Titel" flex="5" primary="true" persist="hidden width ordinal"
class="sortDirectionIndicator"
sort="rdf:http://www.technikum-wien.at/notiz/rdf#titel" />
<xul:splitter class="tree-splitter"/>
<xul:treecol anonid="treecol-notiz-text" label="Text" flex="2" hidden="false" persist="hidden width ordinal"
class="sortDirectionIndicator"
sort="rdf:http://www.technikum-wien.at/notiz/rdf#text" />
<xul:splitter class="tree-splitter"/>
<xul:treecol anonid="treecol-notiz-verfasser" label="Verfasser" flex="2" hidden="false" persist="hidden width ordinal"
class="sortDirectionIndicator"
sort="rdf:http://www.technikum-wien.at/notiz/rdf#verfasser_uid" />
<xul:splitter class="tree-splitter"/>
<xul:treecol anonid="treecol-notiz-bearbeiter" label="Bearbeiter" flex="2" hidden="true" persist="hidden width ordinal"
class="sortDirectionIndicator"
sort="rdf:http://www.technikum-wien.at/notiz/rdf#bearbeiter_uid" />
<xul:splitter class="tree-splitter"/>
<xul:treecol anonid="treecol-notiz-start" label="Start" flex="2" hidden="false" persist="hidden width ordinal"
class="sortDirectionIndicator"
sort="rdf:http://www.technikum-wien.at/notiz/rdf#start" />
<xul:splitter class="tree-splitter"/>
<xul:treecol anonid="treecol-notiz-ende" label="Ende" flex="2" hidden="false" persist="hidden width ordinal"
class="sortDirectionIndicator"
sort="rdf:http://www.technikum-wien.at/notiz/rdf#ende" />
<xul:splitter class="tree-splitter"/>
<xul:treecol anonid="treecol-notiz-erledigt" label="Erledigt" flex="2" hidden="true" persist="hidden width ordinal"
class="sortDirectionIndicator"
sort="rdf:http://www.technikum-wien.at/notiz/rdf#erledigt" />
<xul:splitter class="tree-splitter"/>
<xul:treecol anonid="treecol-notiz-notiz_id" label="NotizID" flex="2" hidden="true" persist="hidden width ordinal"
class="sortDirectionIndicator"
sort="rdf:http://www.technikum-wien.at/notiz/rdf#notiz_id" />
<xul:splitter class="tree-splitter"/>
</xul:treecols>
<xul:template>
<xul:rule>
<xul:treechildren>
<xul:treeitem uri="rdf:*">
<xul:treerow>
<xul:treecell label="rdf:http://www.technikum-wien.at/notiz/rdf#titel"/>
<xul:treecell label="rdf:http://www.technikum-wien.at/notiz/rdf#text"/>
<xul:treecell label="rdf:http://www.technikum-wien.at/notiz/rdf#verfasser_uid"/>
<xul:treecell label="rdf:http://www.technikum-wien.at/notiz/rdf#bearbeiter_uid"/>
<xul:treecell label="rdf:http://www.technikum-wien.at/notiz/rdf#start"/>
<xul:treecell label="rdf:http://www.technikum-wien.at/notiz/rdf#ende"/>
<xul:treecell label="rdf:http://www.technikum-wien.at/notiz/rdf#erledigt"/>
<xul:treecell label="rdf:http://www.technikum-wien.at/notiz/rdf#notiz_id"/>
</xul:treerow>
</xul:treeitem>
</xul:treechildren>
</xul:rule>
</xul:template>
</xul:tree>
<xul:button onclick="alert('value:'+document.getBindingParent(this).value);" label="GetValue" />
<xul:button onclick="alert('projekt_kurzbz:'+this.getAttribute('projekt_kurzbz'));" label="GetProjektKurzbz" />
</xul:vbox>
</content>
<implementation>
<field name="TreeNotizDatasource" />
<property name="value">
<getter>
try
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
tree = document.getAnonymousElementByAttribute(this ,'anonid', 'tree-notiz');
var col = tree.columns.getColumnFor(document.getAnonymousElementByAttribute(this ,'anonid', 'treecol-notiz-notiz_id'));
return tree.view.getCellText(tree.currentIndex, col);
}
catch(e)
{
return false;
}
</getter>
<setter>
<![CDATA[
debug("Value Setter not implemented");
]]>
</setter>
</property>
<method name="NeueNotiz">
<body>
<![CDATA[
debug('Neue Notiz');
this.openNotiz();
]]>
</body>
</method>
<method name="RefreshNotiz">
<body>
<![CDATA[
debug('Refresh Notiz');
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
this.TreeNotizDatasource.Refresh(false); //non blocking
]]>
</body>
</method>
<method name="LoadNotizTree">
<parameter name="projekt_kurzbz"/>
<parameter name="projektphase_id"/>
<parameter name="projekttask_id"/>
<parameter name="uid"/>
<parameter name="person_id"/>
<parameter name="prestudent_id"/>
<parameter name="bestellung_id"/>
<parameter name="addobserver"/>
<body>
<![CDATA[
debug('LoadNotizTree');
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
try
{
var datasource="<?php echo APP_ROOT; ?>rdf/notiz.rdf.php?ts="+gettimestamp();
datasource = datasource+"&projekt_kurzbz="+encodeURIComponent(projekt_kurzbz);
datasource = datasource+"&projektphase_id="+encodeURIComponent(projektphase_id);
datasource = datasource+"&projekttask_id="+encodeURIComponent(projekttask_id);
datasource = datasource+"&uid="+encodeURIComponent(uid);
datasource = datasource+"&person_id="+encodeURIComponent(person_id);
datasource = datasource+"&prestudent_id="+encodeURIComponent(prestudent_id);
datasource = datasource+"&bestellung_id="+encodeURIComponent(bestellung_id);
var tree = document.getAnonymousElementByAttribute(this ,'anonid', 'tree-notiz');
//Alte DS entfernen
var oldDatasources = tree.database.GetDataSources();
while(oldDatasources.hasMoreElements())
{
tree.database.RemoveDataSource(oldDatasources.getNext());
}
var rdfService = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService);
this.TreeNotizDatasource = rdfService.GetDataSource(datasource);
this.TreeNotizDatasource.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource);
this.TreeNotizDatasource.QueryInterface(Components.interfaces.nsIRDFXMLSink);
tree.database.AddDataSource(this.TreeNotizDatasource);
if(addobserver)
{
this.TreeNotizDatasource.addXMLSinkObserver({
notiz: this,
onBeginLoad: function(aSink)
{},
onInterrupt: function(aSink)
{},
onResume: function(aSink)
{},
onEndLoad: function(aSink)
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
//aSink.removeXMLSinkObserver(this);
debug('onEndLoad start Rebuild');
var tree = document.getAnonymousElementByAttribute(this.notiz ,'anonid', 'tree-notiz');
tree.builder.rebuild();
},
onError: function(aSink, aStatus, aErrorMsg)
{ alert("error! " + aErrorMsg); }
});
tree.builder.addListener({
willRebuild : function(builder)
{
},
didRebuild : function(builder)
{
debug("didrebuild");
//builder.removeListener(this);
}
});
}
}
catch(e)
{
debug("Notiz load failed with exception: "+e);
}
]]>
</body>
</method>
<method name="openNotiz">
<parameter name="id"/>
<body>
<![CDATA[
var param = '';
if(id!=undefined)
param = '?id='+id;
window.open('<?php echo APP_ROOT; ?>content/notiz.window.xul.php'+param,'Notiz','chrome, status=no, width=500, height=350, centerscreen, resizable');
]]>
</body>
</method>
<constructor>
var projekt_kurzbz = this.getAttribute('projekt_kurzbz');
var projektphase_id = this.getAttribute('projektphase_id');
var projekttask_id = this.getAttribute('projekttask_id');
var uid = this.getAttribute('uid');
var person_id = this.getAttribute('person_id');
var prestudent_id = this.getAttribute('prestudent_id');
var bestellung_id = this.getAttribute('bestellung_id');
this.LoadNotizTree(projekt_kurzbz,projektphase_id,projekttask_id,uid,person_id,prestudent_id,bestellung_id, true);
</constructor>
<destructor>
debug('Notiz Binding Stop');
</destructor>
</implementation>
<handlers>
<handler event="dblclick">
this.openNotiz(this.value);
</handler>
</handlers>
</binding>
</bindings>
+47
View File
@@ -23,6 +23,7 @@ include('../config/vilesci.config.inc.php');
var datasourceTreeProjekt;
var datasourceTreeProjektphase;
var datasourceTreeProjekttask;
var datasourceTreeDokument;
function treeProjektmenueSelect()
{
@@ -171,6 +172,52 @@ function treeProjektmenueSelect()
document.getElementById('projekttask-toolbar-del').disabled=true;
// Dokumente laden
if(projekt_phase_id!='' || projekt_kurzbz!='')
{
document.getElementById('toolbarbutton-projektdokument-neu').disabled=false;
try
{
if(projekt_phase_id!='')
url = "<?php echo APP_ROOT; ?>rdf/dms.rdf.php?projektphase_id="+projekt_phase_id+"&"+gettimestamp();
else if(projekt_kurzbz!='')
url = "<?php echo APP_ROOT; ?>rdf/dms.rdf.php?projekt_kurzbz="+projekt_kurzbz+"&"+gettimestamp();
var treeDokument=document.getElementById('tree-projektdokument');
//Alte DS entfernen
var oldDatasources = treeDokument.database.GetDataSources();
while(oldDatasources.hasMoreElements())
{
treeDokument.database.RemoveDataSource(oldDatasources.getNext());
}
try
{
datasourceTreeDokument.removeXMLSinkObserver(DokumentTreeSinkObserver);
treeDokument.builder.removeListener(DokumentTreeListener);
}
catch(e)
{}
var rdfService = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService);
datasourceTreeDokument = rdfService.GetDataSource(url);
datasourceTreeDokument.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource);
datasourceTreeDokument.QueryInterface(Components.interfaces.nsIRDFXMLSink);
treeDokument.database.AddDataSource(datasourceTreeDokument);
datasourceTreeDokument.addXMLSinkObserver(DokumentTreeSinkObserver);
treeDokument.builder.addListener(DokumentTreeListener);
}
catch(e)
{
debug("whoops Documents load failed with exception: "+e);
}
}
else
document.getElementById('toolbarbutton-projektdokument-neu').disabled=true;
if(projekt_kurzbz!='')
{
//Neu Button bei Tasks aktivieren
+7 -2
View File
@@ -10,6 +10,7 @@ echo '<?xul-overlay href="'.APP_ROOT.'content/projekt/projekt.overlay.xul.php"?>
echo '<?xul-overlay href="'.APP_ROOT.'content/projekt/projektphase.overlay.xul.php"?>';
echo '<?xul-overlay href="'.APP_ROOT.'content/projekt/projekttask.overlay.xul.php"?>';
/*echo '<?xul-overlay href="'.APP_ROOT.'content/projekt/ressource.overlay.xul.php"?>';*/
echo '<?xul-overlay href="'.APP_ROOT.'content/projekt/projektdokument.overlay.xul.php"?>';
echo '<?xul-overlay href="'.APP_ROOT.'content/projekt/gantt.overlay.xul.php"?>';
?>
@@ -105,7 +106,7 @@ echo '<?xul-overlay href="'.APP_ROOT.'content/projekt/gantt.overlay.xul.php"?>';
<tab id="tab-projekt" label="Projekte" />
<tab id="tab-projektphase" label="Phasen" />
<tab id="tab-projekttask" label="Tasks" selected="true" />
<!-- <tab id="tab-ressource" label="Ressourcen" /> -->
<!--<tab id="tab-ressource" label="Ressourcen" />-->
<tab id="tab-notiz" label="Notizen" />
<tab id="tab-dokumente" label="Dokumente" />
<tab id="tab-bestellung" label="Bestellungen" />
@@ -115,7 +116,7 @@ echo '<?xul-overlay href="'.APP_ROOT.'content/projekt/gantt.overlay.xul.php"?>';
<vbox id="box-projekt" />
<vbox id="box-projektphase" />
<vbox id="box-projekttask" />
<!-- <vbox id="box-ressource" /> -->
<!--<vbox id="box-ressource" />-->
<vbox id="box-notiz" />
<vbox id="box-dokumente" />
<vbox id="box-bestellung" />
@@ -125,6 +126,9 @@ echo '<?xul-overlay href="'.APP_ROOT.'content/projekt/gantt.overlay.xul.php"?>';
</tabbox>
</vbox>
<vbox id="box-notiz">
<box class="Notiz" projekt_kurzbz="Abgabetool"/>
</vbox>
<vbox id="box-ressourcemenue">
<toolbox>
@@ -185,4 +189,5 @@ echo '<?xul-overlay href="'.APP_ROOT.'content/projekt/gantt.overlay.xul.php"?>';
</template>
</tree>
</vbox>
</overlay>
+198
View File
@@ -0,0 +1,198 @@
<?php
/* Copyright (C) 2011 FH 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: Andreas Österreicher <andreas.oesterreicher@technikum-wien.at>
*/
require_once('../../config/vilesci.config.inc.php');
?>
// *********** Globale Variablen *****************//
var DokumentSelectID=null; //ID des Dokuments das nach dem Refresh markiert werden soll
// ********** Observer und Listener ************* //
// ****
// * Observer fuer Dokument Tree
// * startet Rebuild nachdem das Refresh
// * der datasource fertig ist
// ****
var DokumentTreeSinkObserver =
{
onBeginLoad : function(pSink) {},
onInterrupt : function(pSink) {},
onResume : function(pSink) {},
onError : function(pSink, pStatus, pError) { debug('onerror:'+pError); },
onEndLoad : function(pSink)
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
document.getElementById('tree-projektdokument').builder.rebuild();
}
};
// ****
// * Nach dem Rebuild wird das Dokument wieder
// * markiert
// ****
var DokumentTreeListener =
{
willRebuild : function(builder)
{
},
didRebuild : function(builder)
{
//timeout nur bei Mozilla notwendig da sonst die rows
//noch keine values haben. Ab Seamonkey funktionierts auch
//ohne dem setTimeout
window.setTimeout(DokumentTreeSelectDokument,10);
// Progressmeter stoppen
//document.getElementById('statusbar-progressmeter').setAttribute('mode','determined');
}
};
// ****************** FUNKTIONEN ************************** //
// ****
// * Asynchroner (Nicht blockierender) Refresh des Dokument Trees
// ****
function ProjektDokumentTreeRefresh()
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
//markiertes Dokument global speichern damit es nach dem
//refresh wieder markiert werden kann.
var tree = document.getElementById('tree-projektdokument');
try
{
DokumentSelectID = getTreeCellText(tree, "treecol-projektdokument-dms_id", tree.currentIndex);
}
catch(e)
{
DokumentSelectID=null;
}
datasourceTreeDokument.Refresh(false); //non blocking
}
// ****
// * Selectiert das Dokument nachdem der Tree
// * rebuildet wurde.
// ****
function DokumentTreeSelectDokument()
{
var tree=document.getElementById('tree-projektdokument');
var items = tree.view.rowCount; //Anzahl der Zeilen ermitteln
//In der globalen Variable ist die zu selektierende ID gespeichert
if(DokumentSelectID!=null)
{
for(var i=0;i<items;i++)
{
//id der row holen
id = getTreeCellText(tree, "treecol-projektdokument-dms_id", i);
//wenn dies die zu selektierende Zeile
if(DokumentSelectID==id)
{
//Zeile markieren
tree.view.selection.select(i);
//Sicherstellen, dass die Zeile im sichtbaren Bereich liegt
tree.treeBoxObject.ensureRowIsVisible(i);
return true;
}
}
}
}
function ProjektDokumentDoubleClick()
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var tree = document.getElementById('tree-projektdokument');
if (tree.currentIndex==-1) return;
try
{
//Ausgewaehlten Eintrag holen
id = getTreeCellText(tree, "treecol-projektdokument-dms_id", tree.currentIndex);
if(id!='')
{
window.open('<?php echo APP_ROOT; ?>cms/dms.php?id='+id);
}
}
catch(e)
{
alert(e);
return false;
}
}
function ProjektDokumentNeu()
{
var tree=document.getElementById('tree-projektmenue');
if(tree.currentIndex==-1)
{
alert('Bitte markieren Sie zuerst ein Projekt oder eine Phase');
return false;
}
var projekt_kurzbz=getTreeCellText(tree, "treecol-projektmenue-projekt_kurzbz", tree.currentIndex);
var projekt_phase_id=getTreeCellText(tree, "treecol-projektmenue-projekt_phase_id", tree.currentIndex);
if(projekt_phase_id!='')
var url = '<?php echo APP_ROOT;?>cms/tinymce_dms.php?kategorie_kurzbz=Projekt&openupload=true&projekt_phase_id='+projekt_phase_id;
else if(projekt_kurzbz!='')
var url = '<?php echo APP_ROOT;?>cms/tinymce_dms.php?kategorie_kurzbz=Projekt&openupload=true&projekt_kurzbz='+projekt_kurzbz;
else
{
alert('Bitte zuerst eine Phase oder ein Projekt markieren');
return false;
}
window.open(url);
}
function ProjektDokumentNeueVersion()
{
var tree=document.getElementById('tree-projektdokument');
if(tree.currentIndex==-1)
{
alert('Bitte markieren Sie zuerst einen Eintrag');
return false;
}
var dms_id=getTreeCellText(tree, "treecol-projektdokument-dms_id", tree.currentIndex);
var projekt_phase_id=getTreeCellText(tree, "treecol-projektdokument-projektphase_id", tree.currentIndex);
var projekt_kurzbz=getTreeCellText(tree, "treecol-projektdokument-projekt_kurzbz", tree.currentIndex);
if(projekt_phase_id!='')
var url = '<?php echo APP_ROOT;?>cms/tinymce_dms.php?kategorie_kurzbz=Projekt&openupload=true&newVersionID='+dms_id+'&projekt_phase_id='+projekt_phase_id;
else if(projekt_kurzbz!='')
var url = '<?php echo APP_ROOT;?>cms/tinymce_dms.php?kategorie_kurzbz=Projekt&openupload=true&&newVersionID='+dms_id+'&projekt_kurzbz='+projekt_kurzbz;
else
{
alert('Bitte zuerst eine Phase oder ein Projekt markieren');
return false;
}
window.open(url);
}
+121
View File
@@ -0,0 +1,121 @@
<?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" ?>';
?>
<overlay id="overlay-projektdokument"
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/projektdokument.overlay.js.php" />
<!-- ******************************** -->
<!-- * Projektdokument * -->
<!-- ******************************** -->
<vbox id="box-dokumente" flex="1" uid="" stg_kz="">
<popupset>
<popup id="projektdokument-tree-popup">
<menuitem id="menuitem-popup-projektdokument-neueVersion" label="Neue Version hochladen" oncommand="ProjektDokumentNeueVersion();" disabled="false"/>
<menuitem id="menuitem-popup-projektdokument-entf" label="Entfernen" oncommand="ProjektDokumentDelete();" disabled="false"/>
</popup>
</popupset>
<toolbox>
<toolbar id="toolbar-projektdokument-main">
<toolbarbutton id="toolbarbutton-projektdokument-neu" label="Neues Dokument hinzufügen" oncommand="ProjektDokumentNeu();" disabled="true" image="../skin/images/NeuDokument.png" tooltiptext="Neues Dokument hochladen" />
<toolbarbutton id="toolbarbutton-projektdokument-del" label="Loeschen" oncommand="ProjektDokumentDelete();" disabled="true" image="../skin/images/DeleteIcon.png" tooltiptext="Dokument löschen"/>
<toolbarbutton id="toolbarbutton-projektdokument-refresh" label="Aktualisieren" oncommand="ProjektDokumentTreeRefresh()" disabled="false" image="../skin/images/refresh.png" tooltiptext="Liste neu laden"/>
</toolbar>
</toolbox>
<tree id="tree-projektdokument" seltype="single" hidecolumnpicker="false" flex="1"
datasources="rdf:null" ref="http://www.technikum-wien.at/dms/liste"
style="margin:0px;" enableColumnDrag="true"
ondblclick="ProjektDokumentDoubleClick(this);"
persist="height"
flags="dont-build-content"
context="projektdokument-tree-popup"
>
<treecols>
<treecol id="treecol-projektdokument-name" label="Name" flex="2" primary="true" hidden="false" persist="hidden, width, ordinal"
class="sortDirectionIndicator"
sort="rdf:http://www.technikum-wien.at/dms/rdf#name"/>
<splitter class="tree-splitter"/>
<treecol id="treecol-projektdokument-projekt_kurzbz" label="Projekt (kurzbz)" flex="4" hidden="true" persist="hidden, width, ordinal"
class="sortDirectionIndicator"
sort="rdf:http://www.technikum-wien.at/dms/rdf#projekt_kurzbz"/>
<splitter class="tree-splitter"/>
<treecol id="treecol-projektdokument-projektphase_id" label="ProjektphaseID" flex="2" hidden="true" persist="hidden, width, ordinal"
class="sortDirectionIndicator"
sort="rdf:http://www.technikum-wien.at/dms/rdf#projektphaseID"/>
<splitter class="tree-splitter"/>
<treecol id="treecol-projektdokument-insertamum" label="Angelegt am" flex="5" hidden="true" persist="hidden, width, ordinal"
class="sortDirectionIndicator"
sort="rdf:http://www.technikum-wien.at/dms/rdf#insertamum"/>
<splitter class="tree-splitter"/>
<treecol id="treecol-projektdokument-updateamum" label="Letzte Aenderung am" flex="2" hidden="false" persist="hidden, width, ordinal"
class="sortDirectionIndicator"
sort="rdf:http://www.technikum-wien.at/dms/rdf#updateamum" />
<splitter class="tree-splitter"/>
<treecol id="treecol-projektdokument-insertvon" label="Angelegt von" flex="2" hidden="true" persist="hidden, width, ordinal"
class="sortDirectionIndicator"
sort="rdf:http://www.technikum-wien.at/projekt/rdf#ende" />
<splitter class="tree-splitter"/>
<treecol id="treecol-projektdokument-updatevon" label="Letzte Aenderung von" flex="2" hidden="true" persist="hidden, width, ordinal"
class="sortDirectionIndicator"
sort="rdf:http://www.technikum-wien.at/dms/rdf#updatevon" />
<splitter class="tree-splitter"/>
<treecol id="treecol-projektdokument-dms_id" label="DMSID" flex="4" hidden="false" persist="hidden, width, ordinal"
class="sortDirectionIndicator"
sort="rdf:http://www.technikum-wien.at/dms/rdf#dms_id"/>
<splitter class="tree-splitter"/>
</treecols>
<template>
<rule>
<treechildren>
<treeitem uri="rdf:*">
<treerow >
<treecell label="rdf:http://www.technikum-wien.at/dms/rdf#name"/>
<treecell label="rdf:http://www.technikum-wien.at/dms/rdf#projekt_kurzbz"/>
<treecell label="rdf:http://www.technikum-wien.at/dms/rdf#projektphase_id"/>
<treecell label="rdf:http://www.technikum-wien.at/dms/rdf#insertamum"/>
<treecell label="rdf:http://www.technikum-wien.at/dms/rdf#updateamum"/>
<treecell label="rdf:http://www.technikum-wien.at/dms/rdf#insertvon"/>
<treecell label="rdf:http://www.technikum-wien.at/dms/rdf#updatevon"/>
<treecell label="rdf:http://www.technikum-wien.at/dms/rdf#dms_id"/>
</treerow>
</treeitem>
</treechildren>
</rule>
</template>
</tree>
</vbox>
</overlay>
+173 -16
View File
@@ -62,7 +62,7 @@ class dms extends basis_db
*/
public function load($dms_id, $version=null)
{
$qry = "SELECT * FROM campus.tbl_dms WHERE dms_id='".addslashes($dms_id)."'";
$qry = "SELECT tbl_dms.dms_id, * FROM campus.tbl_dms JOIN campus.tbl_dms_version USING(dms_id) WHERE dms_id='".addslashes($dms_id)."'";
if(!is_null($version))
$qry.=" AND version='".addslashes($version)."'";
@@ -110,9 +110,18 @@ class dms extends basis_db
if($new)
{
$qry = "BEGIN;";
if($this->dms_id=='')
$dms_id="nextval('campus.seq_dms_dms_id')";
{
$dms_id="currval('campus.seq_dms_dms_id')";
$qry.="INSERT INTO campus.tbl_dms(oe_kurzbz, dokument_kurzbz, kategorie_kurzbz)
VALUES(".
$this->addslashes($this->oe_kurzbz).','.
$this->addslashes($this->dokument_kurzbz).','.
$this->addslashes($this->kategorie_kurzbz).');';
}
else
{
if(!is_numeric($this->dms_id))
@@ -122,14 +131,12 @@ class dms extends basis_db
}
$dms_id=$this->dms_id;
}
$qry = "BEGIN;INSERT INTO campus.tbl_dms(dms_id, version, oe_kurzbz, dokument_kurzbz, kategorie_kurzbz,
$qry.="INSERT INTO campus.tbl_dms_version(dms_id, version,
filename, mimetype, name, beschreibung, letzterzugriff, insertamum, insertvon,
updateamum, updatevon) VALUES(".
$dms_id.','.
$this->addslashes($this->version).','.
$this->addslashes($this->oe_kurzbz).','.
$this->addslashes($this->dokument_kurzbz).','.
$this->addslashes($this->kategorie_kurzbz).','.
$this->addslashes($this->filename).','.
$this->addslashes($this->mimetype).','.
$this->addslashes($this->name).','.
@@ -145,7 +152,9 @@ class dms extends basis_db
$qry = "UPDATE campus.tbl_dms SET".
" oe_kurzbz=".$this->addslashes($this->oe_kurzbz).",".
" dokument_kurzbz=".$this->addslashes($this->dokument_kurzbz).",".
" kategorie_kurzbz=".$this->addslashes($this->kategorie_kurzbz).",".
" kategorie_kurzbz=".$this->addslashes($this->kategorie_kurzbz)." ".
" WHERE dms_id='".addslashes($this->dms_id)."';".
"UPDATE campus.tbl_dms_version SET".
" filename=".$this->addslashes($this->filename).",".
" mimetype=".$this->addslashes($this->mimetype).",".
" name=".$this->addslashes($this->name).",".
@@ -204,7 +213,7 @@ class dms extends basis_db
*/
public function touch($dms_id, $version)
{
$qry ="UPDATE campus.tbl_dms SET letzterzugriff=now()
$qry ="UPDATE campus.tbl_dms_version SET letzterzugriff=now()
WHERE dms_id='".addslashes($dms_id)."' AND version='".addslashes($version)."';";
if($this->db_query($qry))
@@ -258,11 +267,12 @@ class dms extends basis_db
*/
public function getDocuments($kategorie_kurzbz)
{
$qry = "SELECT * FROM campus.tbl_dms where (dms_id, version) in(
SELECT dms_id, max(version)
FROM campus.tbl_dms
WHERE kategorie_kurzbz='".addslashes($kategorie_kurzbz)."'
GROUP BY dms_id)
$qry = "SELECT * FROM campus.tbl_dms JOIN campus.tbl_dms_version USING(dms_id)
WHERE (dms_id, version) in(
SELECT dms_id, max(version)
FROM campus.tbl_dms_version
GROUP BY dms_id)
AND kategorie_kurzbz='".addslashes($kategorie_kurzbz)."'
ORDER BY name;";
if($result = $this->db_query($qry))
@@ -302,7 +312,7 @@ class dms extends basis_db
*/
public function search($suchstring)
{
$qry = "SELECT * FROM campus.tbl_dms
$qry = "SELECT * FROM campus.tbl_dms JOIN campus.tbl_dms_version USING(dms_id)
WHERE lower(name) like lower('%".addslashes($suchstring)."%')
OR lower(beschreibung) like lower('%".addslashes($suchstring)."%')
;";
@@ -350,7 +360,7 @@ class dms extends basis_db
return false;
}
$qry = "SELECT * FROM campus.tbl_dms
$qry = "SELECT * FROM campus.tbl_dms JOIN campus.tbl_dms_version USING(dms_id)
WHERE dms_id = '".addslashes($id)."' ORDER BY version ASC;";
if($result = $this->db_query($qry))
@@ -391,7 +401,7 @@ class dms extends basis_db
*/
public function checkVersion($id, $version)
{
$qry = "SELECT * FROM campus.tbl_dms
$qry = "SELECT * FROM campus.tbl_dms_version
WHERE dms_id = '".addslashes($id)."' and
version > '".addslashes($version)."' ;";
@@ -408,5 +418,152 @@ class dms extends basis_db
return false;
}
}
/**
* Laedt die Dokumente eines Projekts
*
* @param $kategorie_kurzbz
*/
public function getDokumenteProjekt($projekt_kurzbz)
{
$qry = "SELECT
*
FROM
campus.tbl_dms
JOIN campus.tbl_dms_version USING(dms_id)
JOIN fue.tbl_projekt_dokument USING(dms_id)
WHERE (dms_id, version) in(
SELECT dms_id, max(version)
FROM campus.tbl_dms_version
GROUP BY dms_id)
AND tbl_projekt_dokument.projekt_kurzbz='".addslashes($projekt_kurzbz)."'
ORDER BY name;";
if($result = $this->db_query($qry))
{
while($row = $this->db_fetch_object($result))
{
$obj = new dms();
$obj->dms_id = $row->dms_id;
$obj->version = $row->version;
$obj->oe_kurzbz = $row->oe_kurzbz;
$obj->dokument_kurzbz = $row->dokument_kurzbz;
$obj->kategorie_kurzbz = $row->kategorie_kurzbz;
$obj->filename = $row->filename;
$obj->mimetype = $row->mimetype;
$obj->name = $row->name;
$obj->beschreibung = $row->beschreibung;
$obj->letzterzugriff = $row->letzterzugriff;
$obj->insertamum = $row->insertamum;
$obj->insertvon = $row->insertvon;
$obj->updateamum = $row->updateamum;
$this->result[] = $obj;
}
}
else
{
$this->errormsg = 'Fehler beim Laden der Daten';
return false;
}
}
/**
* Laedt die Dokumente einer Projektphase
*
* @param $kategorie_kurzbz
*/
public function getDokumenteProjektphase($projektphase_id)
{
$qry = "SELECT
*
FROM
campus.tbl_dms
JOIN campus.tbl_dms_version USING(dms_id)
JOIN fue.tbl_projekt_dokument USING(dms_id)
WHERE (dms_id, version) in(
SELECT dms_id, max(version)
FROM campus.tbl_dms_version
GROUP BY dms_id)
AND tbl_projekt_dokument.projektphase_id='".addslashes($projektphase_id)."'
ORDER BY name;";
if($result = $this->db_query($qry))
{
while($row = $this->db_fetch_object($result))
{
$obj = new dms();
$obj->dms_id = $row->dms_id;
$obj->version = $row->version;
$obj->oe_kurzbz = $row->oe_kurzbz;
$obj->dokument_kurzbz = $row->dokument_kurzbz;
$obj->kategorie_kurzbz = $row->kategorie_kurzbz;
$obj->filename = $row->filename;
$obj->mimetype = $row->mimetype;
$obj->name = $row->name;
$obj->beschreibung = $row->beschreibung;
$obj->letzterzugriff = $row->letzterzugriff;
$obj->insertamum = $row->insertamum;
$obj->insertvon = $row->insertvon;
$obj->updateamum = $row->updateamum;
$this->result[] = $obj;
}
}
else
{
$this->errormsg = 'Fehler beim Laden der Daten';
return false;
}
}
/**
* Speichert die Zuordnung eines Dokuments zu einem Projekt
* Wenn die Zuordnung bereits vorhanden ist, geschieht nichts
*
* @param $dms_id
* @param $projekt_kurzbz
* @param $projektphase_id
*/
function saveProjektzuordnung($dms_id, $projekt_kurzbz, $projektphase_id)
{
$qry = "SELECT * FROM fue.tbl_projekt_dokument WHERE dms_id='".addslashes($dms_id)."'";
if($projekt_kurzbz!='')
$qry.=" AND projekt_kurzbz='".addslashes($projekt_kurzbz)."'";
if($projektphase_id!='')
$qry.=" AND projektphase_id='".addslashes($projektphase_id)."'";
if($result = $this->db_query($qry))
{
if($this->db_num_rows($result)==0)
{
//keine Zuordnung vorhanden -> anlegen
$qry = "INSERT INTO fue.tbl_projekt_dokument(projektphase_id, projekt_kurzbz, dms_id) VALUES(".
$this->addslashes($projektphase_id).','.
$this->addslashes($projekt_kurzbz).','.
$this->addslashes($dms_id).');';
if($this->db_query($qry))
{
return true;
}
else
{
$this->errormsg = 'Fehler beim Zuteilen des Dokuments zu einem Projekt';
return false;
}
}
else
return true; //Zuordnung bereits vorhanden
}
else
{
$this->errormsg = 'Fehler bei einer Datenbankabfrage';
return false;
}
}
}
?>
+73
View File
@@ -0,0 +1,73 @@
<?php
/* Copyright (C) 2011 Technikum-Wien
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Authors: Andreas Österreicher <andreas.oesterreicher@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/dms.class.php');
$rdf_url='http://www.technikum-wien.at/dms/';
$dms = new dms();
$projekt_kurzbz='';
$projektphase_id='';
if(isset($_GET['projekt_kurzbz']))
{
$projekt_kurzbz=$_GET['projekt_kurzbz'];
$dms->getDokumenteProjekt($projekt_kurzbz);
}
elseif(isset($_GET['projektphase_id']))
{
$projektphase_id = $_GET['projektphase_id'];
$dms->getDokumenteProjektphase($projektphase_id);
}
else
die('projekt_kurzbz oder projektphase_id muss uebergeben werden');
echo '
<RDF:RDF
xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:DMS="'.$rdf_url.'rdf#"
>';
$descr='';
$sequenz='';
foreach($dms->result as $row)
{
$descr.='<RDF:Description RDF:about="'.$rdf_url.$row->dms_id.'" >
<DMS:dms_id>'.$row->dms_id.'</DMS:dms_id>
<DMS:projekt_kurzbz>'.$projekt_kurzbz.'</DMS:projekt_kurzbz>
<DMS:projektphase_id>'.$projektphase_id.'</DMS:projektphase_id>
<DMS:name>'.$row->name.'</DMS:name>
<DMS:insertamum>'.$row->insertamum.'</DMS:insertamum>
<DMS:updateamum>'.$row->updateamum.'</DMS:updateamum>
<DMS:insertvon>'.$row->insertvon.'</DMS:insertvon>
<DMS:updatevon>'.$row->updatevon.'</DMS:updatevon>
</RDF:Description>'."\n";
$sequenz.='<RDF:li RDF:resource="'.$rdf_url.$row->dms_id.'" />'."\n";
}
$sequenz='<RDF:Seq about="'.$rdf_url.'liste">'."\n\t".$sequenz.'
</RDF:Seq>'."\n";
echo $descr."\n";
echo $sequenz;
echo '</RDF:RDF>';
?>