NEW: edit ressource funktion

This commit is contained in:
Gerald Raab
2016-03-14 15:13:22 +01:00
parent c65c57b984
commit 8f038d53f5
8 changed files with 852 additions and 592 deletions
Regular → Executable
View File
+81
View File
@@ -0,0 +1,81 @@
<?php
require_once('../../config/vilesci.config.inc.php');
require_once('../../include/functions.inc.php');
?>
function updateProjektRessource()
{
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);
}
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="<?php echo APP_ROOT;?>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);
}
}
//window.opener.location.reload(false);
window.close();
}
+117
View File
@@ -0,0 +1,117 @@
<?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
* Gerald Raab <erald.raab@technikum-wien.at> and
* Rudolf Hangl <rudolf.hangl@technikum-wien.at>.
*/
$projekt_ressource_id = $_GET["id"];
require_once('../../config/vilesci.config.inc.php');
require_once('../../include/functions.inc.php');
require_once('../../include/ressource.class.php');
$ressource = new ressource();
$ressource->getSingleProjektRessource($projekt_ressource_id);
$aufwand = $ressource->aufwand;
$funktion_kurzbz = $ressource->funktion_kurzbz;
$ressource_id = $ressource->ressource_id;
$projektphase_id = $ressource->projektphase_id;
$beschreibung = $ressource->beschreibung;
$projekt_kurzbz = $ressource->projekt_kurzbz;
if ($funktion_kurzbz == "Leitung")
{
$leitung_sel = ' selected="true"';
$mitarbeiter_sel = '';
}
else
{
$leitung_sel = '';
$mitarbeiter_sel = ' selected="true"';
}
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"?>'."\n";
echo '<?xml-stylesheet href="'.APP_ROOT.'skin/tempus.css" type="text/css"?>';
?>
<window id="window-ressource-neu" title="Projektressource verwalten"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
>
<script type="text/javascript" language="JavaScript" src="<?php echo APP_ROOT; ?>include/js/jquery.js"></script>
<script type="text/javascript" language="JavaScript" src="<?php echo APP_ROOT; ?>include/js/jqSOAPClient.js"></script>
<script type="text/javascript" language="JavaScript" src="<?php echo APP_ROOT; ?>include/js/jqXMLUtils.js"></script>
<script type="text/javascript" language="JavaScript" src="<?php echo APP_ROOT; ?>content/functions.js.php"></script>
<script type="text/javascript" language="JavaScript" src="<?php echo APP_ROOT; ?>content/projekt/projekt_ressource.window.js.php"></script>
<script type="text/javascript">
var projekt_ressource_id = '<?php echo $projekt_ressource_id ?>';
var aufwand = '<?php echo $aufwand; ?>';
var funktion_kurzbz = '<?php echo $funktion_kurzbz; ?>';
var projekt_kurzbz = '<?php echo $projekt_kurzbz; ?>';
var projektphase_id = '<?php echo $projektphase_id; ?>';
var ressource_id = '<?php echo $ressource_id; ?>';
var funktion_kurzbz = '<?php echo $funktion_kurzbz; ?>';
var beschreibung = '<?php echo $beschreibung; ?>';
</script>
<vbox>
<checkbox id="checkbox-ressource-neu" hidden="true"/>
<groupbox id="groupbox-ressource" flex="1">
<caption label="Details"/>
<grid id="grid-ressource-detail" style="overflow:auto;margin:4px;" flex="1">
<columns >
<column flex="1"/>
<column flex="5"/>
</columns>
<rows>
<row>
<label value="ProjektRessourceID" control="textbox-ressource-projekt_ressource_id"/>
<textbox id="textbox-ressource-projekt_ressource_id" value="<?php echo $projekt_ressource_id; ?>" disabled="true" />
</row>
<row>
<label value="Funktion" control="textbox-ressource-funktionradio"/>
<radiogroup>
<radio id="leitung" label="Leitung" <?php echo $leitung_sel; ?>/>
<radio id="mitarbeiter" label="Mitarbeiter" <?php echo $mitarbeiter_sel; ?>/>
</radiogroup>
</row>
<row>
<label value="Aufwand" control="textbox-ressource-aufwand"/>
<textbox id="textbox-ressource-aufwand" value="<?php echo $aufwand; ?>" maxlength="256"/>
</row>
</rows>
</grid>
<hbox>
<spacer flex="1" />
<button id="button-ressource-speichern" oncommand="updateProjektRessource()" label="Speichern" />
</hbox>
</groupbox>
</vbox>
</window>
Regular → Executable
+1
View File
@@ -224,6 +224,7 @@ function saveRessource()
SOAPClient.SendRequest(sr, clb_saveRessource);
}
}
// ****
+601 -581
View File
File diff suppressed because it is too large Load Diff
Regular → Executable
+46 -7
View File
@@ -86,7 +86,8 @@ class ressource extends basis_db
$this->insertamum = $row->insertamum;
$this->insertvon = $row->insertvon;
$this->updateamum = $row->updateamum;
$this->updatevon = $row->updatevon;
$this->updatevon = $row->updatevon;
$this->funktion_kurzbz = $row->funktion_kurzbz;
return true;
}
else
@@ -129,7 +130,8 @@ class ressource extends basis_db
$obj->insertamum = $row->insertamum;
$obj->insertvon = $row->insertvon;
$obj->updateamum = $row->updateamum;
$obj->updatevon = $row->updatevon;
$obj->updatevon = $row->updatevon;
$obj->funktion_kurzbz = $row->funktion_kurzbz;
$this->result[] = $obj;
}
//var_dump($this->result);
@@ -150,7 +152,7 @@ class ressource extends basis_db
*/
public function getProjectRessourcen($project_kurzbz)
{
$qry = "SELECT ressource.*, project.projekt_ressource_id, project.aufwand FROM fue.tbl_ressource as ressource
$qry = "SELECT ressource.*, project.projekt_ressource_id, project.aufwand, project.funktion_kurzbz FROM fue.tbl_ressource as ressource
JOIN fue.tbl_projekt_ressource project ON(project.ressource_id = ressource.ressource_id)
WHERE project.projekt_kurzbz =".$this->db_add_param($project_kurzbz).";";
@@ -173,7 +175,8 @@ class ressource extends basis_db
$obj->insertvon = $row->insertvon;
$obj->updateamum = $row->updateamum;
$obj->updatevon = $row->updatevon;
$obj->aufwand = $row->aufwand;
$obj->aufwand = $row->aufwand;
$obj->funktion_kurzbz = $row->funktion_kurzbz;
$obj->projekt_ressource_id= $row->projekt_ressource_id;
$this->result[] = $obj;
@@ -187,7 +190,42 @@ class ressource extends basis_db
return false;
}
}
/**
*
* Lädt die Projektressource
* @param $project_ressource_id
* @return true wenn ok, false im Fehlerfall
*/
public function getSingleProjektRessource($projekt_ressource_id)
{
$qry = "select * from fue.tbl_projekt_ressource where projekt_ressource_id = ".$this->db_add_param($projekt_ressource_id);
$this->result=array();
if($this->db_query($qry))
{
if($row = $this->db_fetch_object())
{
$this->ressource_id = $row->ressource_id;
$this->beschreibung = $row->beschreibung;
$this->aufwand = $row->aufwand;
$this->funktion_kurzbz = $row->funktion_kurzbz;
$this->projekt_ressource_id= $row->projekt_ressource_id;
$this->projekt_kurzbz = $row->projekt_kurzbz;
$this->projektphase_id = $row->projektphase_id;
return true;
}
//var_dump($this->result);
return true;
}
else
{
$this->errormsg = 'Fehler beim Laden der Daten';
return false;
}
}
/**
*
* Lädt alle Ressourcen zu einer Phase
@@ -196,7 +234,7 @@ class ressource extends basis_db
*/
public function getPhaseRessourcen($projektphase_id)
{
$qry = "SELECT ressource.*, project.aufwand, project.projekt_ressource_id FROM fue.tbl_ressource as ressource
$qry = "SELECT ressource.*, project.aufwand, project.funktion_kurzbz, project.projekt_ressource_id FROM fue.tbl_ressource as ressource
JOIN fue.tbl_projekt_ressource project ON(project.ressource_id = ressource.ressource_id)
WHERE project.projektphase_id =".$this->db_add_param($projektphase_id, FHC_INTEGER).";";
@@ -219,7 +257,8 @@ class ressource extends basis_db
$obj->insertvon = $row->insertvon;
$obj->updateamum = $row->updateamum;
$obj->updatevon = $row->updatevon;
$obj->aufwand = $row->aufwand;
$obj->aufwand = $row->aufwand;
$obj->funktion_kurzbz = $row->funktion_kurzbz;
$obj->projekt_ressource_id = $row->projekt_ressource_id;
$this->result[] = $obj;
}
Regular → Executable
+5 -3
View File
@@ -19,7 +19,7 @@
*/
$projekt_kurzbz=(isset($_GET['projekt_kurzbz'])?$_GET['projekt_kurzbz']:null);
$projekt_phase=(isset($_GET['projekt_phase'])?$_GET['projekt_phase']:null);
$projekt_phase=(isset($_GET['projekt_phase'])?$_GET['projekt_phase']:null);
if($projekt_phase != null && (is_numeric($projekt_phase) == false ))
die('Ungültige ProjektphasenID');
@@ -81,7 +81,8 @@ $ressource = new ressource();
if($projekt_kurzbz!=null)
$ressource->getProjectRessourcen($projekt_kurzbz);
else if($projekt_phase!= null)
$ressource->getPhaseRessourcen($projekt_phase);
$ressource->getPhaseRessourcen($projekt_phase);
else
$ressource->getAllRessourcen();
@@ -241,7 +242,8 @@ function draw_ressource($ressource)
<RESSOURCE:insertvon><![CDATA['.$ressource->insertvon.']]></RESSOURCE:insertvon>
<RESSOURCE:updateamum><![CDATA['.$ressource->updateamum.']]></RESSOURCE:updateamum>
<RESSOURCE:updatevon><![CDATA['.$ressource->updatevon.']]></RESSOURCE:updatevon>
<RESSOURCE:aufwand><![CDATA['.$ressource->aufwand.']]></RESSOURCE:aufwand>
<RESSOURCE:aufwand><![CDATA['.$ressource->aufwand.']]></RESSOURCE:aufwand>
<RESSOURCE:funktion_kurzbz><![CDATA['.$ressource->funktion_kurzbz.']]></RESSOURCE:funktion_kurzbz>
<RESSOURCE:projekt_ressource_id><![CDATA['.$ressource->projekt_ressource_id.']]></RESSOURCE:projekt_ressource_id>
<RESSOURCE:rdf_description><![CDATA['.$RdfDescription.']]></RESSOURCE:rdf_description>
</RDF:Description>
Regular → Executable
+1 -1
View File
@@ -70,7 +70,7 @@ function saveProjektRessource($username, $passwort, $projektRessource)
$ressource->projekt_ressource_id=$projektRessource->projekt_ressource_id;
$ressource->projektphase_id=$projektRessource->projektphase_id;
$ressource->projekt_kurzbz=$projektRessource->projekt_kurzbz;
$ressource->ressource_id = $projektRessource->ressource_id;
$ressource->ressource_id = $projektRessource->ressource_id;
$ressource->funktion_kurzbz = $projektRessource->funktion_kurzbz;
$ressource->beschreibung = $projektRessource->beschreibung;
$ressource->aufwand = $projektRessource->aufwand;