From 7344ec63ce2b0af9dda3bf27f4f599b71a451f41 Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 5 Dec 2017 10:07:19 +0100 Subject: [PATCH] =?UTF-8?q?"inofficial"=20grades=20like=20"entschuldigt",?= =?UTF-8?q?=20"unentschuldigt"=20are=20now=20not=20shown=20on=20official?= =?UTF-8?q?=20documents=20(Studienerfolgsbest=C3=A4tigung,=20Zeugnis,=20Di?= =?UTF-8?q?plomasupplement,=20Lehrveranstaltungszeugnis,=20Zertifikat)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/note.class.php | 31 +++++++++++++----- rdf/diplomasupplement.xml.php | 10 +++--- rdf/lehrveranstaltungszeugnis.rdf.php | 4 +-- rdf/lehrveranstaltungszeugnis_ktu.rdf.php | 4 +-- rdf/studienerfolg.rdf.php | 4 +-- rdf/zertifikat.rdf.php | 5 ++- rdf/zeugnis.rdf.php | 6 ++-- system/dbupdate_3.3.php | 40 ++++++++++++++++++++++- 8 files changed, 77 insertions(+), 27 deletions(-) diff --git a/include/note.class.php b/include/note.class.php index 9994c0b38..b10753beb 100644 --- a/include/note.class.php +++ b/include/note.class.php @@ -132,7 +132,7 @@ class note extends basis_db $this->db_add_param($this->anmerkung).', '. $this->db_add_param($this->positiv, FHC_BOOLEAN).','. $this->db_add_param($this->notenwert).','. - $this->db_add_parma($this->aktiv, FHC_BOOLEAN).','. + $this->db_add_param($this->aktiv, FHC_BOOLEAN).','. $this->db_add_param($this->lehre, FHC_BOOLEAN).');'; } else @@ -158,15 +158,21 @@ class note extends basis_db return false; } } - + /** - * Laedt alle Noten + * Laedt alle Noten, inklusive inaktiven Noten + * @param null $offiziell wenn true, werden nur Noten, die auf offiziellen Dokumenten gedruckt weden können, geladen * @return true wenn ok, false wenn Fehler - */ - public function getAll() + */ + public function getAll($offiziell = null) { - $qry = "SELECT * FROM lehre.tbl_note ORDER BY note"; - + $qry = "SELECT * FROM lehre.tbl_note"; + + if(is_bool($offiziell)) + $qry .= " WHERE offiziell = ".$this->db_add_param($offiziell, FHC_BOOLEAN); + + $qry .= " ORDER BY note"; + if($this->db_query($qry)) { while($row = $this->db_fetch_object()) @@ -195,11 +201,18 @@ class note extends basis_db /** * Laedt alle aktive Noten + * @param null $offiziell wenn true, werden nur Noten, die auf offiziellen Dokumenten gedruckt weden können, geladen * @return true wenn ok, false wenn Fehler */ - public function getActive() + public function getActive($offiziell = null) { - $qry = "SELECT * FROM lehre.tbl_note WHERE aktiv = TRUE ORDER BY note"; + $qry = "SELECT * FROM lehre.tbl_note WHERE aktiv = TRUE"; + + + if(is_bool($offiziell)) + $qry .= " AND offiziell = ".$this->db_add_param($offiziell, FHC_BOOLEAN); + + $qry .= " ORDER BY note"; if($this->db_query($qry)) { diff --git a/rdf/diplomasupplement.xml.php b/rdf/diplomasupplement.xml.php index 5899a5151..d50cf1df9 100644 --- a/rdf/diplomasupplement.xml.php +++ b/rdf/diplomasupplement.xml.php @@ -622,7 +622,7 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml") tbl_lehrveranstaltung.bezeichnung, COALESCE(tbl_lehrveranstaltung.bezeichnung_english, tbl_lehrveranstaltung.bezeichnung) as bezeichnung_english, tbl_lehrveranstaltung.semester, tbl_lehrveranstaltung.semesterstunden, tbl_lehrveranstaltung.ects, zeugnis.studiensemester_kurzbz, - zeugnis.note, note.bezeichnung note_bezeichnung, note.anmerkung, sort, tbl_lehrveranstaltung.sws + zeugnis.note, note.bezeichnung note_bezeichnung, note.anmerkung, note.offiziell, sort, tbl_lehrveranstaltung.sws FROM lehre.tbl_zeugnisnote zeugnis JOIN lehre.tbl_note note USING(note) @@ -654,7 +654,7 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml") $arrayLvAusbildungssemester[$row_stud->lehrveranstaltung_id]['ects'] = $row_stud->ects; $arrayLvAusbildungssemester[$row_stud->lehrveranstaltung_id]['sws_lv'] = $row_stud->sws; $arrayLvAusbildungssemester[$row_stud->lehrveranstaltung_id]['studiensemester_kurzbz'] = $row_stud->studiensemester_kurzbz; - $arrayLvAusbildungssemester[$row_stud->lehrveranstaltung_id]['note'] = $row_stud->anmerkung; + $arrayLvAusbildungssemester[$row_stud->lehrveranstaltung_id]['note'] = $db->db_parse_bool($row_stud->offiziell) ? $row_stud->anmerkung : ""; $arrayLvAusbildungssemester[$row_stud->lehrveranstaltung_id]['sort'] = $row_stud->sort; $ects_total += $row_stud->ects; $semester_ects +=$row_stud->ects; @@ -677,7 +677,7 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml") $arrayLvAusbildungssemester[$row_stud->lehrveranstaltung_id]['ects'] = $row_stud->ects; $arrayLvAusbildungssemester[$row_stud->lehrveranstaltung_id]['sws_lv'] = $row_stud->sws; $arrayLvAusbildungssemester[$row_stud->lehrveranstaltung_id]['studiensemester_kurzbz'] = $row_stud->studiensemester_kurzbz; - $arrayLvAusbildungssemester[$row_stud->lehrveranstaltung_id]['note'] = $row_stud->anmerkung; + $arrayLvAusbildungssemester[$row_stud->lehrveranstaltung_id]['note'] = $db->db_parse_bool($row_stud->offiziell) ? $row_stud->anmerkung : ""; $arrayLvAusbildungssemester[$row_stud->lehrveranstaltung_id]['sort'] = $row_stud->sort; } } @@ -857,7 +857,7 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml") $qry_outgoing_note = " SELECT - anmerkung, benotungsdatum, lehrform_kurzbz + anmerkung, offiziell, benotungsdatum, lehrform_kurzbz FROM lehre.tbl_zeugnisnote JOIN tbl_lehrveranstaltung using(lehrveranstaltung_id) @@ -870,7 +870,7 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml") { if($row_outgoing_note = $db->db_fetch_object($result_outgoing_note)) { - $note_outgoing = $row_outgoing_note->anmerkung; + $note_outgoing = $db->db_parse_bool($row_outgoing_note->offiziell) ? $row_outgoing_note->anmerkung : ""; $benotungsdatum_outgoing = $datum->formatDatum($row_outgoing_note->benotungsdatum,'d/m/Y'); $lehrform_kurzbz_outgoing = $row_outgoing_note->lehrform_kurzbz; } diff --git a/rdf/lehrveranstaltungszeugnis.rdf.php b/rdf/lehrveranstaltungszeugnis.rdf.php index 11c8f9545..64e6e93af 100644 --- a/rdf/lehrveranstaltungszeugnis.rdf.php +++ b/rdf/lehrveranstaltungszeugnis.rdf.php @@ -77,7 +77,7 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml") $note_arr = array(); $note = new note(); - $note->getAll(); + $note->getAll($offiziell = true); foreach ($note->result as $n){ $note_arr[$n->note] = $n->anmerkung; $note_bezeichnung_arr[$n->note] = $n->bezeichnung; @@ -236,7 +236,7 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml") $obj = new zeugnisnote(); $obj->load($lehrveranstaltung_id, $uid_arr[$i], $studiensemester_kurzbz); - if ($obj->note) + if ($obj->note && isset($note_arr[$obj->note])) { $note = $note_arr[$obj->note]; $note_bezeichnung = $note_bezeichnung_arr[$obj->note]; diff --git a/rdf/lehrveranstaltungszeugnis_ktu.rdf.php b/rdf/lehrveranstaltungszeugnis_ktu.rdf.php index d560bbf27..23f379984 100644 --- a/rdf/lehrveranstaltungszeugnis_ktu.rdf.php +++ b/rdf/lehrveranstaltungszeugnis_ktu.rdf.php @@ -85,7 +85,7 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml") $note_arr = array(); $note = new note(); - $note->getAll(); + $note->getAll($offiziell = true); foreach ($note->result as $n){ $note_arr[$n->note] = $n->anmerkung; $note_bezeichnung_arr[$n->note] = $n->bezeichnung; @@ -283,7 +283,7 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml") $obj = new zeugnisnote(); $obj->load($lehrveranstaltung_id, $uid_arr[$i], $studiensemester_kurzbz); - if ($obj->note) + if ($obj->note && isset($note_arr[$obj->note])) { $note = $note_arr[$obj->note]; $note_bezeichnung = $note_bezeichnung_arr[$obj->note]; diff --git a/rdf/studienerfolg.rdf.php b/rdf/studienerfolg.rdf.php index 934bc54d0..9799e65e6 100644 --- a/rdf/studienerfolg.rdf.php +++ b/rdf/studienerfolg.rdf.php @@ -218,7 +218,7 @@ function draw_studienerfolg($uid, $studiensemester_kurzbz) { if($row->zeugnis) { - if (trim($row->note)!=='') + if (trim($row->note)!=='' && isset($note_arr[$row->note])) $note = $note_arr[$row->note]; else $note = ""; @@ -297,7 +297,7 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml") $note_arr = array(); $note_wert = array(); $note = new note(); - $note->getAll(); + $note->getAll($offiziell = true); foreach ($note->result as $n) { $note_arr[$n->note] = $n->anmerkung; diff --git a/rdf/zertifikat.rdf.php b/rdf/zertifikat.rdf.php index da1437279..be0923294 100644 --- a/rdf/zertifikat.rdf.php +++ b/rdf/zertifikat.rdf.php @@ -77,11 +77,10 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml") $note_arr = array(); $note = new note(); - $note->getAll(); + $note->getAll($offiziell = true); foreach ($note->result as $n){ $note_arr[$n->note] = $n->anmerkung; $note_bezeichnung_arr[$n->note] = $n->bezeichnung; - } if(isset($_GET['ss'])) $studiensemester_kurzbz = $_GET['ss']; @@ -221,7 +220,7 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml") $obj = new zeugnisnote(); $obj->load($lehrveranstaltung_id, $uid_arr[$i], $studiensemester_kurzbz); - if ($obj->note) + if ($obj->note && isset($note_arr[$obj->note])) { $note = $note_arr[$obj->note]; $note_bezeichnung = $note_bezeichnung_arr[$obj->note]; diff --git a/rdf/zeugnis.rdf.php b/rdf/zeugnis.rdf.php index 32620914f..6458e2964 100644 --- a/rdf/zeugnis.rdf.php +++ b/rdf/zeugnis.rdf.php @@ -81,7 +81,7 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml") $note_arr = array(); $note = new note(); - $note->getAll(); + $note->getAll($offiziell = true); foreach ($note->result as $n) $note_arr[$n->note] = $n->anmerkung; @@ -257,7 +257,7 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml") { if($row->zeugnis) { - if (trim($row->note)!=='') + if (trim($row->note)!=='' && isset($note_arr[$row->note])) $note = $note_arr[$row->note]; else $note = ""; @@ -323,7 +323,7 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml") //$note = $note_arr[$projektarbeit[$row->lehrveranstaltung_id]['note']]; $note = $projektarbeit[$row->lehrveranstaltung_id]['note']; //$nl = str_repeat('\n',($anzahl_nl)); - $xml_fussnote .=' '.(isset($note_arr[$note])?$note_arr[$note]:$note).$nl.''; + $xml_fussnote .=' '.(isset($note_arr[$note])?$note_arr[$note]:"").$nl.''; $xml_fussnote .=' '.$nl.''; $xml_fussnote .=' '.$nl.''; $xml_fussnote .=' '.$nl.''; diff --git a/system/dbupdate_3.3.php b/system/dbupdate_3.3.php index c1b448219..8fd44d28b 100644 --- a/system/dbupdate_3.3.php +++ b/system/dbupdate_3.3.php @@ -426,6 +426,44 @@ if($result = @$db->db_query("SELECT 1 FROM lehre.tbl_note WHERE anmerkung = 'ue' } } +// Spalte offiziell in lehre.tbl_note +if(!$result = @$db->db_query("SELECT offiziell FROM lehre.tbl_note LIMIT 1;")) +{ + $qry = "ALTER TABLE lehre.tbl_note ADD COLUMN offiziell boolean NOT NULL DEFAULT true;"; + + if(!$db->db_query($qry)) + echo 'lehre.tbl_note: '.$db->db_last_error().'
'; + else + echo '
lehre.tbl_note: Spalte offiziell hinzugefuegt!
'; +} + +// Spalte bezeichnung_mehrsprachig in lehre.tbl_note +if(!$result = @$db->db_query("SELECT bezeichnung_mehrsprachig FROM lehre.tbl_note LIMIT 1")) +{ + $qry = "ALTER TABLE lehre.tbl_note ADD COLUMN bezeichnung_mehrsprachig varchar(64)[];"; + + if(!$db->db_query($qry)) + echo 'lehre.tbl_note '.$db->db_last_error().'
'; + else + echo 'lehre.tbl_note: Spalte bezeichnung_mehrsprachig hinzugefuegt!
'; + + // Bezeichnung_mehrsprachig aus existierender Bezeichnung vorausfuellen. Ein Eintrag fuer jede Sprache mit Content aktiv. + $qry_help = "SELECT index FROM public.tbl_sprache WHERE content=TRUE;"; + if(!$result = $db->db_query($qry_help)) + echo 'tbl_note bezeichnung_mehrsprachig: Fehler beim ermitteln der Sprachen: '.$db->db_last_error().''; + else + { + $qry=''; + while($row = $db->db_fetch_object($result)) + $qry.= "UPDATE lehre.tbl_note set bezeichnung_mehrsprachig[".$row->index."] = bezeichnung;"; + + if(!$db->db_query($qry)) + echo 'Setzen der bezeichnung_mehrsprachig fehlgeschlagen: '.$db->db_last_error().'
'; + else + echo 'lehre.tbl_note: bezeichnung_mehrprachig automatisch aus existierender Bezeichnung uebernommen
'; + } +} + // Column design_uid, betrieb_uid and operativ_uid to tbl_service if(!$result = @$db->db_query("SELECT design_uid FROM public.tbl_service LIMIT 1;")) { @@ -925,7 +963,7 @@ $tabellen=array( "lehre.tbl_notenschluessel" => array("notenschluessel_kurzbz","bezeichnung"), "lehre.tbl_notenschluesselaufteilung" => array("notenschluesselaufteilung_id","notenschluessel_kurzbz","note","punkte"), "lehre.tbl_notenschluesselzuordnung" => array("notenschluesselzuordnung_id","notenschluessel_kurzbz","lehrveranstaltung_id","studienplan_id","oe_kurzbz","studiensemester_kurzbz"), - "lehre.tbl_note" => array("note","bezeichnung","anmerkung","farbe","positiv","notenwert","aktiv","lehre"), + "lehre.tbl_note" => array("note","bezeichnung","anmerkung","farbe","positiv","notenwert","aktiv","lehre","offiziell","bezeichnung_mehrsprachig"), "lehre.tbl_projektarbeit" => array("projektarbeit_id","projekttyp_kurzbz","titel","lehreinheit_id","student_uid","firma_id","note","punkte","beginn","ende","faktor","freigegeben","gesperrtbis","stundensatz","gesamtstunden","themenbereich","anmerkung","updateamum","updatevon","insertamum","insertvon","ext_id","titel_english","seitenanzahl","abgabedatum","kontrollschlagwoerter","schlagwoerter","schlagwoerter_en","abstract", "abstract_en", "sprache","final"), "lehre.tbl_projektbetreuer" => array("person_id","projektarbeit_id","betreuerart_kurzbz","note","faktor","name","punkte","stunden","stundensatz","updateamum","updatevon","insertamum","insertvon","ext_id","vertrag_id"), "lehre.tbl_projekttyp" => array("projekttyp_kurzbz","bezeichnung"),