From 4e0dfbf28a7f5f685115c7ade427ba18bece6737 Mon Sep 17 00:00:00 2001 From: OliiverHacker Date: Tue, 23 Mar 2021 13:24:15 +0100 Subject: [PATCH 01/28] change studienblatt if AbbrecherIn --- rdf/studienblatt.xml.php | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/rdf/studienblatt.xml.php b/rdf/studienblatt.xml.php index 7756901f5..e9e82cbbf 100644 --- a/rdf/studienblatt.xml.php +++ b/rdf/studienblatt.xml.php @@ -156,12 +156,26 @@ foreach($uid_arr as $uid) echo "\t\tregelstudiendauer!=0?$studienordnung->ects/$studienplan->regelstudiendauer:0)."]]>"; echo "\t\t"; + $status_aktuell = ($prestudent->getLastStatus($student->prestudent_id,null,null))?$prestudent->status_kurzbz:''; + $abbrecher = 'false'; + if ($status_aktuell == 'Abbrecher') + { + $ausbildungssemester_titel = "Abgemeldet im Ausbildungssemester"; + $studiensemester_titel = "Abgemeldet im Studiensemester"; + } + else + { + $ausbildungssemester_titel = "Aktuelles Ausbildungssemester"; + $studiensemester_titel = "Abgemeldet im Studiensemester"; + } + echo "\t\t"; echo "\t\tausbildungssemester."]]>"; $studiensemester_aktuell = new studiensemester(); $studiensemester_aktuell->load($studiensemester); + echo "\t\t"; echo "\t\tbezeichnung."]]>"; // check ob Oeh-Beitrag bezahlt wurde @@ -184,15 +198,14 @@ foreach($uid_arr as $uid) $abschluss = $studiensemester_abschluss->jump($prestudent->studiensemester_kurzbz, $studienplan->regelstudiendauer-$prestudent->ausbildungssemester); $studiensemester_abschluss->load($abschluss); echo "\t\tbezeichnung."]]>"; - echo "\t\tende))."]]>"; $studiensemester_endedatum = new studiensemester(); $studiensemester_endedatum->load($studiensemester_endedatum->getaktorNext(1)); - echo "\t\tende))."]]>"; - $status_aktuell = ($prestudent->getLastStatus($student->prestudent_id,null,null))?$prestudent->status_kurzbz:''; + $enddatum = date('d.m.Y',strtotime($studiensemester_abschluss->ende)); + $letztesStudiensemester_datum_titel = 'Voraussichtliches Abschlussdatum'; switch($status_aktuell) { case 'Student': @@ -209,12 +222,22 @@ foreach($uid_arr as $uid) break; case 'Abbrecher': $studierendenstatus_aktuell = 'AbbrecherIn'; + $letztesStudiensemester_datum_titel = 'Abgemeldet am:'; + $enddatum = date('d.m.Y',strtotime($prestudent->bestaetigtam)); + $abbrecher = "true"; break; default: $studierendenstatus_aktuell =''; } + echo "\t\t"; - echo "\t\t\n"; + echo "\t\tende))."]]>"; + + echo "\t\t"; + + echo "\t\t"; + + echo "\t\t\n"; echo "\t\tzgvdatum."]]>\n"; $zgv = new zgv($prestudent->zgv_code); echo "\t\tzgv_kurzbz."]]>\n"; From 3644cc690ca1bc16b1d80cf0c270d5c725fb8a89 Mon Sep 17 00:00:00 2001 From: OliiverHacker Date: Thu, 1 Apr 2021 21:28:27 +0200 Subject: [PATCH 02/28] Put Checks from xml to xsl for Abbrecher --- rdf/studienblatt.xml.php | 87 +++++++++++++++-------------------- system/xsl/Studienblatt_0.xsl | 39 ++++++++++++++-- 2 files changed, 72 insertions(+), 54 deletions(-) diff --git a/rdf/studienblatt.xml.php b/rdf/studienblatt.xml.php index e9e82cbbf..e6cd0f1f0 100644 --- a/rdf/studienblatt.xml.php +++ b/rdf/studienblatt.xml.php @@ -158,54 +158,7 @@ foreach($uid_arr as $uid) echo "\t\t"; $status_aktuell = ($prestudent->getLastStatus($student->prestudent_id,null,null))?$prestudent->status_kurzbz:''; $abbrecher = 'false'; - if ($status_aktuell == 'Abbrecher') - { - $ausbildungssemester_titel = "Abgemeldet im Ausbildungssemester"; - $studiensemester_titel = "Abgemeldet im Studiensemester"; - } - else - { - $ausbildungssemester_titel = "Aktuelles Ausbildungssemester"; - $studiensemester_titel = "Abgemeldet im Studiensemester"; - } - echo "\t\t"; - echo "\t\tausbildungssemester."]]>"; - - $studiensemester_aktuell = new studiensemester(); - $studiensemester_aktuell->load($studiensemester); - - echo "\t\t"; - echo "\t\tbezeichnung."]]>"; - - // check ob Oeh-Beitrag bezahlt wurde - $oehbeitrag = $konto->getOehBeitragGesamt($uid, $studiensemester_aktuell->studiensemester_kurzbz); - echo "\t\t"; - - // check ob Quereinsteiger - $ausbildungssemester = ($prestudent->getFirstStatus($student->prestudent_id, 'Student'))?$prestudent->ausbildungssemester:''; - echo "\t\t"; - - $studiensemester_beginn = new studiensemester(); - $studienbeginn = ($prestudent->getFirstStatus($student->prestudent_id, 'Student'))?$prestudent->studiensemester_kurzbz:''; - $studiensemester_beginn->load($studienbeginn); - - echo "\t\tbezeichnung."]]>"; - echo "\t\tstart))."]]>"; - - $prestudent->getLastStatus($student->prestudent_id,$studiensemester); - $studiensemester_abschluss = new studiensemester(); - $abschluss = $studiensemester_abschluss->jump($prestudent->studiensemester_kurzbz, $studienplan->regelstudiendauer-$prestudent->ausbildungssemester); - $studiensemester_abschluss->load($abschluss); - echo "\t\tbezeichnung."]]>"; - - $studiensemester_endedatum = new studiensemester(); - $studiensemester_endedatum->load($studiensemester_endedatum->getaktorNext(1)); - - $status_aktuell = ($prestudent->getLastStatus($student->prestudent_id,null,null))?$prestudent->status_kurzbz:''; - - $enddatum = date('d.m.Y',strtotime($studiensemester_abschluss->ende)); - $letztesStudiensemester_datum_titel = 'Voraussichtliches Abschlussdatum'; switch($status_aktuell) { case 'Student': @@ -222,7 +175,6 @@ foreach($uid_arr as $uid) break; case 'Abbrecher': $studierendenstatus_aktuell = 'AbbrecherIn'; - $letztesStudiensemester_datum_titel = 'Abgemeldet am:'; $enddatum = date('d.m.Y',strtotime($prestudent->bestaetigtam)); $abbrecher = "true"; break; @@ -231,11 +183,44 @@ foreach($uid_arr as $uid) } echo "\t\t"; + echo "\t\tausbildungssemester."]]>"; + + $studiensemester_aktuell = new studiensemester(); + $studiensemester_aktuell->load($studiensemester); + + echo "\t\tbezeichnung."]]>"; + + // check ob Oeh-Beitrag bezahlt wurde + $oehbeitrag = $konto->getOehBeitragGesamt($uid, $studiensemester_aktuell->studiensemester_kurzbz); + echo "\t\t"; + + // check ob Quereinsteiger + $ausbildungssemester = ($prestudent->getFirstStatus($student->prestudent_id, 'Student'))?$prestudent->ausbildungssemester:''; + echo "\t\t"; + + $studiensemester_beginn = new studiensemester(); + $studienbeginn = ($prestudent->getFirstStatus($student->prestudent_id, 'Student'))?$prestudent->studiensemester_kurzbz:''; + $studiensemester_beginn->load($studienbeginn); + + echo "\t\tbezeichnung."]]>"; + echo "\t\tstart))."]]>"; + + $prestudent->getLastStatus($student->prestudent_id,$studiensemester); + $studiensemester_abschluss = new studiensemester(); + $abschluss = $studiensemester_abschluss->jump($prestudent->studiensemester_kurzbz, $studienplan->regelstudiendauer-$prestudent->ausbildungssemester); + $studiensemester_abschluss->load($abschluss); + echo "\t\tbezeichnung."]]>"; + + $studiensemester_endedatum = new studiensemester(); + $studiensemester_endedatum->load($studiensemester_endedatum->getaktorNext(1)); + + $status_aktuell = ($prestudent->getLastStatus($student->prestudent_id,null,null))?$prestudent->status_kurzbz:''; + + $enddatum = date('d.m.Y',strtotime($studiensemester_abschluss->ende)); + echo "\t\tende))."]]>"; - echo "\t\t"; - - echo "\t\t"; + echo "\t\t"; echo "\t\t\n"; echo "\t\tzgvdatum."]]>\n"; diff --git a/system/xsl/Studienblatt_0.xsl b/system/xsl/Studienblatt_0.xsl index 5d51c6752..dbb692cb4 100644 --- a/system/xsl/Studienblatt_0.xsl +++ b/system/xsl/Studienblatt_0.xsl @@ -426,7 +426,16 @@ xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn - Aktuelles Studiensemester + + + Abgemeldet im Studiensemester + + + + Aktuelles Studiensemester + + + @@ -435,7 +444,17 @@ xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn - Aktuelles Ausbildungssemester + + + Abgemeldet im Ausbildungssemester + + + + Aktuelles Ausbildungssemester + + + + @@ -451,6 +470,9 @@ xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn + + + Voraussichtlich letztes Studiensemester @@ -460,9 +482,20 @@ xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn + + - Voraussichtliches Abschlussdatum + + + Abgemeldet am + + + + Voraussichtliches Abschlussdatum + + + From 48105425fc8093a466813ab68f91914b7e9fe401 Mon Sep 17 00:00:00 2001 From: OliiverHacker Date: Fri, 2 Apr 2021 15:35:36 +0200 Subject: [PATCH 03/28] =?UTF-8?q?Edit=20Studienblatt=20in=20Englisch=20f?= =?UTF-8?q?=C3=BCr=20AbbrecherInnen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- system/xsl/StudienblattEng_0.xsl | 38 +++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/system/xsl/StudienblattEng_0.xsl b/system/xsl/StudienblattEng_0.xsl index bfed01a19..f7da3a5fe 100644 --- a/system/xsl/StudienblattEng_0.xsl +++ b/system/xsl/StudienblattEng_0.xsl @@ -463,7 +463,17 @@ xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn - Current Semester of Study + + + Semester resigned from Study + + + + Current Semester of Study + + + + @@ -482,7 +492,17 @@ xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn - Current Semester in Degree Program + + + Resignation Semester in Degree Program + + + + Current Semester in Degree Program + + + + @@ -516,6 +536,7 @@ xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn + Expected Final Semester of Study @@ -535,9 +556,20 @@ xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn + - Expected Date of Graduation + + + Resignation Date + + + + Expected Date of Graduation + + + + From 35f1b00d7a8d6da2d9b7ebe4aeafe3bd735d1eea Mon Sep 17 00:00:00 2001 From: OliiverHacker Date: Wed, 28 Apr 2021 12:53:57 +0200 Subject: [PATCH 04/28] display correct mitarbeiter ressources --- rdf/ressource.rdf.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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.']]> From 898562e742b64d08e3a9bbcf47187516dee6cd97 Mon Sep 17 00:00:00 2001 From: OliiverHacker Date: Thu, 29 Apr 2021 11:06:51 +0200 Subject: [PATCH 05/28] fix bug when deleting ressource from project --- content/projekt/ressource.xml.php | 8 ++- include/ressource.class.php | 88 +++++++++++++++++++++++++++---- soap/ressource_projekt.soap.php | 6 ++- soap/ressource_projekt.wsdl.php | 2 +- 4 files changed, 88 insertions(+), 16 deletions(-) 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..a0567a5e9 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,71 @@ 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).';'; + + if($this->db_query($qry)) + return true; + else + { + $this->errormsg = 'Fehler beim Löschen der Daten'; + return false; + } + } } ?> diff --git a/soap/ressource_projekt.soap.php b/soap/ressource_projekt.soap.php index 4c1e13dec..065568269 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; @@ -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/"> - + From c0b07ac1d2d3dac8229e58748b3a6855194f0a51 Mon Sep 17 00:00:00 2001 From: OliiverHacker Date: Thu, 29 Apr 2021 11:12:32 +0200 Subject: [PATCH 06/28] fix bug when deleting ressource from projectphasen --- include/ressource.class.php | 10 ++++++++-- soap/ressource_projekt.soap.php | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/include/ressource.class.php b/include/ressource.class.php index a0567a5e9..e01be0df4 100644 --- a/include/ressource.class.php +++ b/include/ressource.class.php @@ -743,9 +743,15 @@ class ressource extends basis_db return false; } - $qry="DELETE FROM fue.tbl_projekt_ressource WHERE ressource_id =".$this->db_add_param($ressource_id, FHC_INTEGER, 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 diff --git a/soap/ressource_projekt.soap.php b/soap/ressource_projekt.soap.php index 065568269..1a9f9b426 100644 --- a/soap/ressource_projekt.soap.php +++ b/soap/ressource_projekt.soap.php @@ -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"; From 2c6d8937f64eb322af4feaac831412b7f7f398d8 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Wed, 12 May 2021 12:48:29 +0200 Subject: [PATCH 07/28] funktion hinzugefuegt um mehrere bewerber abzuweisen und status wird nur angezeigt wenn aktiv --- .../system/infocenter/InfoCenter.php | 56 ++++++++- application/models/crm/Prestudent_model.php | 13 +++ application/models/crm/Statusgrund_model.php | 13 +++ .../models/organisation/Studiengang_model.php | 13 +++ .../views/system/infocenter/infocenter.php | 1 + .../js/infocenter/infocenterPersonDataset.js | 107 ++++++++++++++++++ 6 files changed, 197 insertions(+), 6 deletions(-) diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 43de8bb60..fd3f98320 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -108,7 +108,9 @@ class InfoCenter extends Auth_Controller 'setOnHold' => 'infocenter:rw', 'removeOnHold' => 'infocenter:rw', 'getStudienjahrEnd' => 'infocenter:r', - 'setNavigationMenuArrayJson' => 'infocenter:r' + 'setNavigationMenuArrayJson' => 'infocenter:r', + 'getAbsageData' => 'infocenter:r', + 'saveAbsageForAll' => 'infocenter:rw' ) ); @@ -433,11 +435,14 @@ class InfoCenter extends Auth_Controller * Saves Absage for Prestudent including the reason for the Absage (statusgrund). * inserts Studiensemester and Ausbildungssemester for the new Absage of (chronologically) last status. */ - public function saveAbsage() + public function saveAbsage($prestudent_id = null, $statusgrund = null) { $json = null; - $prestudent_id = $this->input->post('prestudent_id'); - $statusgrund = $this->input->post('statusgrund'); + if (is_null($prestudent_id)) + $prestudent_id = $this->input->post('prestudent_id'); + + if (is_null($statusgrund)) + $statusgrund = $this->input->post('statusgrund'); $lastStatus = $this->PrestudentstatusModel->getLastStatus($prestudent_id); @@ -1427,8 +1432,8 @@ class InfoCenter extends Auth_Controller $this->_sortPrestudents($zgvpruefungen); - $abwstatusgruende = $this->StatusgrundModel->loadWhere(array('status_kurzbz' => self::ABGEWIESENERSTATUS))->retval; - $intstatusgruende = $this->StatusgrundModel->loadWhere(array('status_kurzbz' => self::INTERESSENTSTATUS))->retval; + $abwstatusgruende = $this->StatusgrundModel->getStatus(self::ABGEWIESENERSTATUS, true)->retval; + $intstatusgruende = $this->StatusgrundModel->getStatus(self::INTERESSENTSTATUS)->retval; $data = array ( 'zgvpruefungen' => $zgvpruefungen, @@ -1687,4 +1692,43 @@ class InfoCenter extends Auth_Controller $this->loglib->logError('Studiengang has no mail for sending Freigabe mail'); } } + + public function getAbsageData() + { + $this->load->model('organisation/Studiengang_model', 'StudiengangModel'); + + $statusgruende = $this->StatusgrundModel->getStatus(self::ABGEWIESENERSTATUS, true)->retval; + $studiengaenge = $this->StudiengangModel->getStudiengaengeWithOrgForm(['b', 'm']); + + $data = array ( + 'statusgruende' => $statusgruende, + 'studiengaenge' => $studiengaenge->retval + ); + + $this->outputJsonSuccess($data); + } + + public function saveAbsageForAll() + { + $statusgrund = $this->input->post('statusgrund'); + $studiengang = $this->input->post('studiengang'); + $personen = $this->input->post('personen'); + + if ($statusgrund === 'null' || $studiengang === 'null' || empty($personen)) + $this->terminateWithJsonError("Bitte Statusgrund, Studiengang und Personen auswählen."); + + foreach($personen as $person) + { + $prestudent = $this->PrestudentModel->getPrestudentByStudiengangAndPerson($studiengang, $person); + + if(!hasData($prestudent)) + continue; + + $prestudentData = getData($prestudent); + + $this->saveAbsage($prestudentData[0]->prestudent_id, $statusgrund); + } + + $this->outputJsonSuccess("Success"); + } } diff --git a/application/models/crm/Prestudent_model.php b/application/models/crm/Prestudent_model.php index 2e014800c..41639d0ac 100644 --- a/application/models/crm/Prestudent_model.php +++ b/application/models/crm/Prestudent_model.php @@ -581,4 +581,17 @@ class Prestudent_model extends DB_Model return $this->execQuery($query, array($person_id)); } + + public function getPrestudentByStudiengangAndPerson($studiengang, $person) + { + $query = "SELECT ps.prestudent_id + FROM public.tbl_prestudentstatus pss + JOIN public.tbl_prestudent ps USING(prestudent_id) + JOIN public.tbl_studiengang sg USING(studiengang_kz) + JOIN lehre.tbl_studienplan sp USING(studienplan_id) + WHERE ps.person_id = ? + AND UPPER((sg.typ || sg.kurzbz) || ':' || sp.orgform_kurzbz) = ?"; + + return $this->execQuery($query, array($person, $studiengang)); + } } diff --git a/application/models/crm/Statusgrund_model.php b/application/models/crm/Statusgrund_model.php index 4717a7571..f9b156b76 100644 --- a/application/models/crm/Statusgrund_model.php +++ b/application/models/crm/Statusgrund_model.php @@ -11,4 +11,17 @@ class Statusgrund_model extends DB_Model $this->dbTable = "public.tbl_status_grund"; $this->pk = "statusgrund_id"; } + + public function getStatus($status_kurzbz = null, $aktiv = null) + { + $where = array(); + if (!is_null($status_kurzbz)) + $where['status_kurzbz'] = $status_kurzbz; + if (!is_null($aktiv)) + $where['aktiv'] = $aktiv; + + $status = $this->loadWhere($where); + + return success($status->retval); + } } diff --git a/application/models/organisation/Studiengang_model.php b/application/models/organisation/Studiengang_model.php index 8b8be0366..999fcbbd0 100644 --- a/application/models/organisation/Studiengang_model.php +++ b/application/models/organisation/Studiengang_model.php @@ -481,4 +481,17 @@ class Studiengang_model extends DB_Model return $this->loadWhere($condition); } + + public function getStudiengaengeWithOrgForm($typ) + { + $query = "SELECT DISTINCT (UPPER(sg.typ || sg.kurzbz || ':' || sp.orgform_kurzbz)) AS Studiengang + FROM public.tbl_prestudentstatus pss + JOIN public.tbl_prestudent ps USING(prestudent_id) + JOIN public.tbl_studiengang sg USING(studiengang_kz) + JOIN lehre.tbl_studienplan sp USING(studienplan_id) + WHERE sg.typ IN ? + ORDER BY Studiengang;"; + + return $this->execQuery($query, array($typ)); + } } diff --git a/application/views/system/infocenter/infocenter.php b/application/views/system/infocenter/infocenter.php index 4005518a1..43e326bb5 100644 --- a/application/views/system/infocenter/infocenter.php +++ b/application/views/system/infocenter/infocenter.php @@ -13,6 +13,7 @@ 'ajaxlib' => true, 'filterwidget' => true, 'navigationwidget' => true, + 'dialoglib' => true, 'phrases' => array( 'person' => array('vorname', 'nachname'), 'global' => array('mailAnXversandt'), diff --git a/public/js/infocenter/infocenterPersonDataset.js b/public/js/infocenter/infocenterPersonDataset.js index 87a40c0f1..7ea048b71 100644 --- a/public/js/infocenter/infocenterPersonDataset.js +++ b/public/js/infocenter/infocenterPersonDataset.js @@ -31,6 +31,20 @@ var InfocenterPersonDataset = { var formHtml = '
'; $("#datasetActionsTop").before(formHtml); + var auswahlAbsageToggle = + 'Erweiterte Einstellungen'; + + var auswahlAbsage = + '' + + '' + + ''; + + InfocenterPersonDataset.getAbsageData(); + var studienSemesterHtml = ' ' + @@ -60,6 +74,14 @@ var InfocenterPersonDataset = { "
"+studienSemesterHtml+"
"+ "

"); + $("#datasetActionsBottom").append( + "
"+ + "
"+auswahlAbsageToggle+"
"+ + ""+ + "
" + + "
" + + "
" + ) $("button.incStudiensemester").click(function() { InfocenterPersonDataset.changeStudiensemesterUservar(1); }); @@ -68,6 +90,16 @@ var InfocenterPersonDataset = { InfocenterPersonDataset.changeStudiensemesterUservar(-1); }); + $('button.auswahlAbsageBtn').click(function() + { + InfocenterPersonDataset.saveAbsageForAll(); + }); + + $('a.absageToggle').click(function() + { + $('#absagePunkte').toggle(); + }) + var personcount = 0; FHC_AjaxClient.ajaxCallGet( @@ -203,6 +235,81 @@ var InfocenterPersonDataset = { ); }, + saveAbsageForAll: function() + { + var idsel = $("#filterTableDataset input:checked[name=PersonId\\[\\]]"); + + if(idsel.length <= 0) + return FHC_DialogLib.alertInfo("Bitte wählen Sie die Personen aus."); + + var statusgrund = $('.absgstatusgrund').val(); + var studiengang = $('.auswahlAbsageStg').val(); + + if(statusgrund === 'null' || studiengang === 'null') + return FHC_DialogLib.alertInfo("Bitte den Absagegrund und Studiengang auswählen."); + + var personen = []; + + for (var i = 0; i < idsel.length; i++) + { + personen.push($(idsel[i]).val()); + } + + FHC_AjaxClient.ajaxCallPost( + 'system/infocenter/InfoCenter/saveAbsageForAll', + { + 'statusgrund': statusgrund, + 'studiengang': studiengang, + 'personen' : personen + }, + { + successCallback: function(data, textStatus, jqXHR) { + if (FHC_AjaxClient.isError(data)) + FHC_DialogLib.alertError(FHC_AjaxClient.getError(data)); + + if (FHC_AjaxClient.hasData(data)) + FHC_FilterWidget.reloadDataset(); + + }, + errorCallback: function(jqXHR, textStatus, errorThrown) { + FHC_DialogLib.alertError(textStatus); + } + } + ); + }, + + getAbsageData: function() + { + FHC_AjaxClient.ajaxCallGet( + 'system/infocenter/InfoCenter/getAbsageData', + {}, + { + successCallback: function(data, textStatus, jqXHR) { + if (FHC_AjaxClient.hasData(data)) + { + data = FHC_AjaxClient.getData(data); + $.each(data.statusgruende, function(key, value){ + $('.absgstatusgrund').append($("