diff --git a/content/projekt/gantt.overlay.js.php b/content/projekt/gantt.overlay.js.php index b711007fa..cf0516326 100755 --- a/content/projekt/gantt.overlay.js.php +++ b/content/projekt/gantt.overlay.js.php @@ -22,22 +22,27 @@ require_once('../../config/vilesci.config.inc.php'); ?> -var global_year; -var global_url; +var global_year; +var global_url; function getProperties() { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); var tree=document.getElementById('tree-projektmenue'); - + // Wenn auf die Ueberschrift geklickt wird, soll nix passieren if(tree.currentIndex==-1) { - alert("Kein gültiges Projekt ausgewählt!"); - return; - } - projekt_kurzbz=getTreeCellText(tree, "treecol-projektmenue-projekt_kurzbz", tree.currentIndex); - + if(typeof(ProjektSelectKurzbz)!='undefined') + projekt_kurzbz = ProjektSelectKurzbz; + else + { + alert("Kein gültiges Projekt ausgewählt!"); + return; + } + } + else + projekt_kurzbz=getTreeCellText(tree, "treecol-projektmenue-projekt_kurzbz", tree.currentIndex); } function showStudienjahr() @@ -47,27 +52,35 @@ function showStudienjahr() { var datumAktuell = new Date(); var jahrAktuell = datumAktuell.getFullYear(); - global_year = jahrAktuell; + global_year = jahrAktuell; } var tree=document.getElementById('tree-projektmenue'); // Wenn auf die Ueberschrift geklickt wird, soll nix passieren if(tree.currentIndex==-1) { - alert("Kein gültiges Projekt ausgewählt!"); - return; - } - projekt_kurzbz=getTreeCellText(tree, "treecol-projektmenue-projekt_kurzbz", tree.currentIndex); + if(typeof(ProjektSelectKurzbz)!='undefined') + projekt_kurzbz = ProjektSelectKurzbz; + else + { + alert("Kein gültiges Projekt ausgewählt!"); + return; + } + } + else + { + projekt_kurzbz=getTreeCellText(tree, "treecol-projektmenue-projekt_kurzbz", tree.currentIndex); + } if(projekt_kurzbz == '') { - oe_kurzbz = getTreeCellText(tree, "treecol-projektmenue-oe", tree.currentIndex); + oe_kurzbz = getTreeCellText(tree, "treecol-projektmenue-oe", tree.currentIndex); var url = 'projekt/gantt.svg.php?oe='+oe_kurzbz+'&studienjahr='+(global_year-1)+'&ansicht=studienjahr'; - global_url=url; + global_url=url; } else { var url = 'projekt/gantt.svg.php?projekt='+projekt_kurzbz+'&studienjahr='+(global_year-1)+'&ansicht=studienjahr'; - global_url = url; + global_url = url; } document.getElementById('iframe-gant-projekt').contentWindow.location.href=url; @@ -79,33 +92,40 @@ function showKalenderjahr() { var datumAktuell = new Date(); var jahrAktuell = datumAktuell.getFullYear(); - global_year = jahrAktuell; + global_year = jahrAktuell; } netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); var tree=document.getElementById('tree-projektmenue'); - + // Wenn auf die Ueberschrift geklickt wird, soll nix passieren if(tree.currentIndex==-1) { - alert("Kein gültiges Projekt ausgewählt!"); - return; - } - projekt_kurzbz=getTreeCellText(tree, "treecol-projektmenue-projekt_kurzbz", tree.currentIndex); + if(typeof(ProjektSelectKurzbz)!='undefined') + projekt_kurzbz = ProjektSelectKurzbz; + else + { + alert("Kein gültiges Projekt ausgewählt!"); + return; + } + } + else + projekt_kurzbz=getTreeCellText(tree, "treecol-projektmenue-projekt_kurzbz", tree.currentIndex); + if(projekt_kurzbz == '') { - oe_kurzbz = getTreeCellText(tree, "treecol-projektmenue-oe", tree.currentIndex); + oe_kurzbz = getTreeCellText(tree, "treecol-projektmenue-oe", tree.currentIndex); var url = 'projekt/gantt.svg.php?oe='+oe_kurzbz+'&studienjahr='+global_year+'&ansicht=kalenderjahr'; - global_url = url; + global_url = url; } else { var url = 'projekt/gantt.svg.php?projekt='+projekt_kurzbz+'&studienjahr='+global_year+'&ansicht=kalenderjahr'; - global_url = url; + global_url = url; } global_url = url; - document.getElementById('iframe-gant-projekt').contentWindow.location.href=url; + document.getElementById('iframe-gant-projekt').contentWindow.location.href=url; } function showZeitraum(beginn, ende) @@ -114,36 +134,36 @@ function showZeitraum(beginn, ende) { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); var tree=document.getElementById('tree-projektmenue'); - + // Wenn auf die Ueberschrift geklickt wird, soll nix passieren if(tree.currentIndex==-1) { alert("Kein gültiges Projekt ausgewählt!"); return; - } - + } + projekt_kurzbz=getTreeCellText(tree, "treecol-projektmenue-projekt_kurzbz", tree.currentIndex); if(projekt_kurzbz == '') { - oe_kurzbz = getTreeCellText(tree, "treecol-projektmenue-oe", tree.currentIndex); + oe_kurzbz = getTreeCellText(tree, "treecol-projektmenue-oe", tree.currentIndex); var url = 'projekt/gantt.svg.php?oe='+oe_kurzbz+'&beginn='+beginn+'&ende='+ende; - global_url = url; + global_url = url; } global_url = url; - document.getElementById('iframe-gant-projekt').contentWindow.location.href=url; + document.getElementById('iframe-gant-projekt').contentWindow.location.href=url; } else alert('kein gültiges Datum eingetragen'); - + } function showYear() { var datumAktuell = new Date(); var jahrAktuell = datumAktuell.getFullYear(); - global_year = jahrAktuell; - + global_year = jahrAktuell; + foo = document.getElementById('toolbarbutton-menuitem-gantt-kalenderjahr'); checked=foo.getAttribute('checked'); // kalenderjahr checked @@ -207,7 +227,7 @@ function showYearPlus() } function printGantt() -{ +{ foo = window.open(global_url); foo.onload = function () { diff --git a/content/projekt/projekt.overlay.xul.php b/content/projekt/projekt.overlay.xul.php index 2690064f8..1facab869 100755 --- a/content/projekt/projekt.overlay.xul.php +++ b/content/projekt/projekt.overlay.xul.php @@ -63,7 +63,7 @@ echo ' faultstring; return false; @@ -254,7 +255,7 @@ class mantis extends basis_db try { $params=array('username' => MANTIS_USERNAME, 'password' => MANTIS_PASSWORT); - + $result = $this->soapClient->__soapCall('mc_projects_get_user_accessible',$params); foreach($result as $row) @@ -265,7 +266,7 @@ class mantis extends basis_db $obj->issue_project->id = $row->id; $this->result[] = $obj; - + if(isset($row->subprojects)) { foreach($row->subprojects as $row_sub) @@ -274,15 +275,15 @@ class mantis extends basis_db $obj->issue_project = new stdclass(); $obj->issue_project->name = $row_sub->name; $obj->issue_project->id = $row_sub->id; - + $this->result[] = $obj; - + } - } + } } return true; - } - catch (SoapFault $fault) + } + catch (SoapFault $fault) { $this->errormsg="SOAP-Fehler: ".$fault->faultstring; return false; @@ -307,8 +308,8 @@ class mantis extends basis_db $this->result[] = $obj; } return true; - } - catch (SoapFault $fault) + } + catch (SoapFault $fault) { $this->errormsg="SOAP-Fehler: ".$fault->faultstring; return false; diff --git a/include/ressource.class.php b/include/ressource.class.php index d103ab8bf..2e6915480 100755 --- a/include/ressource.class.php +++ b/include/ressource.class.php @@ -17,7 +17,7 @@ * * Authors: Karl Burkhart . */ - + require_once(dirname(__FILE__).'/basis_db.class.php'); class ressource extends basis_db @@ -31,13 +31,13 @@ class ressource extends basis_db public $beschreibung; //string public $mitarbeiter_uid; //string public $student_uid; //string - public $betriebsmittel_id; //integer - public $firma_id; //integer + public $betriebsmittel_id; //integer + public $firma_id; //integer public $insertamum; //timestamp public $insertvon; //string public $updateamum; //timestamp public $updatevon; //string - + // zwischentabelle projekt_ressource public $projekt_ressource_id; public $projektphase_id; @@ -53,7 +53,7 @@ class ressource extends basis_db { parent::__construct(); - if($ressource_id != null) + if($ressource_id != null) $this->load($ressource_id); } @@ -69,9 +69,9 @@ class ressource extends basis_db $this->errormsg = 'Ressource_id muss eine gueltige Zahl sein'; return false; } - + $qry = "SELECT * FROM fue.tbl_ressource WHERE ressource_id=".$this->db_add_param($ressource_id, FHC_INTEGER); - + if($this->db_query($qry)) { if($row = $this->db_fetch_object()) @@ -90,13 +90,13 @@ class ressource extends basis_db $this->funktion_kurzbz = $row->funktion_kurzbz; return true; } - else + else { $this->errormsg = 'Datensatz wurde nicht gefunden'; return false; } } - else + else { $this->errormsg = 'Fehler beim Laden der Daten'; return false; @@ -105,21 +105,21 @@ class ressource extends basis_db /** * Laedt alle Ressourcen - * @param $projekt_kurzbz, wenn null -> werden alle ressourcen geladen + * @param $projekt_kurzbz, wenn null -> werden alle ressourcen geladen * @return true wenn ok, false im Fehlerfall */ public function getAllRessourcen() { $qry = "SELECT * FROM fue.tbl_ressource order by bezeichnung"; - + $this->result=array(); - + if($this->db_query($qry)) { while($row = $this->db_fetch_object()) { $obj = new ressource(); - + $obj->ressource_id = $row->ressource_id; $obj->bezeichnung = $row->bezeichnung; $obj->beschreibung = $row->beschreibung; @@ -131,21 +131,20 @@ class ressource extends basis_db $obj->insertvon = $row->insertvon; $obj->updateamum = $row->updateamum; $obj->updatevon = $row->updatevon; - $obj->funktion_kurzbz = $row->funktion_kurzbz; $this->result[] = $obj; } //var_dump($this->result); return true; } - else + else { $this->errormsg = 'Fehler beim Laden der Daten'; return false; } } - + /** - * + * * Lädt alle Ressourcen zu einem Projekt * @param $project_kurzbz * @return true wenn ok, false im Fehlerfall @@ -153,17 +152,17 @@ class ressource extends basis_db public function getProjectRessourcen($project_kurzbz) { $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) + JOIN fue.tbl_projekt_ressource project ON(project.ressource_id = ressource.ressource_id) WHERE project.projekt_kurzbz =".$this->db_add_param($project_kurzbz).";"; - + $this->result=array(); - + if($this->db_query($qry)) { while($row = $this->db_fetch_object()) { $obj = new ressource(); - + $obj->ressource_id = $row->ressource_id; $obj->bezeichnung = $row->bezeichnung; $obj->beschreibung = $row->beschreibung; @@ -178,22 +177,22 @@ class ressource extends basis_db $obj->aufwand = $row->aufwand; $obj->funktion_kurzbz = $row->funktion_kurzbz; $obj->projekt_ressource_id= $row->projekt_ressource_id; - + $this->result[] = $obj; } //var_dump($this->result); return true; } - else + else { $this->errormsg = 'Fehler beim Laden der Daten'; return false; } } - - + + /** - * + * * Lädt die Projektressource * @param $project_ressource_id * @return true wenn ok, false im Fehlerfall @@ -202,7 +201,7 @@ class ressource extends basis_db { $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()) @@ -213,13 +212,13 @@ class ressource extends basis_db $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; + $this->projektphase_id = $row->projektphase_id; return true; } //var_dump($this->result); return true; } - else + else { $this->errormsg = 'Fehler beim Laden der Daten'; return false; @@ -227,7 +226,7 @@ class ressource extends basis_db } /** - * + * * Lädt alle Ressourcen zu einer Phase * @param $project_kurzbz * @return true wenn ok, false im Fehlerfall @@ -235,17 +234,17 @@ class ressource extends basis_db public function getPhaseRessourcen($projektphase_id) { $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) + 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).";"; - + $this->result=array(); - + if($this->db_query($qry)) { while($row = $this->db_fetch_object()) { $obj = new ressource(); - + $obj->ressource_id = $row->ressource_id; $obj->bezeichnung = $row->bezeichnung; $obj->beschreibung = $row->beschreibung; @@ -265,13 +264,13 @@ class ressource extends basis_db //var_dump($this->result); return true; } - else + else { $this->errormsg = 'Fehler beim Laden der Daten'; return false; } } - + /** * Speichert den aktuellen Datensatz in die Datenbank * Wenn $neu auf true gesetzt ist wird ein neuer Datensatz angelegt @@ -279,14 +278,14 @@ class ressource extends basis_db * @return true wenn ok, false im Fehlerfall */ public function saveProjektRessource($new=null) - { + { if($new==null) $new = $this->new; - + if($new) { //Neuen Datensatz einfuegen - $qry='BEGIN; INSERT INTO fue.tbl_projekt_ressource (projektphase_id, projekt_kurzbz, + $qry='BEGIN; INSERT INTO fue.tbl_projekt_ressource (projektphase_id, projekt_kurzbz, ressource_id, funktion_kurzbz, beschreibung, aufwand) VALUES ('. $this->db_add_param($this->projektphase_id, FHC_INTEGER).', '. $this->db_add_param($this->projekt_kurzbz).', '. @@ -307,7 +306,7 @@ class ressource extends basis_db 'aufwand='.$this->db_add_param($this->aufwand).' '. 'WHERE projekt_ressource_id='.$this->db_add_param($this->projekt_ressource_id, FHC_INTEGER).';'; } - + if($this->db_query($qry)) { if($new) @@ -322,21 +321,21 @@ class ressource extends basis_db $this->db_query('COMMIT'); return true; } - else + else { $this->errormsg = 'Fehler beim Auslesen der Sequence'; $this->db_query('ROLLBACK;'); return false; } } - else + else { $this->errormsg = 'Fehler beim Auslesen der Sequence'; $this->db_query('ROLLBACK;'); return false; } } - + return true; } else @@ -344,7 +343,7 @@ class ressource extends basis_db $this->errormsg = $qry; return false; } - } + } /** * Speichert den aktuellen Datensatz in die Datenbank @@ -353,14 +352,14 @@ class ressource extends basis_db * @return true wenn ok, false im Fehlerfall */ public function save($new=null) - { + { if($new==null) $new = $this->new; - + if($new) { //Neuen Datensatz einfuegen - $qry='BEGIN; INSERT INTO fue.tbl_ressource (bezeichnung, beschreibung, + $qry='BEGIN; INSERT INTO fue.tbl_ressource (bezeichnung, beschreibung, mitarbeiter_uid, student_uid, betriebsmittel_id, firma_id, insertvon, insertamum, updatevon, updateamum) VALUES ('. $this->db_add_param($this->bezeichnung).', '. $this->db_add_param($this->beschreibung).', '. @@ -385,7 +384,7 @@ class ressource extends basis_db 'updatevon='.$this->db_add_param($this->updatevon).' '. 'WHERE ressource_id='.$this->db_add_param($this->ressource_id, FHC_INTEGER).';'; } - + if($this->db_query($qry)) { if($new) @@ -400,21 +399,21 @@ class ressource extends basis_db $this->db_query('COMMIT'); return true; } - else + else { $this->errormsg = 'Fehler beim Auslesen der Sequence'; $this->db_query('ROLLBACK;'); return false; } } - else + else { $this->errormsg = 'Fehler beim Auslesen der Sequence'; $this->db_query('ROLLBACK;'); return false; } } - + return true; } else @@ -423,8 +422,8 @@ class ressource extends basis_db return false; } } - - + + /** * Laedt die Ressource mit der ID $ressource_id * @param $ressource_id ID der zu ladenden Ressource @@ -437,9 +436,9 @@ class ressource extends basis_db $this->errormsg = 'Ressource_id muss eine gueltige Zahl sein'; return false; } - + $qry = "SELECT * FROM fue.tbl_projekt_ressource WHERE projekt_ressource_id=".$this->db_add_param($projekt_ressource_id, FHC_INTEGER); - + if($this->db_query($qry)) { if($row = $this->db_fetch_object()) @@ -453,13 +452,13 @@ class ressource extends basis_db return true; } - else + else { $this->errormsg = 'Datensatz wurde nicht gefunden'; return false; } } - else + else { $this->errormsg = 'Fehler beim Laden der Daten'; return false; @@ -468,26 +467,26 @@ class ressource extends basis_db /** * Liefert die Ressourcen aller Projekte die zu einem bestimmten Datum aktiv sind - * + * * @param $datum */ public function getProjektRessourceDatum($datum, $endedatum) { $qry = " - SELECT + SELECT distinct - tbl_projekt_ressource.*, tbl_projekt.beginn as start, tbl_projekt.ende, - tbl_ressource.student_uid, tbl_ressource.mitarbeiter_uid, tbl_ressource.betriebsmittel_id, tbl_ressource.firma_id, + tbl_projekt_ressource.*, tbl_projekt.beginn as start, tbl_projekt.ende, + tbl_ressource.student_uid, tbl_ressource.mitarbeiter_uid, tbl_ressource.betriebsmittel_id, tbl_ressource.firma_id, tbl_ressource.bezeichnung, tbl_ressource.beschreibung - FROM + FROM fue.tbl_ressource JOIN fue.tbl_projekt_ressource USING(ressource_id) JOIN fue.tbl_projekt USING(projekt_kurzbz) WHERE - (tbl_projekt.beginn<=".$this->db_add_param($endedatum)." OR tbl_projekt.beginn is null) AND - (tbl_projekt.ende>=".$this->db_add_param($datum)." OR tbl_projekt.ende is null) + (tbl_projekt.beginn<=".$this->db_add_param($endedatum)." OR tbl_projekt.beginn is null) AND + (tbl_projekt.ende>=".$this->db_add_param($datum)." OR tbl_projekt.ende is null) ORDER BY bezeichnung"; - + if($result = $this->db_query($qry)) { while($row = $this->db_fetch_object($result)) @@ -498,7 +497,7 @@ class ressource extends basis_db $obj->projektphase_id = $row->projektphase_id; $obj->start = $row->start; $obj->ende = $row->ende; - + $obj->ressource_id = $row->ressource_id; $obj->student_uid = $row->student_uid; $obj->mitarbeiter_uid = $row->mitarbeiter_uid; @@ -507,39 +506,39 @@ class ressource extends basis_db $obj->bezeichnung = $row->bezeichnung; $obj->beschreibung = $row->beschreibung; $obj->aufwand = $row->aufwand; - + $this->result[] = $obj; } - } + } } - + /** * Liefert die Ressourcen aller Projektphasen die zu einem bestimmten Datum aktiv sind - * + * * @param $datum */ public function getProjektphaseRessourceDatum($datum, $endedatum, $projekt_kurzbz=null) { $qry = " - SELECT + SELECT distinct - tbl_projekt_ressource.*, tbl_projektphase.start, tbl_projektphase.ende, - tbl_ressource.student_uid, tbl_ressource.mitarbeiter_uid, tbl_ressource.betriebsmittel_id, tbl_ressource.firma_id, + tbl_projekt_ressource.*, tbl_projektphase.start, tbl_projektphase.ende, + tbl_ressource.student_uid, tbl_ressource.mitarbeiter_uid, tbl_ressource.betriebsmittel_id, tbl_ressource.firma_id, tbl_ressource.bezeichnung, tbl_ressource.beschreibung - FROM + FROM fue.tbl_ressource JOIN fue.tbl_projekt_ressource USING(ressource_id) JOIN fue.tbl_projektphase USING(projektphase_id) WHERE - (tbl_projektphase.start<=".$this->db_add_param($endedatum)." OR tbl_projektphase.start is null) AND - (tbl_projektphase.ende>=".$this->db_add_param($datum)." OR tbl_projektphase.ende is null) + (tbl_projektphase.start<=".$this->db_add_param($endedatum)." OR tbl_projektphase.start is null) AND + (tbl_projektphase.ende>=".$this->db_add_param($datum)." OR tbl_projektphase.ende is null) "; if(!is_null($projekt_kurzbz)) { $qry.=" AND tbl_projektphase.projekt_kurzbz=".$this->db_add_param($projekt_kurzbz); } $qry.=" ORDER BY tbl_ressource.bezeichnung"; - + if($result = $this->db_query($qry)) { while($row = $this->db_fetch_object($result)) @@ -550,7 +549,7 @@ class ressource extends basis_db $obj->projektphase_id = $row->projektphase_id; $obj->start = $row->start; $obj->ende = $row->ende; - + $obj->ressource_id = $row->ressource_id; $obj->student_uid = $row->student_uid; $obj->mitarbeiter_uid = $row->mitarbeiter_uid; @@ -559,7 +558,7 @@ class ressource extends basis_db $obj->bezeichnung = $row->bezeichnung; $obj->beschreibung = $row->beschreibung; $obj->aufwand = $row->aufwand; - + $this->result[] = $obj; } } @@ -569,7 +568,7 @@ class ressource extends basis_db return false; } } - + /** * Liefert die Ressourcen aller Projektphasen die zu einem bestimmten Datum aktiv sind * @@ -594,12 +593,12 @@ class ressource extends basis_db ((tbl_projektphase.ende>=".$this->db_add_param($datum)." OR tbl_projektphase.ende is null) AND (tbl_projekttask.ende>=".$this->db_add_param($datum)." OR tbl_projekttask.ende is null)) "; - + if(!is_null($projekt_kurzbz)) { $qry.=" AND projekt_kurzbz=".$this->db_add_param($projekt_kurzbz); } - + if($result = $this->db_query($qry)) { while($row = $this->db_fetch_object($result)) @@ -610,7 +609,7 @@ class ressource extends basis_db $obj->projektphase_id = $row->projektphase_id; $obj->start = $row->start; $obj->ende = $row->ende; - + $obj->ressource_id = $row->ressource_id; $obj->student_uid = $row->student_uid; $obj->mitarbeiter_uid = $row->mitarbeiter_uid; @@ -619,7 +618,7 @@ class ressource extends basis_db $obj->bezeichnung = $row->bezeichnung; $obj->beschreibung = $row->beschreibung; $obj->aufwand = $row->aufwand; - + $this->result[] = $obj; } } @@ -629,64 +628,64 @@ class ressource extends basis_db return false; } } - + /** * Löscht eine Ressource zu Projekt Zuordnung * @param type $ressource_id * @param type $projekt_kurzbz - * @return boolean + * @return boolean */ public function deleteFromProjekt($ressource_id, $projekt_kurzbz) { if($ressource_id == '' || !is_numeric($ressource_id)) { - $this->errormsg = 'Ressource Id ist keine gültige Zahl'; - return false; + $this->errormsg = 'Ressource Id ist keine gültige Zahl'; + return false; } - - $qry="DELETE FROM fue.tbl_projekt_ressource WHERE ressource_id =".$this->db_add_param($ressource_id, FHC_INTEGER, false)." - AND projekt_kurzbz=".$this->db_add_param($projekt_kurzbz, FHC_STRING, false).';'; - + + $qry="DELETE FROM fue.tbl_projekt_ressource WHERE ressource_id =".$this->db_add_param($ressource_id, FHC_INTEGER, false)." + AND projekt_kurzbz=".$this->db_add_param($projekt_kurzbz, FHC_STRING, false).';'; + if($this->db_query($qry)) - { - return true; + { + return true; } else { - $this->errormsg = 'Fehler beim Löschen der Daten'; - return false; + $this->errormsg = 'Fehler beim Löschen der Daten'; + return false; } } - + /** * Löscht eine Ressource zu Phase Zuordnung * @param type $ressource_id * @param type $projekt_kurzbz - * @return boolean + * @return boolean */ public function deleteFromPhase($ressource_id, $projektphase_id) { if($ressource_id == '' || !is_numeric($ressource_id)) { - $this->errormsg = 'Ressource Id ist keine gültige Zahl'; - return false; + $this->errormsg = 'Ressource Id ist keine gültige Zahl'; + return false; } - + if($projektphase_id == '' || !is_numeric($projektphase_id)) { - $this->errormsg = 'Ressource Id ist keine gültige Zahl'; - return false; - } - - $qry="DELETE FROM fue.tbl_projekt_ressource WHERE ressource_id =".$this->db_add_param($ressource_id, FHC_INTEGER, false)." - AND projektphase_id=".$this->db_add_param($projektphase_id, FHC_INTEGER, false).';'; - + $this->errormsg = 'Ressource Id ist keine gültige Zahl'; + return false; + } + + $qry="DELETE FROM fue.tbl_projekt_ressource WHERE ressource_id =".$this->db_add_param($ressource_id, FHC_INTEGER, false)." + AND projektphase_id=".$this->db_add_param($projektphase_id, FHC_INTEGER, false).';'; + if($this->db_query($qry)) - return true; + return true; else { - $this->errormsg = 'Fehler beim Löschen der Daten'; - return false; + $this->errormsg = 'Fehler beim Löschen der Daten'; + return false; } } }