Löschen einer Ressourcezuteilung inst jetzt möglich

This commit is contained in:
Karl Burkhart
2012-11-07 10:42:12 +00:00
parent 8f90020beb
commit cd63eefacc
4 changed files with 188 additions and 1 deletions
+42
View File
@@ -33,6 +33,7 @@ require_once('../include/benutzerberechtigung.class.php');
$SOAPServer = new SoapServer(APP_ROOT."/soap/ressource_projekt.wsdl.php?".microtime());
$SOAPServer->addFunction("saveProjektRessource");
$SOAPServer->addFunction("deleteProjektRessource");
$SOAPServer->handle();
// WSDL Chache auf aus
@@ -79,6 +80,47 @@ function saveProjektRessource($username, $passwort, $projektRessource)
else
return new SoapFault("Server", $ressource->errormsg);
}
/**
* Löscht entweder eine Projekt zu Ressource oder Phase zu Ressource Zuordnung
* @param type $username
* @param type $passwort
* @param type $projektRessource
* @return \SoapFault
*/
function deleteProjektRessource($username, $passwort, $projektRessource)
{
if(!$user = check_user($username, $passwort))
return new SoapFault ("Server", "Invalid Credentials");
$recht = new benutzerberechtigung();
$recht->getBerechtigungen($user);
// if(!$rechte->isBerechtigt('planner', null, 'sui'))
// return new SoapFault("Server", "Sie haben keine Berechtigung zum Speichern von Projekten.");
$ressource = new ressource();
if($projektRessource->projektphase_id != '')
{
// von Projektphase löschen
if($ressource->deleteFromPhase($projektRessource->ressource_id, $projektRessource->projektphase_id))
return "Erfolg";
else
return "Fehler beim Löschen";
}
else
{
// von Projekt löschen
if($ressource->deleteFromProjekt($projektRessource->ressource_id, $projektRessource->projekt_kurzbz))
return "Erfolg";
else
return "Fehler beim Löschen";
}
}
?>
+23
View File
@@ -33,11 +33,25 @@ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<wsdl:part name="message" type="xsd:string"></wsdl:part>
</wsdl:message>
<wsdl:message name="DeleteProjektRessourceRequest">
<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="projektRessource" type="tns:projektRessource"></wsdl:part>
</wsdl:message>
<wsdl:message name="DeleteProjektRessourceResponse">
<wsdl:part name="message" type="xsd:string"></wsdl:part>
</wsdl:message>
<wsdl:portType name="ConfigPortType" >
<wsdl:operation name="saveProjektRessource">
<wsdl:input message="tns:SaveProjektRessourceRequest"></wsdl:input>
<wsdl:output message="tns:SaveProjektRessourceResponse"></wsdl:output>
</wsdl:operation>
<wsdl:operation name="deleteProjektRessource">
<wsdl:input message="tns:DeleteProjektRessourceRequest"></wsdl:input>
<wsdl:output message="tns:DeleteProjektRessourceResponse"></wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ConfigBinding" type="tns:ConfigPortType">
@@ -51,6 +65,15 @@ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<soap:body use="encoded" namespace="http://localhost/soap/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="deleteProjektRessource">
<soap:operation soapAction="<?php echo APP_ROOT."soap/deleteProjektRessource";?>" />
<wsdl:input>
<soap:body use="encoded" namespace="http://localhost/soap/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:input>
<wsdl:output>
<soap:body use="encoded" namespace="http://localhost/soap/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="ProjektRessource">