Projekt auf Complex type geändert

This commit is contained in:
Karl Burkhart
2011-10-21 08:09:17 +00:00
parent 0897aee6f2
commit c7dd66aceb
5 changed files with 111 additions and 66 deletions
+16 -10
View File
@@ -185,18 +185,24 @@ function saveProjektDetail()
neu = document.getElementById('checkbox-projekt-detail-neu').checked;
var soapBody = new SOAPObject("saveProjekt");
soapBody.appendChild(new SOAPObject("projekt_kurzbz")).val(projekt_kurzbz);
soapBody.appendChild(new SOAPObject("oe_kurzbz")).val(oe_kurzbz);
soapBody.appendChild(new SOAPObject("titel")).val(titel);
soapBody.appendChild(new SOAPObject("beschreibung")).val(beschreibung);
soapBody.appendChild(new SOAPObject("nummer")).val(nummer);
soapBody.appendChild(new SOAPObject("beginn")).val(beginn);
soapBody.appendChild(new SOAPObject("ende")).val(ende);
soapBody.appendChild(new SOAPObject("budget")).val(budget);
//soapBody.appendChild(new SOAPObject("username")).val('joe');
//soapBody.appendChild(new SOAPObject("passwort")).val('waschl');
var projekt = new SOAPObject("projekt");
projekt.appendChild(new SOAPObject("projekt_kurzbz")).val(projekt_kurzbz);
projekt.appendChild(new SOAPObject("oe_kurzbz")).val(oe_kurzbz);
projekt.appendChild(new SOAPObject("titel")).val(titel);
projekt.appendChild(new SOAPObject("nummer")).val(nummer);
projekt.appendChild(new SOAPObject("beschreibung")).val(beschreibung);
projekt.appendChild(new SOAPObject("beginn")).val(beginn);
projekt.appendChild(new SOAPObject("ende")).val(ende);
projekt.appendChild(new SOAPObject("budget")).val(budget);
if(neu)
soapBody.appendChild(new SOAPObject("neu")).val('true');
projekt.appendChild(new SOAPObject("neu")).val('true');
else
soapBody.appendChild(new SOAPObject("neu")).val('false');
projekt.appendChild(new SOAPObject("neu")).val('false');
soapBody.appendChild(projekt);
var sr = new SOAPRequest("saveProjekt",soapBody);
SOAPClient.Proxy="<?php echo APP_ROOT;?>soap/projekt.soap.php?"+gettimestamp();
+16 -11
View File
@@ -98,7 +98,6 @@ function saveProjekt()
{
var oe_kurzbz=document.getElementById('textbox-projekt-oe').value;
var projekt_kurzbz=document.getElementById('textbox-projekt-projekt_kurzbz').value;
//alert (projekt_kurzbz);
var titel=document.getElementById('textbox-projekt-titel').value;
var nummer=document.getElementById('textbox-projekt-nummer').value;
var beschreibung=document.getElementById('textbox-projekt-beschreibung').value;
@@ -108,17 +107,23 @@ function saveProjekt()
// Variablen checken
// SOAP-Action
var soapBody = new SOAPObject("saveProjekt");
soapBody.appendChild(new SOAPObject("projekt_kurzbz")).val(projekt_kurzbz);
soapBody.appendChild(new SOAPObject("oe_kurzbz")).val(oe_kurzbz);
soapBody.appendChild(new SOAPObject("titel")).val(titel);
soapBody.appendChild(new SOAPObject("nummer")).val(nummer);
soapBody.appendChild(new SOAPObject("beschreibung")).val(beschreibung);
soapBody.appendChild(new SOAPObject("beginn")).val(beginn);
soapBody.appendChild(new SOAPObject("ende")).val(ende);
soapBody.appendChild(new SOAPObject("budget")).val(budget);
soapBody.appendChild(new SOAPObject("neu")).val('true');
var soapBody = new SOAPObject("saveProjekt");
//soapBody.appendChild(new SOAPObject("username")).val('joe');
//soapBody.appendChild(new SOAPObject("passwort")).val('waschl');
var projekt = new SOAPObject("projekt");
projekt.appendChild(new SOAPObject("projekt_kurzbz")).val(projekt_kurzbz);
projekt.appendChild(new SOAPObject("oe_kurzbz")).val(oe_kurzbz);
projekt.appendChild(new SOAPObject("titel")).val(titel);
projekt.appendChild(new SOAPObject("nummer")).val(nummer);
projekt.appendChild(new SOAPObject("beschreibung")).val(beschreibung);
projekt.appendChild(new SOAPObject("beginn")).val(beginn);
projekt.appendChild(new SOAPObject("ende")).val(ende);
projekt.appendChild(new SOAPObject("budget")).val(budget);
projekt.appendChild(new SOAPObject("neu")).val('true');
soapBody.appendChild(projekt);
var sr = new SOAPRequest("saveProjekt",soapBody);
SOAPClient.Proxy="<?php echo APP_ROOT;?>soap/projekt.soap.php?"+gettimestamp();
SOAPClient.SendRequest(sr, clb_saveProjekt);
@@ -44,6 +44,9 @@ function saveZuordnung()
// SOAP-Action
var soapBody = new SOAPObject("saveProjektdokumentZuordnung");
//soapBody.appendChild(new SOAPObject("username")).val('joe');
//soapBody.appendChild(new SOAPObject("passwort")).val('waschl');
soapBody.appendChild(new SOAPObject("projekt_kurzbz")).val(projekt_kurzbz);
soapBody.appendChild(new SOAPObject("projektphase_id")).val(projektphase_id);
soapBody.appendChild(new SOAPObject("dms_id")).val(dms_id);
+47 -27
View File
@@ -29,6 +29,8 @@ require_once('../include/basis_db.class.php');
require_once('../include/projekt.class.php');
require_once('../include/datum.class.php');
require_once('../include/dms.class.php');
require_once('../include/functions.inc.php');
require_once('../include/benutzerberechtigung.class.php');
$SOAPServer = new SoapServer(APP_ROOT."/soap/projekt.wsdl.php?".microtime());
$SOAPServer->addFunction("saveProjekt");
@@ -40,44 +42,62 @@ ini_set("soap.wsdl_cache_enabled", "0");
/**
*
* Speichert die vom Webservice übergebenen Parameter in die DB
* @param string $projekt_kurzbz
* @param string $nummer
* @param string $titel
* @param string $beschreibung
* @param date $beginn
* @param date $ende
* @param string $oe_kurzbz
* @param boolean $neu
* Speichert das vom Webservice übergebene Projekt in die DB
* @param $username
* @param $passwort
* @param $projekt
*/
function saveProjekt($projekt_kurzbz, $nummer, $titel, $beschreibung, $beginn, $ende, $budget, $oe_kurzbz, $neu)
function saveProjekt($username, $passwort, $projekt)
{
if(!$user = check_user($username, $passwort))
return new SoapFault("Server", "Invalid Credentials");
$projekt = new projekt();
$projekt->projekt_kurzbz=$projekt_kurzbz;
$projekt->nummer = $nummer;
$projekt->titel = $titel;
$projekt->beschreibung = $beschreibung;
$projekt->beginn = $beginn;
$projekt->ende = $ende;
$projekt->budget = $budget;
$projekt->oe_kurzbz = $oe_kurzbz;
if($neu=='true')
$projekt->new = true;
else
$projekt->new = false;
$rechte = new benutzerberechtigung();
$rechte->getBerechtigungen($user);
if(!$rechte->isBerechtigt('planner', null, 'sui'))
return new SoapFault("Server", "Sie haben keine Berechtigung zum Speichern von Projekten.");
if($projekt->save())
return $projekt->projekt_kurzbz;
$projektNew = new projekt();
$projektNew->projekt_kurzbz=$projekt->projekt_kurzbz;
$projektNew->nummer = $projekt->nummer;
$projektNew->titel = $projekt->titel;
$projektNew->beschreibung = $projekt->beschreibung;
$projektNew->beginn = $projekt->beginn;
$projektNew->ende = $projekt->ende;
$projektNew->budget = $projekt->budget;
$projektNew->oe_kurzbz = $projekt->oe_kurzbz;
if($projekt->neu=='true')
$projektNew->new = true;
else
return new SoapFault("Server", $projekt->errormsg);
$projektNew->new = false;
if($projektNew->save())
return $projektNew->projekt_kurzbz;
else
return new SoapFault("Server", $projektNew->errormsg);
}
/**
*
* Speichert die Zuordnung eines Dokuments zu einem Projekt oder einer Phase
* @param $username
* @param $passwort
* @param $projekt_kurzbz
* @param $projektphase_id
* @param $dms_id
*/
function saveProjektdokumentZuordnung($projekt_kurzbz, $projektphase_id, $dms_id)
function saveProjektdokumentZuordnung($username, $passwort, $projekt_kurzbz, $projektphase_id, $dms_id)
{
if(!$user = check_user($username, $passwort))
return new SoapFault("Server", "Invalid Credentials");
$rechte = new benutzerberechtigung();
$rechte->getBerechtigungen($user);
if(!$rechte->isBerechtigt('planner', null, 'sui'))
return new SoapFault("Server", "Sie haben keine Berechtigung zum Zuordnen von Dokumenten.");
$dms = new dms();
if($dms->saveProjektzuordnung($dms_id, $projekt_kurzbz, $projektphase_id))
+29 -18
View File
@@ -5,37 +5,48 @@ echo "<?xml version='1.0' encoding='utf-8' ?>";
?>
<wsdl:definitions name="Projekt"
targetNamespace="http://localhost/soap/"
targetNamespace="http://www.technikum-wien.at/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://localhost/soap/"
xmlns:tns="http://www.technikum-wien.at/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsd1="http://localhost/soap/projekt.xsd"
xmlns:xsd1="http://localhost/soap/projekt.xsd"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<wsdl:message name="SaveProjektRequest">
<wsdl:part name="username" type="xsd:string" minOccurs="0"></wsdl:part>
<wsdl:part name="passwort" type="xsd:string" minOccurs="0"></wsdl:part>
<wsdl:part name="projekt" type="tns:projekt"></wsdl:part>
</wsdl:message>
<wsdl:message name="SaveProjektRequest">
<wsdl:part name="projekt_kurzbz" type="xsd:string"></wsdl:part>
<wsdl:part name="nummer" type="xsd:string"></wsdl:part>
<wsdl:part name="titel" type="xsd:string"></wsdl:part>
<wsdl:part name="beschreibung" type="xsd:string"></wsdl:part>
<wsdl:part name="beginn" type="xsd:string"></wsdl:part>
<wsdl:part name="ende" type="xsd:string"></wsdl:part>
<wsdl:part name="budget" type="xsd:string"></wsdl:part>
<wsdl:part name="oe_kurzbz" type="xsd:string"></wsdl:part>
<wsdl:part name="neu" type="xsd:boolean"></wsdl:part>
</wsdl:message>
<xsd:complexType name="projekt">
<xsd:all>
<wsdl:part name="projekt_kurzbz" type="xsd:string"></wsdl:part>
<wsdl:part name="nummer" type="xsd:string"></wsdl:part>
<wsdl:part name="titel" type="xsd:string"></wsdl:part>
<wsdl:part name="beschreibung" type="xsd:string"></wsdl:part>
<wsdl:part name="beginn" type="xsd:string"></wsdl:part>
<wsdl:part name="ende" type="xsd:string"></wsdl:part>
<wsdl:part name="budget" type="xsd:string"></wsdl:part>
<wsdl:part name="oe_kurzbz" type="xsd:string"></wsdl:part>
<wsdl:part name="neu" type="xsd:string"></wsdl:part>
</xsd:all>
</xsd:complexType>
<wsdl:message name="SaveProjektResponse">
<wsdl:part name="message" type="xsd:string"></wsdl:part>
</wsdl:message>
<wsdl:message name="SaveProjektdokumentZuordnungRequest">
<wsdl:part name="projekt_kurzbz" type="xsd:string"></wsdl:part>
<wsdl:part name="projektphase_id" type="xsd:string"></wsdl:part>
<wsdl:part name="dms_id" type="xsd:string"></wsdl:part>
<wsdl:part name="username" type="xsd:string" minOccurs="0"></wsdl:part>
<wsdl:part name="passwort" type="xsd:string" minOccurs="0"></wsdl:part>
<wsdl:part name="projekt_kurzbz" type="xsd:string"></wsdl:part>
<wsdl:part name="projektphase_id" type="xsd:string"></wsdl:part>
<wsdl:part name="dms_id" type="xsd:string"></wsdl:part>
</wsdl:message>
<wsdl:message name="SaveProjektdokumentZuordnungResponse">
<wsdl:part name="message" type="xsd:string"></wsdl:part>
</wsdl:message>
<wsdl:portType name="ConfigPortType" >
<wsdl:operation name="saveProjekt">
<wsdl:input message="tns:SaveProjektRequest"></wsdl:input>