diff --git a/application/controllers/lehre/lehrauftrag/Lehrauftrag.php b/application/controllers/lehre/lehrauftrag/Lehrauftrag.php index 8a096338e..0fe70a302 100644 --- a/application/controllers/lehre/lehrauftrag/Lehrauftrag.php +++ b/application/controllers/lehre/lehrauftrag/Lehrauftrag.php @@ -270,7 +270,6 @@ class Lehrauftrag extends Auth_Controller private function _sendMail($lehrvertrag_data_arr) { // Cluster data of new lehrvertraege as needed to send mail - $lehrvertrag_data_arr = $this->_cluster_newVertragData($lehrvertrag_data_arr); foreach ($lehrvertrag_data_arr as $lehrvertrag_data) { diff --git a/application/views/lehre/lehrauftrag/acceptLehrauftragData.php b/application/views/lehre/lehrauftrag/acceptLehrauftragData.php index f09eb62a0..92c896ce7 100644 --- a/application/views/lehre/lehrauftrag/acceptLehrauftragData.php +++ b/application/views/lehre/lehrauftrag/acceptLehrauftragData.php @@ -32,7 +32,7 @@ SELECT erteilt, akzeptiert, (SELECT - vorname || \' \' || nachname + nachname || \' \' || vorname FROM public.tbl_person JOIN public.tbl_benutzer benutzer USING (person_id) @@ -48,7 +48,7 @@ SELECT ) ) AS "bestellt_von", (SELECT - vorname || \' \' || nachname + nachname || \' \' || vorname FROM public.tbl_person JOIN public.tbl_benutzer benutzer USING (person_id) @@ -64,7 +64,7 @@ SELECT ) ) AS "erteilt_von", (SELECT - vorname || \' \' || nachname + nachname || \' \' || vorname FROM public.tbl_person JOIN public.tbl_benutzer benutzer USING (person_id) @@ -241,7 +241,7 @@ FROM \'Betreuung\' AS "typ", (betreuerart_kurzbz || \' \' || (SELECT - vorname || \' \' || nachname + nachname || \' \' || vorname FROM PUBLIC.tbl_person JOIN PUBLIC.tbl_benutzer USING (person_id) diff --git a/application/views/lehre/lehrauftrag/approveLehrauftragData.php b/application/views/lehre/lehrauftrag/approveLehrauftragData.php index 88b3eabd0..7c9669ae3 100644 --- a/application/views/lehre/lehrauftrag/approveLehrauftragData.php +++ b/application/views/lehre/lehrauftrag/approveLehrauftragData.php @@ -34,7 +34,7 @@ SELECT erteilt, akzeptiert, (SELECT - vorname || \' \' || nachname + nachname || \' \' || vorname FROM public.tbl_person JOIN public.tbl_benutzer benutzer USING (person_id) @@ -50,7 +50,7 @@ SELECT ) ) AS "bestellt_von", (SELECT - vorname || \' \' || nachname + nachname || \' \' || vorname FROM public.tbl_person JOIN public.tbl_benutzer benutzer USING (person_id) @@ -66,7 +66,7 @@ SELECT ) ) AS "erteilt_von", (SELECT - vorname || \' \' || nachname + nachname || \' \' || vorname FROM public.tbl_person JOIN public.tbl_benutzer benutzer USING (person_id) @@ -128,7 +128,7 @@ FROM ( SELECT /* lehrauftraege also planned with dummies, therefore personalnummer is needed */ - ma.personalnummer, + (ma.personalnummer::text), lema.lehreinheit_id, lv.lehrveranstaltung_id, lv.bezeichnung AS "lv_bezeichnung", @@ -240,7 +240,7 @@ FROM pa.lehreinheit_id, lv.lehrveranstaltung_id, lv.bezeichnung AS "lv_bezeichnung", - pa.projektarbeit_id AS "projektarbeit_id", + (pa.projektarbeit_id::text) AS "projektarbeit_id", le.studiensemester_kurzbz, stg.studiengang_kz, upper(stg.typ || stg.kurzbz) AS "stg_typ_kurzbz", @@ -249,7 +249,7 @@ FROM \'Betreuung\' AS "typ", (betreuerart_kurzbz || \' \' || (SELECT - vorname || \' \' || nachname + nachname || \' \' || vorname FROM PUBLIC.tbl_person JOIN PUBLIC.tbl_benutzer USING (person_id) @@ -268,7 +268,7 @@ FROM ELSE (oe.organisationseinheittyp_kurzbz || \' \' || oe.bezeichnung) END AS "lv_oe_kurzbz", - (nachname || \' \' || vorname) AS "lektor", + (vorname || \' \' || nachname) AS "lektor", TRUNC(pb.stunden, 1) AS "stunden", TRUNC((pb.stunden * pb.stundensatz), 2) AS "betrag", vertrag_id, diff --git a/application/views/lehre/lehrauftrag/cancelledLehrauftragData.php b/application/views/lehre/lehrauftrag/cancelledLehrauftragData.php index 54948fb26..a3efb66b3 100644 --- a/application/views/lehre/lehrauftrag/cancelledLehrauftragData.php +++ b/application/views/lehre/lehrauftrag/cancelledLehrauftragData.php @@ -14,7 +14,7 @@ $query = ' datum AS "storniert", ( SELECT - vorname || \' \' || nachname + nachname || \' \' || vorname FROM public.tbl_person JOIN public.tbl_benutzer benutzer USING (person_id) diff --git a/application/views/lehre/lehrauftrag/orderLehrauftragData.php b/application/views/lehre/lehrauftrag/orderLehrauftragData.php index aea7d5181..1ccfc55a4 100644 --- a/application/views/lehre/lehrauftrag/orderLehrauftragData.php +++ b/application/views/lehre/lehrauftrag/orderLehrauftragData.php @@ -65,7 +65,7 @@ SELECT erteilt, akzeptiert, (SELECT - vorname || \' \' || nachname + nachname || \' \' || vorname FROM public.tbl_person JOIN public.tbl_benutzer benutzer USING (person_id) @@ -81,7 +81,7 @@ SELECT ) ) AS "bestellt_von", (SELECT - vorname || \' \' || nachname + nachname || \' \' || vorname FROM public.tbl_person JOIN public.tbl_benutzer benutzer USING (person_id) @@ -97,7 +97,7 @@ SELECT ) ) AS "erteilt_von", (SELECT - vorname || \' \' || nachname + nachname || \' \' || vorname FROM public.tbl_person JOIN public.tbl_benutzer benutzer USING (person_id) @@ -281,7 +281,7 @@ FROM \'Betreuung\' AS "typ", (betreuerart_kurzbz || \' \' || (SELECT - vorname || \' \' || nachname + nachname || \' \' || vorname FROM PUBLIC.tbl_person JOIN PUBLIC.tbl_benutzer USING (person_id) diff --git a/content/projekt/ressource.xml.php b/content/projekt/ressource.xml.php index 966b79a80..d6f6c47c2 100644 --- a/content/projekt/ressource.xml.php +++ b/content/projekt/ressource.xml.php @@ -259,16 +259,19 @@ echo ''; ]]> - + - + '; projektRessource.appendChild(new SOAPObject("projekt_kurzbz")).val(''); } projektRessource.appendChild(new SOAPObject("ressource_id")).val(ressource_id); + projektRessource.appendChild(new SOAPObject("projekt_ressource_id")).val(projekt_ressource_id); soapBody.appendChild(projektRessource); var sr = new SOAPRequest("deleteProjektRessource",soapBody); diff --git a/include/ressource.class.php b/include/ressource.class.php index 2e6915480..e01be0df4 100644 --- a/include/ressource.class.php +++ b/include/ressource.class.php @@ -86,7 +86,7 @@ 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; } @@ -130,7 +130,7 @@ 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; $this->result[] = $obj; } //var_dump($this->result); @@ -174,7 +174,7 @@ 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; @@ -189,8 +189,8 @@ class ressource extends basis_db return false; } } - - + + /** * * Lädt die Projektressource @@ -203,15 +203,15 @@ class ressource extends basis_db $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->aufwand = $row->aufwand; $this->funktion_kurzbz = $row->funktion_kurzbz; - $this->projekt_ressource_id= $row->projekt_ressource_id; - $this->projekt_kurzbz = $row->projekt_kurzbz; + $this->projekt_ressource_id= $row->projekt_ressource_id; + $this->projekt_kurzbz = $row->projekt_kurzbz; $this->projektphase_id = $row->projektphase_id; return true; } @@ -223,7 +223,7 @@ class ressource extends basis_db $this->errormsg = 'Fehler beim Laden der Daten'; return false; } - } + } /** * @@ -256,7 +256,7 @@ 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; @@ -688,5 +688,77 @@ class ressource extends basis_db return false; } } + + /** + * Löscht eine Ressource zu Projekt Zuordnung + * @param type $ressource_id + * @param type $projekt_kurzbz + * @return boolean + */ + public function deleteFromProjektWithProjektRessourceId($ressource_id, $projekt_kurzbz, $project_ressource_id) + { + if($ressource_id == '' || !is_numeric($ressource_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 projekt_kurzbz=".$this->db_add_param($projekt_kurzbz, FHC_STRING, false).';'; + */ + $qry=" + DELETE FROM fue.tbl_projekt_ressource pr + USING fue.tbl_ressource r + WHERE r.ressource_id =".$this->db_add_param($ressource_id, FHC_INTEGER, false). " + AND pr.projekt_ressource_id=".$this->db_add_param($project_ressource_id, FHC_INTEGER, false). " + AND pr.projekt_kurzbz=".$this->db_add_param($projekt_kurzbz, FHC_STRING, false).';'; + + if($this->db_query($qry)) + { + return true; + } + else + { + $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 + */ + public function deleteFromPhaseWithProjektRessourceId($ressource_id, $projektphase_id, $project_ressource_id) + { + if($ressource_id == '' || !is_numeric($ressource_id)) + { + $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).';'; + */ + $qry=" + DELETE FROM fue.tbl_projekt_ressource pr + USING fue.tbl_ressource r + WHERE r.ressource_id =".$this->db_add_param($ressource_id, FHC_INTEGER, false). " + AND pr.projekt_ressource_id=".$this->db_add_param($project_ressource_id, FHC_INTEGER, false). " + AND pr.projektphase_id=".$this->db_add_param($projektphase_id, FHC_INTEGER, false).';'; + if($this->db_query($qry)) + return true; + else + { + $this->errormsg = 'Fehler beim Löschen der Daten'; + return false; + } + } } ?> diff --git a/rdf/ressource.rdf.php b/rdf/ressource.rdf.php index fce26f36d..5306113b2 100644 --- a/rdf/ressource.rdf.php +++ b/rdf/ressource.rdf.php @@ -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,7 @@ $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(); @@ -171,7 +171,7 @@ function draw_ressource($ressource) else die('Fehler beim Laden der Mitarbeiter-daten'); - $mitarbeiter.="\n\t\t\tressource_id."\" />"; + $mitarbeiter.="\n\t\t\tressource_id.'/'.$ressource->projekt_ressource_id."\" />"; $typ ='Mitarbeiter'; } // Ressource ist ein Student @@ -229,7 +229,7 @@ function draw_ressource($ressource) } echo ' - + ressource_id.']]> bezeichnung.']]> @@ -242,7 +242,7 @@ function draw_ressource($ressource) insertvon.']]> updateamum.']]> updatevon.']]> - aufwand.']]> + aufwand.']]> funktion_kurzbz.']]> projekt_ressource_id.']]> diff --git a/soap/ressource_projekt.soap.php b/soap/ressource_projekt.soap.php index 4c1e13dec..1a9f9b426 100644 --- a/soap/ressource_projekt.soap.php +++ b/soap/ressource_projekt.soap.php @@ -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; @@ -105,7 +105,7 @@ function deleteProjektRessource($username, $passwort, $projektRessource) if($projektRessource->projektphase_id != '') { // von Projektphase löschen - if($ressource->deleteFromPhase($projektRessource->ressource_id, $projektRessource->projektphase_id)) + if($ressource->deleteFromPhaseWithProjektRessourceId($projektRessource->ressource_id, $projektRessource->projektphase_id, $projektRessource->projekt_ressource_id)) return "Erfolg"; else return "Fehler beim Löschen"; @@ -113,8 +113,10 @@ function deleteProjektRessource($username, $passwort, $projektRessource) } else { + // von Projekt löschen - if($ressource->deleteFromProjekt($projektRessource->ressource_id, $projektRessource->projekt_kurzbz)) + //if($ressource->deleteFromProjekt($projektRessource->ressource_id, $projektRessource->projekt_kurzbz)) + if($ressource->deleteFromProjektWithProjektRessourceId($projektRessource->ressource_id, $projektRessource->projekt_kurzbz, $projektRessource->projekt_ressource_id)) return "Erfolg"; else return "Fehler beim Löschen"; diff --git a/soap/ressource_projekt.wsdl.php b/soap/ressource_projekt.wsdl.php index bc9071468..5024aa3a6 100644 --- a/soap/ressource_projekt.wsdl.php +++ b/soap/ressource_projekt.wsdl.php @@ -37,7 +37,7 @@ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"> - +