From 6376853734a233f6d3da89c31ca3a53e5bf42a0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Wed, 16 Jun 2021 15:10:43 +0200 Subject: [PATCH] =?UTF-8?q?Planner:=20Timming=20Problem=20beim=20Speichern?= =?UTF-8?q?=20von=20Ressourcen=20behoben=20das=20dazu=20f=C3=BChrte=20dass?= =?UTF-8?q?=20die=20Daten=20nicht=20immer=20gespeichert=20wurden?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../projekt/projekt_ressource.window.js.php | 137 +++++++++--------- 1 file changed, 69 insertions(+), 68 deletions(-) diff --git a/content/projekt/projekt_ressource.window.js.php b/content/projekt/projekt_ressource.window.js.php index bf0aed5de..480fb3551 100644 --- a/content/projekt/projekt_ressource.window.js.php +++ b/content/projekt/projekt_ressource.window.js.php @@ -6,76 +6,77 @@ require_once('../../include/functions.inc.php'); function updateProjektRessource() { - if(projekt_ressource_id!='') + if(projekt_ressource_id!='') + { + aufwand = document.getElementById("textbox-ressource-aufwand").value; + if (document.getElementById("leitung").selected) + funktion_kurzbz = 'Leitung'; + else + funktion_kurzbz = 'Mitarbeiter'; + + try + { + var soapBody = new SOAPObject("saveProjektRessource"); + var projektRessource = new SOAPObject("projektRessource"); + + projektRessource.appendChild(new SOAPObject("projekt_ressource_id")).val(projekt_ressource_id); + + if(projekt_kurzbz != '') + { + projektRessource.appendChild(new SOAPObject("projektphase_id")).val(''); + projektRessource.appendChild(new SOAPObject("projekt_kurzbz")).val(projekt_kurzbz); + var res_binding = window.opener.document.getElementById('box-projekt-ressourcen'); + } + else if(projektphase_id != '') + { + projektRessource.appendChild(new SOAPObject("projektphase_id")).val(projektphase_id); + projektRessource.appendChild(new SOAPObject("projekt_kurzbz")).val(''); + var res_binding = window.opener.document.getElementById('box-projekt-ressource-phase'); + } + + projektRessource.appendChild(new SOAPObject("ressource_id")).val(ressource_id); + projektRessource.appendChild(new SOAPObject("funktion_kurzbz")).val(funktion_kurzbz); + projektRessource.appendChild(new SOAPObject("beschreibung")).val(beschreibung); + projektRessource.appendChild(new SOAPObject("aufwand")).val(aufwand); + + soapBody.appendChild(projektRessource); + + var sr = new SOAPRequest("saveProjektRessource",soapBody); + SOAPClient.Proxy="soap/ressource_projekt.soap.php?"+gettimestamp(); + + function mycallb(obj, projekt_kurzbz, projektphase_id) + { + var ressourcebinding=obj; + var projekt = projekt_kurzbz; + var phase = projektphase_id; + + this.invoke=function (respObj) { + try + { + var id = respObj.Body[0].saveProjektRessourceResponse[0].message[0].Text; + } + catch(e) + { + var fehler = respObj.Body[0].Fault[0].faultstring[0].Text; + alert('Fehler: '+fehler); + return; + } + // Ressourcen Tree aktualisieren + ressourcebinding.LoadRessourceTree(projekt, phase); - aufwand = document.getElementById("textbox-ressource-aufwand").value; - if (document.getElementById("leitung").selected) - funktion_kurzbz = 'Leitung'; - else - funktion_kurzbz = 'Mitarbeiter'; - - - - try - { - var soapBody = new SOAPObject("saveProjektRessource"); - var projektRessource = new SOAPObject("projektRessource"); - - projektRessource.appendChild(new SOAPObject("projekt_ressource_id")).val(projekt_ressource_id); - - if(projekt_kurzbz != '') - { - projektRessource.appendChild(new SOAPObject("projektphase_id")).val(''); - projektRessource.appendChild(new SOAPObject("projekt_kurzbz")).val(projekt_kurzbz); - } - else if(projektphase_id != '') - { - projektRessource.appendChild(new SOAPObject("projektphase_id")).val(projektphase_id); - projektRessource.appendChild(new SOAPObject("projekt_kurzbz")).val(''); - } - - projektRessource.appendChild(new SOAPObject("ressource_id")).val(ressource_id); - projektRessource.appendChild(new SOAPObject("funktion_kurzbz")).val(funktion_kurzbz); - projektRessource.appendChild(new SOAPObject("beschreibung")).val(beschreibung); - projektRessource.appendChild(new SOAPObject("aufwand")).val(aufwand); - - soapBody.appendChild(projektRessource); - - var sr = new SOAPRequest("saveProjektRessource",soapBody); - SOAPClient.Proxy="soap/ressource_projekt.soap.php?"+gettimestamp(); - - function mycallb(obj) - { - var me=obj; - this.invoke=function (respObj) - { - try - { - var id = respObj.Body[0].saveProjektRessourceResponse[0].message[0].Text; - } - catch(e) - { - var fehler = respObj.Body[0].Fault[0].faultstring[0].Text; - alert('Fehler: '+fehler); - return; - } - me.RefreshRessource(); - } - } - - var cb=new mycallb(this); - - //SOAPClient.SendRequest(sr,cb.invoke); - SOAPClient.SendRequest(sr); - } - catch(e) - { - debug("Ressource load failed with exception: "+e); - } - + // Popup schließen + window.close(); } - //window.opener.location.reload(false); - window.close(); + } + // Callback fuer aktualisierung des Trees nach dem Speichern + var cb=new mycallb(res_binding, projekt_kurzbz, projektphase_id); + SOAPClient.SendRequest(sr,cb.invoke); + } + catch(e) + { + debug("Ressource load failed with exception: "+e); + } + } }