From 5488bfbc28cfba7c6c3769600e3b415700efbbb6 Mon Sep 17 00:00:00 2001 From: Cris Date: Tue, 12 Nov 2019 17:42:51 +0100 Subject: [PATCH 01/42] Amended 'Hilfe zu dieser Seite' information for Lehrauftrag akzeptieren Added information about filter and selection. --- .../lehre/lehrauftrag/acceptLehrauftrag.php | 39 ++++++++++++++++--- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/application/views/lehre/lehrauftrag/acceptLehrauftrag.php b/application/views/lehre/lehrauftrag/acceptLehrauftrag.php index 951dbfadf..5d1924c92 100644 --- a/application/views/lehre/lehrauftrag/acceptLehrauftrag.php +++ b/application/views/lehre/lehrauftrag/acceptLehrauftrag.php @@ -48,23 +48,52 @@ $this->load->view(

Wie nehme ich Lehraufträge an?

-

Sobald Ihnen ein oder mehrere Lehraufträge erteilt wurden, können Sie diese annehmen.

  1. Klicken Sie unten auf das Status-Icon 'Nur erteilte anzeigen' oder 'Alle anzeigen'
  2. -
  3. Wählen Sie einzelne Lehraufträge mit Klick auf die Zeilen oder alle über den Button 'Alle auswählen'.
  4. +
  5. Wählen Sie die Lehraufträge, die Sie annehmen möchten, selbst oder alle über den Button 'Alle auswählen'.
  6. Geben Sie Ihr CIS-Passwort ein und klicken auf Lehrauftrag annehmen.
-


+

Warum kann ich manche Lehraufträge nicht auswählen?

-

Nur Lehraufträge mit dem Status 'erteilt' können gewählt werden.
Angenommene Lehraufträge oder Lehraufträge in Bearbeitung werden nur zu Ihrer Information angezeigt. -

+
+ +

Filter

+
+
+ + + + + + + + + + + + + +
Alle
Alle Lehraufträge mit jedem Status
Bestellt
Nur bestellte UND bestellte Lehraufträge, die in Bearbeitung sind
Erteilt
Nur erteilte UND geänderte Lehraufträge, die in Bearbeitung sind
Angenommen
Nur von Ihnen angenommene Lehraufträge
+
+
+
+ +

Auswahl

+
+
    +
  • Einzeln auswählen: Strg + Klick auf einzelne Zeile(n)
  • +
  • Bereich auswählen: Shift + Klick auf Anfangs- und Endzeile
  • +
  • Alle auswählen: Button 'Alle auswählen'
  • +
+
+
From 7bc8255787244b6a7611019818100dccbdb9baac Mon Sep 17 00:00:00 2001 From: Cris Date: Tue, 12 Nov 2019 17:51:18 +0100 Subject: [PATCH 02/42] Added fixed column width to all betrag- and all status-columns --- .../lehre/lehrauftrag/acceptLehrauftragData.php | 12 ++++++------ .../lehre/lehrauftrag/approveLehrauftragData.php | 8 ++++---- .../views/lehre/lehrauftrag/orderLehrauftragData.php | 8 ++++---- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/application/views/lehre/lehrauftrag/acceptLehrauftragData.php b/application/views/lehre/lehrauftrag/acceptLehrauftragData.php index 0999d7ae6..caa221685 100644 --- a/application/views/lehre/lehrauftrag/acceptLehrauftragData.php +++ b/application/views/lehre/lehrauftrag/acceptLehrauftragData.php @@ -357,14 +357,14 @@ $filterWidgetArray = array( orgform_kurzbz: {headerFilter:"input"}, person_id: {visible: false}, typ: {headerFilter:"input", width: "7%"}, - auftrag: {headerFilter:"input", width: "23%"}, + auftrag: {headerFilter:"input", width: "15%"}, semester: {headerFilter:"input"}, - lv_oe_kurzbz: {headerFilter:"input", width: "12%"}, + lv_oe_kurzbz: {headerFilter:"input", width: "8%"}, gruppe: {headerFilter:"input", width: "5%"}, stunden: {align:"right", formatter: form_formatNulltoStringNumber, formatterParams:{precision:1}, headerFilter:"input", headerFilterFunc: hf_filterStringnumberWithOperator, bottomCalc:"sum", bottomCalcParams:{precision:1}, width: "5%"}, - betrag: {align:"right", formatter: form_formatNulltoStringNumber, + betrag: {align:"right", width: "6%", formatter: form_formatNulltoStringNumber, headerFilter:"input", headerFilterFunc: hf_filterStringnumberWithOperator, bottomCalc:"sum", bottomCalcParams:{precision:2}, bottomCalcFormatter:"money", bottomCalcFormatterParams:{decimal: ",", thousand: ".", symbol:"€"}, width: "8%"}, @@ -372,9 +372,9 @@ $filterWidgetArray = array( vertrag_stunden: {visible: false}, vertrag_betrag: {visible: false}, mitarbeiter_uid: {visible: false}, - bestellt: {align:"center", headerFilter:"input", mutator: mut_formatStringDate, tooltip: bestellt_tooltip}, - erteilt: {align:"center", headerFilter:"input", mutator: mut_formatStringDate, tooltip: erteilt_tooltip}, - akzeptiert: {align:"center", headerFilter:"input", mutator: mut_formatStringDate, tooltip: akzeptiert_tooltip}, + bestellt: {align:"center", headerFilter:"input", mutator: mut_formatStringDate, tooltip: bestellt_tooltip, width: "8%"}, + erteilt: {align:"center", headerFilter:"input", mutator: mut_formatStringDate, tooltip: erteilt_tooltip, width: "8%"}, + akzeptiert: {align:"center", headerFilter:"input", mutator: mut_formatStringDate, tooltip: akzeptiert_tooltip, width: "8%"}, bestellt_von: {visible: false}, erteilt_von: {visible: false}, akzeptiert_von: {visible: false} diff --git a/application/views/lehre/lehrauftrag/approveLehrauftragData.php b/application/views/lehre/lehrauftrag/approveLehrauftragData.php index 616450a5c..da472a680 100644 --- a/application/views/lehre/lehrauftrag/approveLehrauftragData.php +++ b/application/views/lehre/lehrauftrag/approveLehrauftragData.php @@ -385,16 +385,16 @@ $filterWidgetArray = array( stunden: {align:"right", formatter: form_formatNulltoStringNumber, formatterParams:{precision:1}, headerFilter:"input", headerFilterFunc: hf_filterStringnumberWithOperator, bottomCalc:"sum", bottomCalcParams:{precision:1}}, - betrag: {align:"right", formatter: form_formatNulltoStringNumber, + betrag: {align:"right", width: "8%", formatter: form_formatNulltoStringNumber, headerFilter:"input", headerFilterFunc: hf_filterStringnumberWithOperator, bottomCalc:"sum", bottomCalcParams:{precision:2}, bottomCalcFormatter:"money", bottomCalcFormatterParams:{decimal: ",", thousand: ".", symbol:"€"}}, vertrag_id: {visible: false}, vertrag_stunden: {visible: false}, vertrag_betrag: {visible: false}, mitarbeiter_uid: {visible: false}, - bestellt: {align:"center", headerFilter:"input", mutator: mut_formatStringDate, tooltip: bestellt_tooltip}, - erteilt: {align:"center", headerFilter:"input", mutator: mut_formatStringDate, tooltip: erteilt_tooltip}, - akzeptiert: {align:"center", headerFilter:"input", mutator: mut_formatStringDate, tooltip: akzeptiert_tooltip}, + bestellt: {align:"center", headerFilter:"input", mutator: mut_formatStringDate, tooltip: bestellt_tooltip, width: "8%"}, + erteilt: {align:"center", headerFilter:"input", mutator: mut_formatStringDate, tooltip: erteilt_tooltip, width: "8%"}, + akzeptiert: {align:"center", headerFilter:"input", mutator: mut_formatStringDate, tooltip: akzeptiert_tooltip, width: "8%"}, bestellt_von: {visible: false}, erteilt_von: {visible: false}, akzeptiert_von: {visible: false}, diff --git a/application/views/lehre/lehrauftrag/orderLehrauftragData.php b/application/views/lehre/lehrauftrag/orderLehrauftragData.php index 2abf658e8..0373a2193 100644 --- a/application/views/lehre/lehrauftrag/orderLehrauftragData.php +++ b/application/views/lehre/lehrauftrag/orderLehrauftragData.php @@ -390,7 +390,7 @@ $filterWidgetArray = array( headerFilter:"input", headerFilterFunc: hf_filterStringnumberWithOperator, bottomCalc:"sum", bottomCalcParams:{precision:1}}, stundensatz: {visible: false}, - betrag: {align:"right", formatter: form_formatNulltoStringNumber, + betrag: {align:"right", width: "8%", formatter: form_formatNulltoStringNumber, headerFilter:"input", headerFilterFunc: hf_filterStringnumberWithOperator, bottomCalc:"sum", bottomCalcParams:{precision:2}, bottomCalcFormatter:"money", bottomCalcFormatterParams:{decimal: ",", thousand: ".", symbol:"€"}}, @@ -398,9 +398,9 @@ $filterWidgetArray = array( vertrag_stunden: {visible: false}, vertrag_betrag: {visible: false}, mitarbeiter_uid: {visible: false}, - bestellt: {align:"center", headerFilter:"input", mutator: mut_formatStringDate, tooltip: bestellt_tooltip}, - erteilt: {align:"center", headerFilter:"input", mutator: mut_formatStringDate, tooltip: erteilt_tooltip}, - akzeptiert: {align:"center", headerFilter:"input", mutator: mut_formatStringDate, tooltip: akzeptiert_tooltip}, + bestellt: {align:"center", headerFilter:"input", mutator: mut_formatStringDate, tooltip: bestellt_tooltip, width: "8%"}, + erteilt: {align:"center", headerFilter:"input", mutator: mut_formatStringDate, tooltip: erteilt_tooltip, width: "8%"}, + akzeptiert: {align:"center", headerFilter:"input", mutator: mut_formatStringDate, tooltip: akzeptiert_tooltip, width: "8%"}, bestellt_von: {visible: false}, erteilt_von: {visible: false}, akzeptiert_von: {visible: false}, From 4da3062c00179dd21212925d4ff39bb201b9528a Mon Sep 17 00:00:00 2001 From: Cris Date: Mon, 25 Nov 2019 08:38:01 +0100 Subject: [PATCH 03/42] Added LV-ID to group-header title --- public/js/lehre/lehrauftrag/approveLehrauftrag.js | 2 +- public/js/lehre/lehrauftrag/orderLehrauftrag.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/public/js/lehre/lehrauftrag/approveLehrauftrag.js b/public/js/lehre/lehrauftrag/approveLehrauftrag.js index 2cc42abd0..da3697adf 100644 --- a/public/js/lehre/lehrauftrag/approveLehrauftrag.js +++ b/public/js/lehre/lehrauftrag/approveLehrauftrag.js @@ -96,7 +96,7 @@ function func_initialFilter(){ // ----------------------------------------------------------------------------------------------------------------- // Formats the group header function func_groupHeader(data){ - return data[0].lv_bezeichnung; // change name to lehrveranstaltung + return data[0].lv_bezeichnung + "  " + ' ( LV-ID: ' + data[0].lehrveranstaltung_id + ' )'; // change name to lehrveranstaltung; }; // Formats the rows diff --git a/public/js/lehre/lehrauftrag/orderLehrauftrag.js b/public/js/lehre/lehrauftrag/orderLehrauftrag.js index dfcc46636..d27da0e4e 100644 --- a/public/js/lehre/lehrauftrag/orderLehrauftrag.js +++ b/public/js/lehre/lehrauftrag/orderLehrauftrag.js @@ -100,9 +100,9 @@ function func_dataLoaded(data, table){ // Tabulator table format functions // ----------------------------------------------------------------------------------------------------------------- // Formats the group header -function func_groupHeader(data){ - return data[0].lv_bezeichnung; // change name to lehrveranstaltung -}; +function func_groupHeader(data) { + return data[0].lv_bezeichnung + "  " + ' ( LV-ID: ' + data[0].lehrveranstaltung_id + ' )'; // change name to lehrveranstaltung; +} // Formats the rows function func_rowFormatter(row){ From df555426a0a070959dcd551f048c87f67417976e Mon Sep 17 00:00:00 2001 From: Cris Date: Mon, 25 Nov 2019 08:39:53 +0100 Subject: [PATCH 04/42] Changed: column STG-type is visible now --- application/views/lehre/lehrauftrag/approveLehrauftragData.php | 2 +- application/views/lehre/lehrauftrag/orderLehrauftragData.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/application/views/lehre/lehrauftrag/approveLehrauftragData.php b/application/views/lehre/lehrauftrag/approveLehrauftragData.php index da472a680..59964a955 100644 --- a/application/views/lehre/lehrauftrag/approveLehrauftragData.php +++ b/application/views/lehre/lehrauftrag/approveLehrauftragData.php @@ -373,7 +373,7 @@ $filterWidgetArray = array( projektarbeit_id: {visible: false}, studiensemester_kurzbz: {headerFilter:"input"}, studiengang_kz: {visible: false}, - stg_typ_kurzbz: {visible: false}, + stg_typ_kurzbz: {headerFilter:"input", width: "5%"}, orgform_kurzbz: {headerFilter:"input"}, person_id: {visible: false}, typ: {headerFilter:"input"}, diff --git a/application/views/lehre/lehrauftrag/orderLehrauftragData.php b/application/views/lehre/lehrauftrag/orderLehrauftragData.php index 0373a2193..9c3437599 100644 --- a/application/views/lehre/lehrauftrag/orderLehrauftragData.php +++ b/application/views/lehre/lehrauftrag/orderLehrauftragData.php @@ -377,7 +377,7 @@ $filterWidgetArray = array( projektarbeit_id: {visible: false}, studiensemester_kurzbz: {headerFilter:"input"}, studiengang_kz: {visible: false}, - stg_typ_kurzbz: {visible: false}, + stg_typ_kurzbz: {headerFilter:"input", width: "5%"}, orgform_kurzbz: {headerFilter:"input"}, person_id: {visible: false}, typ: {headerFilter:"input"}, From ea09dfda58f7efbb4c77a12d900123e65eefd559 Mon Sep 17 00:00:00 2001 From: Cris Date: Mon, 25 Nov 2019 08:43:46 +0100 Subject: [PATCH 05/42] =?UTF-8?q?Optimized=20text=20of=20'Hilfe=20f=C3=BCr?= =?UTF-8?q?=20diese=20Seite'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added information for lectors page. Some minor text enhancements to avoid misunderstanding. --- application/views/lehre/lehrauftrag/approveLehrauftrag.php | 2 +- application/views/lehre/lehrauftrag/orderLehrauftrag.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/application/views/lehre/lehrauftrag/approveLehrauftrag.php b/application/views/lehre/lehrauftrag/approveLehrauftrag.php index 61cdd124d..71c1840c6 100644 --- a/application/views/lehre/lehrauftrag/approveLehrauftrag.php +++ b/application/views/lehre/lehrauftrag/approveLehrauftrag.php @@ -116,7 +116,7 @@ $this->load->view( Bestellt
Nur bestellte UND geänderte bestellte Lehraufträge Erteilt
Nur erteilte UND geänderte erteilte Lehraufträge Angenommen
Nur vom Lehrenden angenommene Lehraufträge - Geändert
Nur geänderte Lehraufträge, die den Status 'bestellt' oder 'erteilt' haben + Geändert
Nur Lehraufträge, die geändert wurden, nachdem sie bereits bestellt oder erteilt worden sind Dummies
Nur Lehraufträge, die mit einem Dummylektor angelegt sind diff --git a/application/views/lehre/lehrauftrag/orderLehrauftrag.php b/application/views/lehre/lehrauftrag/orderLehrauftrag.php index abcb3dbc4..8938a305c 100644 --- a/application/views/lehre/lehrauftrag/orderLehrauftrag.php +++ b/application/views/lehre/lehrauftrag/orderLehrauftrag.php @@ -86,6 +86,7 @@ $this->load->view(

Geänderte Lehraufträge

Im FAS können Änderungen an Stunden/Stundensatz eines Lehrauftrags durchgeführt werden, solange dieser nicht vom Lehrenden angenommen wurde.
+ Diese müssen dann erneut bestellt werden.

Wenn Änderungen an bereits bestellten oder erteilten Lehraufträgen vorgenommen wurden, werden diese in einem tooltip angezeigt.
Fahren Sie dazu mit der Maus über dem Status-Icon am Beginn der Zeile.
@@ -117,7 +118,7 @@ $this->load->view( Bestellt
Nur bestellte UND geänderte bestellte Lehraufträge Erteilt
Nur erteilte UND geänderte erteilte Lehraufträge Angenommen
Nur vom Lehrenden angenommene Lehraufträge - Geändert
Nur geänderte Lehraufträge, die den Status 'bestellt' oder 'erteilt' haben + Geändert
Nur Lehraufträge, die geändert wurden, nachdem sie bereits bestellt oder erteilt worden sind Dummies
Nur Lehraufträge, die mit einem Dummylektor angelegt sind From 0a335b7627e737847dbfb1b493acde5d974366a0 Mon Sep 17 00:00:00 2001 From: Cris Date: Mon, 25 Nov 2019 08:46:31 +0100 Subject: [PATCH 06/42] Added cronjob mailLehrauftraegeToApprove() This daily job sends information about all lehr-/projektauftraege ordered (and not approved) the day bofore. Receivers: Department-/Kompetenzfeldleiter --- .../controllers/jobs/LehrauftragJob.php | 426 ++++++++++++++++++ 1 file changed, 426 insertions(+) create mode 100644 application/controllers/jobs/LehrauftragJob.php diff --git a/application/controllers/jobs/LehrauftragJob.php b/application/controllers/jobs/LehrauftragJob.php new file mode 100644 index 000000000..780c592e1 --- /dev/null +++ b/application/controllers/jobs/LehrauftragJob.php @@ -0,0 +1,426 @@ +load->model('accounting/Vertrag_model', 'VertragModel'); + $this->load->model('accounting/Vertragvertragsstatus_model', 'VertragvertragsstatusModel'); + $this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel'); + $this->load->model('person/Benutzerfunktion_model', 'BenutzerfunktionModel'); + $this->load->model('system/Benutzerrolle_model', 'BenutzerrolleModel'); + + // Load libraries + $this->load->library('PermissionLib'); + + // Load helpers + $this->load->helper('hlp_sancho_helper'); + } + + /** + * This daily job sends information about all lehr-/projektauftraege ordered (and not approved) the day bofore. + * Receivers: Department-/Kompetenzfeldleiter + **/ + public function mailLehrauftraegeToApprove() + { + // Get vertrag_ids of lehrauftraege that had been ordered and had NOT been approved or cancelled YESTERDAY + $this->VertragvertragsstatusModel->addSelect('vertrag_id'); + $result = $this->VertragvertragsstatusModel->getOrdered_fromDate('YESTERDAY'); + + // Get lehrveranstaltung_ids and studiensemester of the lehr-/or projektauftrag contracts + $lehreinheit_data_arr = array(); + if ($vertrag_arr = getData($result)) + { + foreach ($vertrag_arr as $vertrag) + { + $result = $this->VertragModel->getLehreinheitData($vertrag->vertrag_id, 'lehrveranstaltung_id, studiensemester_kurzbz'); + + if (hasData($result)) + { + $obj = new StdClass(); + $obj->lehrveranstaltung_id = $result->retval[0]->lehrveranstaltung_id; + $obj->studiensemester_kurzbz = $result->retval[0]->studiensemester_kurzbz; + $lehreinheit_data_arr []= $obj; + } + } + } + + /** + * Build the data array to be used in the email. Data array is clustered as follows: + * Array + * [studiensemester_kurzbz] // studiensemester of lehreinheit + * Array + * [oe_kurzbz] // oe of lehreinheits lehrveranstaltung + * [oe_bezeichnung] + * Array + * [stg_kz] // stg of lehreinheits lehrveranstaltung + * [stg_kurzbz] + * [stg_bezeichnung] + * [amount] // amount of new ordered lehrauftraege of that stg + */ + $data_arr = array(); + foreach ($lehreinheit_data_arr as $lehreinheit_data) + { + $result = $this->_getLVData($lehreinheit_data->lehrveranstaltung_id); + + if (hasData($result)) + { + // Search if studiensemester exists in data_arr + $ss_index = array_search($lehreinheit_data->studiensemester_kurzbz, array_column($data_arr, 'studiensemester_kurzbz')); + + // If studiensemester is new, add studienesemester, oe and stg + if ($ss_index === false) + { + $data = array( + 'studiensemester_kurzbz' => $lehreinheit_data->studiensemester_kurzbz + ); + + $data []= array( + 'oe_kurzbz' => $result->retval[0]->oe_kurzbz, + 'oe_bezeichnung' => $result->retval[0]->lv_oe_bezeichnung + ); + + // Add stg data to oe, start amount with 1 + $data[0][] = array( + 'stg_kz' => $result->retval[0]->studiengang_kz, + 'stg_kurzbz' => strtoupper($result->retval[0]->stg_typ. $result->retval[0]->stg_kurzbz), + 'stg_bezeichnung' => $result->retval[0]->lv_stg_bezeichnung, + 'amount' => 1 + ); + + // Push to final data_arr + $data_arr []= $data; + } + // Else if studiensemester exists + else + { + // Search if oe exists inside existing studiensemester of data_arr + $oe_index = array_search($result->retval[0]->oe_kurzbz, array_column($data_arr[$ss_index], 'oe_kurzbz')); + + // If oe is new, add oe and stg to studiensemester + if ($oe_index === false) + { + // Add oe data + $data_arr[$ss_index][] = array( + 'oe_kurzbz' => $result->retval[0]->oe_kurzbz, + 'oe_bezeichnung' => $result->retval[0]->lv_oe_bezeichnung, + + // Add stg data to oe, start amount with 1 + array( + 'stg_kz' => $result->retval[0]->studiengang_kz, + 'stg_kurzbz' => strtoupper($result->retval[0]->stg_typ. $result->retval[0]->stg_kurzbz), + 'stg_bezeichnung' => $result->retval[0]->lv_stg_bezeichnung, + 'amount' => 1 + ) + ); + } + // Else if oe exists + else + { + // Search if stg exists inside existing oe of data_arr + $stg_index = array_search($result->retval[0]->studiengang_kz, array_column($data_arr[$ss_index][$oe_index], 'stg_kz')); + + // If stg is new, add stg to oe, start amount with 1 + if ($stg_index === false) + { + $data_arr[$ss_index][$oe_index][] = array( + 'stg_kz' => $result->retval[0]->studiengang_kz, + 'stg_kurzbz' => strtoupper($result->retval[0]->stg_typ. $result->retval[0]->stg_kurzbz), + 'stg_bezeichnung' => $result->retval[0]->lv_stg_bezeichnung, + 'amount' => 1 + ); + } + // Else if stg exists + else + { + // Increase amount +1 + $data_arr[$ss_index][$oe_index][$stg_index]['amount'] = $data_arr[$ss_index][$oe_index][$stg_index]['amount'] + 1; + } + } + } + } + } + + /** + * Cluster data by uid of entitled mail receivers. + * Returning array is clustered as follows: + * Array + * [uid] + * Array + * [studiensemester_kurzbz] // studiensemester of lehreinheit + * Array + * [oe_kurzbz] // oe of lehreinheits lehrveranstaltung + * [oe_bezeichnung] + * Array + * [stg_kz] // stg of lehreinheits lehrveranstaltung + * [stg_kurzbz] + * [stg_bezeichnung] + * [amount] // amount of new ordered lehrauftraege of that stg + */ + $data_arr = $this->_clusterData_byReceiver($data_arr); + + // Send email + if(!$this->_sendMail($data_arr)) + { + $this->logError('Fehler beim Mailversand in Job MailLehrauftragToApprove'); + } + } + + /** + * This daily job sends information about all lehr-/projektauftraege approved the day bofore. + * Receivers: lectors + **/ + public function mailLehrauftraegeToAccept() + { + + } + + //****************************************************************************************************************** + // PRIVATE FUNCTIONS + //****************************************************************************************************************** + + /** + * Get data of given lehrveranstaltung. + * @param $lehrveranstaltung_id + * @return mixed + */ + private function _getLVData($lehrveranstaltung_id) + { + $this->LehrveranstaltungModel->addSelect(' + tbl_lehrveranstaltung.oe_kurzbz, + oe.bezeichnung AS "lv_oe_bezeichnung", + tbl_lehrveranstaltung.studiengang_kz, + stg.bezeichnung AS "lv_stg_bezeichnung", + stg.typ AS "stg_typ", + stg.kurzbz AS "stg_kurzbz" + '); + + $this->LehrveranstaltungModel->addJoin('lehre.tbl_studienplan_lehrveranstaltung stpllv', 'lehrveranstaltung_id'); + $this->LehrveranstaltungModel->addJoin('lehre.tbl_studienplan stpl', 'studienplan_id'); + $this->LehrveranstaltungModel->addJoin('lehre.tbl_studienordnung sto', 'studienordnung_id'); + $this->LehrveranstaltungModel->addJoin('public.tbl_studiengang stg', 'ON stg.studiengang_kz = tbl_lehrveranstaltung.studiengang_kz'); + $this->LehrveranstaltungModel->addJoin('public.tbl_organisationseinheit oe', 'ON oe.oe_kurzbz = tbl_lehrveranstaltung.oe_kurzbz'); + $this->LehrveranstaltungModel->addOrder('stpllv.insertamum', 'DESC'); + $this->LehrveranstaltungModel->addLimit(1); + + return $this->LehrveranstaltungModel->load($lehrveranstaltung_id); + } + + /** + * Send Sancho eMail about ordered Lehrauftraege. + * @param $data_arr + */ + private function _sendMail($data_arr) + { + // Loop through 'container' of mail recipients + foreach($data_arr as $data) + { + // Set mail recipients (department assistance/leader) + $to = $data['uid']. '@'. DOMAIN; + $html_table = $this->_renderData_LehrauftraegeToApprove($data); + + // Prepare mail content + $content_data_arr = array( + 'table' => $html_table + ); + + sendSanchoMail( + 'LehrauftragNeueBestellungen', + $content_data_arr, + $to, + 'Bestellung neuer Lehraufträge', + 'sancho_header_min_bw.jpg', + 'sancho_footer_min_bw.jpg' + ); + } + } + + /** + * Cluster the data array by entitled mail receiver. + * Returning array is clustered as follows: + * Array + * [uid] + * Array + * [studiensemester_kurzbz] // studiensemester of lehreinheit + * Array + * [oe_kurzbz] // oe of lehreinheits lehrveranstaltung + * [oe_bezeichnung] + * Array + * [stg_kz] // stg of lehreinheits lehrveranstaltung + * [stg_kurzbz] + * [stg_bezeichnung] + * [amount] // amount of new ordered lehrauftraege of that stg + * @param $data_arr + * @return array + * + */ + private function _clusterData_byReceiver($data_arr) + { + $mail_data_arr = array(); // final array with all data clustered by mail receiver + + // Loop through 'container' of studiensemester + foreach ($data_arr as $data) + { + $data_len = count($data) - 1; + + // Loop through 'container' of organisational units + for ($i = 0; $i < $data_len; $i++) + { + // Get all users entitled by organisational unit + $result = $this->BenutzerrolleModel->getBenutzerByBerechtigung(self::BERECHTIGUNG_LEHRAUFTRAG_ERTEILEN, $data[$i]['oe_kurzbz']); + + if ($berechtigung_arr = getData($result)) + { + // Loop through entitled users + foreach ($berechtigung_arr as $berechtigung) + { + // Search if UID exists inside mail_data_arr + $uid_index = array_search($berechtigung->uid, array_column($mail_data_arr, 'uid')); + + // If UID is new, add UID to final array + if ($uid_index === false) + { + // add UID with corresponding data + $mail_data_arr [] = array( + 'uid' => $berechtigung->uid, + array( + 'studiensemester_kurzbz' => $data['studiensemester_kurzbz'], + $data[$i] + ) + ); + } // Else if UID exists + else + { + // Search if studiensemester exists + $ss_index = array_search($data['studiensemester_kurzbz'], array_column($mail_data_arr, 'studiensemester_kurzbz')); + + // If studiensemester is new, add studiensemester to existing UID + if ($ss_index === false) + { + $mail_data_arr[$uid_index] []= array( + 'studiensemester_kurzbz' => $data['studiensemester_kurzbz'], + $data[$i] + ); + } + // Else if studiensemester exists + else + { + // Add corresponding data to existing studiensemester of UID + $mail_data_arr[$uid_index]['studiensemester_kurbz'][] = $data[$i]; + } + + } + } + } + } + } + + return $mail_data_arr; + } + + /** + * Render the data array for the mail template returing a HTML table. + * @param $data_arr Data to be used in HTML table + * @return string HTML table to be embedded in eMail + */ + private function _renderData_LehrauftraegeToApprove($data_arr) + { + $html = ''; + foreach ($data_arr as $studiensemester_container) + { + if (is_array($studiensemester_container)) // is_array 'trims' the outer associative key [uid] + { + if (isset($studiensemester_container['studiensemester_kurzbz'])) + { + $studiensemester = $studiensemester_container['studiensemester_kurzbz']; + + // Link to LehrauftragErteilen + $url = site_url(self::LEHRAUFTRAG_ERTEILEN_URI).'?studiensemester='. $studiensemester; + } + + // HTML table header + $html .= ' +
+ Studiensemester: '. $studiensemester. ' +

+ + + + + + + + + + ' + ; + + // HTML table body + foreach ($studiensemester_container as $oe_container) + { + if (is_array($oe_container)) // is_array 'trims' the outer associative key [studiensemester_kurzbz] + { + if (isset($oe_container['oe_bezeichnung'])) + { + $oe_bezeichnung = $oe_container['oe_bezeichnung']; + } + + foreach ($oe_container as $stg_data) + { + if (is_array($stg_data)) // is_array 'trims' the outer associative keys [oe_kurzbz] and [oe_bezeichnung] + { + $html .= ' + + + + + + + '; + } + } + } + } + + // HTML table body end and link + $html .= ' + +
LV-OrganisationseinheitStudiengangSTG-KurzbezeichnungAnzahl neu bestellter Lehraufträge
'. $oe_bezeichnung. ''. $stg_data['stg_bezeichnung']. ''. $stg_data['stg_kurzbz']. ''. $stg_data['amount']. '
+
+ '. anchor($url, 'Lehraufträge Übersicht '. $studiensemester). ' +

+ '; + } + } + + return $html; + } +} From 24db32f65843b06dadeff3a5728d02fed94baa4c Mon Sep 17 00:00:00 2001 From: Cris Date: Mon, 25 Nov 2019 08:55:30 +0100 Subject: [PATCH 07/42] Added function getOrdered_fromDate() to Vertragvertragsstatus_model This method returns all contracts, where the status had been set to 'bestellt' on given date. --- .../Vertragvertragsstatus_model.php | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/application/models/accounting/Vertragvertragsstatus_model.php b/application/models/accounting/Vertragvertragsstatus_model.php index 7e76ef494..ad9cef423 100644 --- a/application/models/accounting/Vertragvertragsstatus_model.php +++ b/application/models/accounting/Vertragvertragsstatus_model.php @@ -130,5 +130,32 @@ class Vertragvertragsstatus_model extends DB_Model ); } - + /** + * Get all contracts, where the status had been set to 'bestellt' on given date + * @param string $string_date e.g. '01.11.2019' or special Date/Time inputs like 'YESTERDAY', 'TODAY', 'NOW' + * @param bool $further_processed If true, ALL ordered contracts of that day are retrieved, even if they were + * were ALSO approved/accepted/cancelled (further processed) on that same day. + * @return array + */ + public function getOrdered_fromDate($string_date = 'TODAY', $further_processed = false) + { + $condition = ' + vertragsstatus_kurzbz = \'bestellt\' AND + (insertamum)::date = date \''. $string_date .'\' + '; + + if (!$further_processed) + { + $condition .= ' + AND + vertrag_id NOT IN ( + SELECT vertrag_id + FROM lehre.tbl_vertrag_vertragsstatus + WHERE vertragsstatus_kurzbz IN (\'erteilt\', \'akzeptiert\', \'storno\') + ) + '; + } + + return $this->loadWhere($condition); + } } From 586c626ff05aa38068e28f9d55a3c7ca96ccf4ba Mon Sep 17 00:00:00 2001 From: Cris Date: Mon, 25 Nov 2019 09:35:42 +0100 Subject: [PATCH 08/42] Fixed: Corrected incorrect SQL query in Benutzerfunktion_model Incorrect bracket was causing error message. This is fixed now. --- application/models/person/Benutzerfunktion_model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/models/person/Benutzerfunktion_model.php b/application/models/person/Benutzerfunktion_model.php index 30abfdf51..ceb427687 100644 --- a/application/models/person/Benutzerfunktion_model.php +++ b/application/models/person/Benutzerfunktion_model.php @@ -48,7 +48,7 @@ class Benutzerfunktion_model extends DB_Model if (is_string($funktion_kurzbz)) { - $query .= " AND funktion_kurzbz = ".$funktion_kurzbz.")"; + $query .= " AND funktion_kurzbz = '".$funktion_kurzbz."'"; } elseif (is_array($funktion_kurzbz) && count($funktion_kurzbz) > 0) { From 94bafe4d6d719cf22a93758ce681ece5657baf56 Mon Sep 17 00:00:00 2001 From: Cris Date: Mon, 25 Nov 2019 17:11:41 +0100 Subject: [PATCH 09/42] =?UTF-8?q?Fixed=20cancel-error-msg=20&=20wrong=20st?= =?UTF-8?q?atus=20'ge=C3=A4ndert'=20by=20adding=20permission?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before the assistance was receiving error msg when cancelling a contract. Also study program leader and assistance got wrong status displayed. This was due to missing permission check in vertrag.rdf.php and is fixed now. --- rdf/vertrag.rdf.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rdf/vertrag.rdf.php b/rdf/vertrag.rdf.php index 5f1eea221..e2f45b61f 100644 --- a/rdf/vertrag.rdf.php +++ b/rdf/vertrag.rdf.php @@ -31,7 +31,7 @@ $uid = get_uid(); $rechte = new benutzerberechtigung(); $rechte->getBerechtigungen($uid); -if(!$rechte->isBerechtigt('vertrag/mitarbeiter')) +if(!$rechte->isBerechtigt('vertrag/mitarbeiter') && !$rechte->isBerechtigt('lehre/lehrauftrag_bestellen')) die('Sie haben keine Berechtigung für diese Seite'); $datum_obj = new datum(); From 45e381e0430d102f19cba1511ff55316c5c0048c Mon Sep 17 00:00:00 2001 From: hainberg Date: Tue, 26 Nov 2019 14:41:27 +0100 Subject: [PATCH 10/42] Added function getApproved_fromDate() to Vertragvertragsstatus_model This method returns all contracts, where the status had been set to 'erteilt' on given date. --- .../Vertragvertragsstatus_model.php | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/application/models/accounting/Vertragvertragsstatus_model.php b/application/models/accounting/Vertragvertragsstatus_model.php index ad9cef423..33ac3f87f 100644 --- a/application/models/accounting/Vertragvertragsstatus_model.php +++ b/application/models/accounting/Vertragvertragsstatus_model.php @@ -158,4 +158,33 @@ class Vertragvertragsstatus_model extends DB_Model return $this->loadWhere($condition); } + + /** + * Get all contracts, where the status had been set to 'erteilt' on given date + * @param string $string_date e.g. '01.11.2019' or special Date/Time inputs like 'YESTERDAY', 'TODAY', 'NOW' + * @param bool $further_processed If true, ALL contracts approved on that day are retrieved, even if they were + * were ALSO accepted/cancelled (further processed) on that same day. + * @return array + */ + public function getApproved_fromDate($string_date = 'TODAY', $further_processed = false) + { + $condition = ' + vertragsstatus_kurzbz = \'erteilt\' AND + (insertamum)::date = date \''. $string_date .'\' + '; + + if (!$further_processed) + { + $condition .= ' + AND + vertrag_id NOT IN ( + SELECT vertrag_id + FROM lehre.tbl_vertrag_vertragsstatus + WHERE vertragsstatus_kurzbz IN (\'akzeptiert\', \'storno\') + ) + '; + } + + return $this->loadWhere($condition); + } } From a93ddfbe3d0a0092a01d82e783124cdf73fa9777 Mon Sep 17 00:00:00 2001 From: Cris Date: Tue, 26 Nov 2019 14:44:24 +0100 Subject: [PATCH 11/42] Added cronjob mailLehrauftraegeToAccept() This daily job sends information about all lehr-/projektauftraege approved (and not accepted/cancelled) the day bofore. Receivers: lectors --- .../controllers/jobs/LehrauftragJob.php | 106 +++++++++++++++++- 1 file changed, 105 insertions(+), 1 deletion(-) diff --git a/application/controllers/jobs/LehrauftragJob.php b/application/controllers/jobs/LehrauftragJob.php index 780c592e1..b265bdc6c 100644 --- a/application/controllers/jobs/LehrauftragJob.php +++ b/application/controllers/jobs/LehrauftragJob.php @@ -200,7 +200,67 @@ class LehrauftragJob extends JOB_Controller **/ public function mailLehrauftraegeToAccept() { - + // Get vertrag_id and uid of lehrauftraege that had been approved and had NOT been accepted or cancelled YESTERDAY + $this->VertragvertragsstatusModel->addSelect('vertrag_id, uid'); + $this->VertragvertragsstatusModel->addOrder('uid'); + $result = $this->VertragvertragsstatusModel->getApproved_fromDate('YESTERDAY'); + + /** + * Build the data array to be used in the email. Data array is clustered as follows: + * Array + * [uid] // lectors uid (mail receiver) + * [studiensemester] // studiensemester of the lehrauftraege (can be more, e.g. 'WS2019 and SS2020') + * [amount] // amount of new approved lehrauftraege + **/ + if ($vertrag_arr = getData($result)) + { + $data_arr = array(); + foreach ($vertrag_arr as $vertrag) + { + // Get studiensemester of the lehrauftrag + $this->VertragModel->addSelect('vertragsstunden_studiensemester_kurzbz'); + $result = $this->VertragModel->load($vertrag->vertrag_id); + if ($studiensemester = getData($result)) + { + $studiensemester = $studiensemester[0]->vertragsstunden_studiensemester_kurzbz; + } + + // Search if uid exists in data_arr + $uid_index = array_search($vertrag->uid, array_column($data_arr, 'uid')); + + // If uid is new, add uid, studiensemester and start amount with 1 + if ($uid_index === false) + { + $data = array(); + $data['uid'] = $vertrag->uid; + $data['studiensemester'] = $studiensemester; + $data['amount']= 1; + $data_arr []= $data; + } + // Else if uid exists + else + { + // If studiensemester is new, add to studiensemester-string + if (strpos($data_arr[$uid_index]['studiensemester'], $studiensemester) === false) + { + $data_arr[$uid_index]['studiensemester'] .= ' und '. $studiensemester; + } + + // Increase amount +1 + $data_arr[$uid_index]['amount']++; + } + } + } + + // Send email + if ($this->_sendMail_toAccept($data_arr)) + { + $this->logInfo('SUCCEDED: Sending emails about yesterdays approved lehrauftraege succeded.'); + } + else + { + $this->logError('Error when sending emails in job MailLehrauftragToAccept'); + } } //****************************************************************************************************************** @@ -423,4 +483,48 @@ class LehrauftragJob extends JOB_Controller return $html; } + + /** + * Send Sancho eMail about ordered Lehrauftraege. + * @param $data_arr + */ + private function _sendMail_toAccept($data_arr) + { + // Loop through 'container' of mail recipients + foreach($data_arr as $data) + { + // Set mail recipient (lector) + $to = $data['uid']. '@'. DOMAIN; + + // Link to LehrauftragAkzeptieren + $url = site_url(self::LEHRAUFTRAG_AKZEPTIEREN_URI); + + // Get first name + $first_name = ''; + $this->load->model('person/Benutzer_model', 'BenutzerModel'); + $this->BenutzerModel->addSelect('vorname'); + $this->BenutzerModel->addJoin('public.tbl_person', 'person_id'); + $result = $this->BenutzerModel->loadWhere(array('uid' => $data['uid'])); + + if (hasData($result)) + { + $first_name = $result->retval[0]->vorname; + } + + // Prepare mail content + $content_data_arr = array( + 'vorname' => $first_name, + 'studiensemester' => $data['studiensemester'], + 'anzahl' => $data['amount'], + 'link' => anchor($url, 'Lehraufträge Übersicht') + ); + + sendSanchoMail( + 'LehrauftragNeueErteilte', + $content_data_arr, + $to, + 'Neu erteilte Lehraufträge zum Annehmen bereit' + ); + } + } } From bc4bebb39f33668024f0e3452a9e273a53b082c8 Mon Sep 17 00:00:00 2001 From: Cris Date: Tue, 26 Nov 2019 14:46:28 +0100 Subject: [PATCH 12/42] Minor changes in job MailLehrauftragToApprove Optimized code, added logInfo. --- application/controllers/jobs/LehrauftragJob.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/application/controllers/jobs/LehrauftragJob.php b/application/controllers/jobs/LehrauftragJob.php index b265bdc6c..e0a5fad27 100644 --- a/application/controllers/jobs/LehrauftragJob.php +++ b/application/controllers/jobs/LehrauftragJob.php @@ -162,7 +162,7 @@ class LehrauftragJob extends JOB_Controller else { // Increase amount +1 - $data_arr[$ss_index][$oe_index][$stg_index]['amount'] = $data_arr[$ss_index][$oe_index][$stg_index]['amount'] + 1; + $data_arr[$ss_index][$oe_index][$stg_index]['amount']++; } } } @@ -188,9 +188,13 @@ class LehrauftragJob extends JOB_Controller $data_arr = $this->_clusterData_byReceiver($data_arr); // Send email - if(!$this->_sendMail($data_arr)) + if(!$this->_sendMail_toApprove($data_arr)) { - $this->logError('Fehler beim Mailversand in Job MailLehrauftragToApprove'); + $this->logInfo('SUCCEDED: Sending emails about yesterdays ordered lehrauftraege succeded.'); + } + else + { + $this->logError('Error when sending emails in job MailLehrauftragToApprove'); } } @@ -298,7 +302,7 @@ class LehrauftragJob extends JOB_Controller * Send Sancho eMail about ordered Lehrauftraege. * @param $data_arr */ - private function _sendMail($data_arr) + private function _sendMail_toApprove($data_arr) { // Loop through 'container' of mail recipients foreach($data_arr as $data) From 74af42cfe632414a099319675bc6f3a2a7b91d12 Mon Sep 17 00:00:00 2001 From: alex Date: Mon, 9 Dec 2019 09:52:03 +0100 Subject: [PATCH 13/42] Zertfikat TLC Workshops: - aded studiengang_kz of Lehrveranstaltung to rdf and Lehrveranstaltung so correct Vorlage is used for Zertifikat - renamed context entry "Freifaecher-Zertifikat erstellen" to "Zertifikat erstellen" --- .../lehrveranstaltungnotenoverlay.xul.php | 655 +++++++++--------- .../lvplanung/lehrveranstaltungoverlay.js.php | 2 +- rdf/zeugnisnote.rdf.php | 1 + 3 files changed, 332 insertions(+), 326 deletions(-) diff --git a/content/lvplanung/lehrveranstaltungnotenoverlay.xul.php b/content/lvplanung/lehrveranstaltungnotenoverlay.xul.php index d9cdaa49b..55fd91bfd 100644 --- a/content/lvplanung/lehrveranstaltungnotenoverlay.xul.php +++ b/content/lvplanung/lehrveranstaltungnotenoverlay.xul.php @@ -1,325 +1,330 @@ -, - * Andreas Oesterreicher and - * Rudolf Hangl . - */ - -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'); -require_once('../../config/global.config.inc.php'); - - -if(defined('CIS_GESAMTNOTE_PUNKTE') && CIS_GESAMTNOTE_PUNKTE) - $punktehidden = 'false'; -else - $punktehidden = 'true'; - -echo ''; - -echo ""; -?> - - - - - - - - - - - - - - + +
@@ -162,6 +167,28 @@ $this->load->view(
+
+
+ + +
+
+

+ p->t('global', 'stornierteLehrauftraege')); ?>: + + + + + +

+
+
+ load->view('lehre/lehrauftrag/cancelledLehrauftragData.php'); ?> +
+
+
+
+
From ef3eedb989dcb078e2b36a455bb664b834ad6037 Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 18 Dec 2019 14:37:38 +0100 Subject: [PATCH 35/42] Added data query and tabulator for 'Stornierte Lehrauftraege' This file is triggered within the view acceptLehrauftrag.php. It displays information about the lectors cancelled contracts: - Vertragstyp - Bezeichnung - Stunden - Betrag - Storno Datum - Storno von --- .../lehrauftrag/cancelledLehrauftragData.php | 104 ++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 application/views/lehre/lehrauftrag/cancelledLehrauftragData.php diff --git a/application/views/lehre/lehrauftrag/cancelledLehrauftragData.php b/application/views/lehre/lehrauftrag/cancelledLehrauftragData.php new file mode 100644 index 000000000..ec286ced2 --- /dev/null +++ b/application/views/lehre/lehrauftrag/cancelledLehrauftragData.php @@ -0,0 +1,104 @@ + $query, + 'tableUniqueId' => 'cancelledLehrauftrag', + 'requiredPermissions' => 'lehre/lehrauftrag_akzeptieren', + 'datasetRepresentation' => 'tabulator', + 'reloadDataset' => true, // reload query on page refresh + 'columnsAliases' => array( // TODO: use phrasen + 'Status', + 'Studiensemester', + 'Typ', + 'LV- / Projektbezeichnung', + 'Stunden', + 'Betrag', + 'Storniert am' + ), + 'datasetRepOptions' => '{ + layout: "fitColumns", // fit columns to width of table + responsiveLayout: "hide", // hide columns that dont fit on the table + movableColumns: true, // allows changing column + rowFormatter:function(row){ + func_rowFormatter(row); + }, + selectableCheck: function(row){ + return func_selectableCheck(row); + }, + renderComplete:function(){ + func_renderComplete(this); + }, + tableBuilt: function(){ + func_tableBuilt(this); + } + }', // tabulator properties + 'datasetRepFieldsDefs' => '{ + vertrag_id: {visible: false}, + vertragsstunden_studiensemester_kurzbz: {visible: false}, + vertragstyp_kurzbz: {widthGrow: 2}, + bezeichnung: {widthGrow: 2}, + vertragsstunden: { + align:"right", formatter: form_formatNulltoStringNumber, formatterParams:{precision:1}, + bottomCalc:"sum", bottomCalcParams:{precision:1} + }, + betrag: { + align:"right", formatter: form_formatNulltoStringNumber, + bottomCalc:"sum", bottomCalcParams:{precision:2}, bottomCalcFormatter:"money", bottomCalcFormatterParams:{decimal: ",", thousand: ".", symbol:"€"} + }, + storniert: {align:"center", mutator: mut_formatStringDate, tooltip: storniert_tooltip}, + storniert_von: {visible: false}, + letzterStatus_vorStorniert: {visible: false} + }', // col properties +); + +echo $this->widgetlib->widget('TableWidget', $tableWidgetArray); + +?> From 34a55e2332012290df56ad29a8d64f7e75975cac Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 18 Dec 2019 14:48:53 +0100 Subject: [PATCH 36/42] Added/Adapted JS functions for 'Stornierte Lehrauftraege' - redrawed tabulator when opening the collapsed module. Must be done to display stornierte lehrauftraege. - generated storniert-tooltip - generated storniert-status icon - adapted selectableCheck to leave stornierte unselectable --- .../js/lehre/lehrauftrag/acceptLehrauftrag.js | 225 ++++++++++-------- 1 file changed, 130 insertions(+), 95 deletions(-) diff --git a/public/js/lehre/lehrauftrag/acceptLehrauftrag.js b/public/js/lehre/lehrauftrag/acceptLehrauftrag.js index ea96a8c7c..00750430f 100644 --- a/public/js/lehre/lehrauftrag/acceptLehrauftrag.js +++ b/public/js/lehre/lehrauftrag/acceptLehrauftrag.js @@ -17,7 +17,7 @@ const COLOR_LIGHTGREY = "#f5f5f5"; const ICON_LEHRAUFTRAG_ORDERED = ''; const ICON_LEHRAUFTRAG_APPROVED = ''; const ICON_LEHRAUFTRAG_CHANGED = ''; - +const ICON_LEHRAUFTRAG_CANCELLED = ''; // ----------------------------------------------------------------------------------------------------------------- // Mutators - setter methods to manipulate table data when entering the tabulator @@ -134,10 +134,12 @@ function func_selectableCheck(row){ var betrag = parseFloat(row.getData().betrag); var vertrag_betrag = parseFloat(row.getData().vertrag_betrag); - if (isNaN(betrag)) - { - betrag = 0; - } + var is_storniert = row.getData().storniert != undefined; + + if (isNaN(betrag)) + { + betrag = 0; + } // only allow to select bestellte && erteilte && nicht geaenderte Lehraufträge return row.getData().bestellt != null && // bestellt @@ -149,18 +151,18 @@ function func_selectableCheck(row){ // Adds column status function func_tableBuilt(table) { - // Add status column to table - table.addColumn( - { - title: "", - field: "status", - width:40, - align:"center", - downloadTitle: 'Status', - formatter: status_formatter, - tooltip: status_tooltip - }, true - ); + // Add status column to table + table.addColumn( + { + title: "", + field: "status", + width:40, + align:"center", + downloadTitle: 'Status', + formatter: status_formatter, + tooltip: status_tooltip + }, true + ); } // Sets status values into column status @@ -311,9 +313,10 @@ function func_rowSelectionChanged(data, rows){ // Generates status icons status_formatter = function(cell, formatterParams, onRendered){ - var bestellt = cell.getRow().getData().bestellt; - var erteilt = cell.getRow().getData().erteilt; - var akzeptiert = cell.getRow().getData().akzeptiert; + var bestellt = cell.getRow().getData().bestellt; + var erteilt = cell.getRow().getData().erteilt; + var akzeptiert = cell.getRow().getData().akzeptiert; + var is_storniert = cell.getRow().getData().storniert != undefined; var stunden = parseFloat(cell.getRow().getData().stunden); var vertrag_stunden = parseFloat(cell.getRow().getData().vertrag_stunden); @@ -326,47 +329,54 @@ status_formatter = function(cell, formatterParams, onRendered){ betrag = 0; } - // commented icons would be so nice to have with fontawsome 5.11... - if (bestellt != null && isNaN(vertrag_betrag)) - { - return ""; // kein Vertrag - } - else if (bestellt != null && (betrag != vertrag_betrag) || - bestellt != null && stunden != vertrag_stunden) - { - return ICON_LEHRAUFTRAG_CHANGED; // geaendert - // return ""; - } - else if (bestellt == null && erteilt == null && akzeptiert == null) - { - return ""; // neu - } - else if (bestellt != null && erteilt == null && akzeptiert == null) - { - return ICON_LEHRAUFTRAG_ORDERED; // bestellt - // return ""; - } - else if (bestellt != null && erteilt != null && akzeptiert == null) - { - return ICON_LEHRAUFTRAG_APPROVED; // erteilt - // return ""; - } - else if (bestellt != null && erteilt != null && akzeptiert != null) - { - return ""; // akzeptiert - // return ""; - } - else - { - return ""; // default - } + // commented icons would be so nice to have with fontawsome 5.11... + if (bestellt != null && isNaN(vertrag_betrag)) + { + return ""; // kein Vertrag + } + else if (bestellt != null && (betrag != vertrag_betrag) || + bestellt != null && stunden != vertrag_stunden) + { + return ICON_LEHRAUFTRAG_CHANGED; // geaendert + // return ""; + } + else if (bestellt == null && erteilt == null && akzeptiert == null && !is_storniert) + { + return ""; // neu + } + else if (bestellt != null && erteilt == null && akzeptiert == null) + { + return ICON_LEHRAUFTRAG_ORDERED; // bestellt + // return ""; + } + else if (bestellt != null && erteilt != null && akzeptiert == null) + { + return ICON_LEHRAUFTRAG_APPROVED; // erteilt + // return ""; + } + else if (bestellt != null && erteilt != null && akzeptiert != null) + { + return ""; // akzeptiert + // return ""; + } + else if (is_storniert) + { + return ICON_LEHRAUFTRAG_CANCELLED; // storniert + } + else + { + return ""; // default + } }; // Generates status tooltip status_tooltip = function(cell){ - var bestellt = cell.getRow().getData().bestellt; - var erteilt = cell.getRow().getData().erteilt; - var akzeptiert = cell.getRow().getData().akzeptiert; + var bestellt = cell.getRow().getData().bestellt; + var erteilt = cell.getRow().getData().erteilt; + var akzeptiert = cell.getRow().getData().akzeptiert; + var is_storniert = cell.getRow().getData().storniert != undefined; + var letzterStatus_vorStorniert = cell.getRow().getData().letzterStatus_vorStorniert; + var stunden = parseFloat(cell.getRow().getData().stunden); var vertrag_stunden = parseFloat(cell.getRow().getData().vertrag_stunden); @@ -379,32 +389,42 @@ status_tooltip = function(cell){ betrag = 0; } - var text = 'Lehrauftrag in Bearbeitung. '; + if (letzterStatus_vorStorniert != undefined && letzterStatus_vorStorniert == 'akzeptiert') + { + letzterStatus_vorStorniert = 'angenommen'; + } - if (bestellt != null && erteilt == null && akzeptiert == null - && (betrag != vertrag_betrag || stunden != vertrag_stunden)) // geaendert (when never erteilt before) - { - text += 'Wartet auf Erteilung.'; - return text; - } - else if (bestellt != null && erteilt != null && akzeptiert == null - && (betrag != vertrag_betrag || stunden != vertrag_stunden)) // geaendert (when has been erteilt once) - { - text += 'Wartet auf erneute Erteilung.'; - return text; - } - else if (bestellt != null && erteilt == null && akzeptiert == null) // bestellt - { - return 'Letzter Status: Bestellt. Wartet auf Erteilung.'; - } - else if (bestellt != null && erteilt != null && akzeptiert == null) // erteilt - { - return 'Letzter Status: Erteilt. Wartet auf Annahme durch Lektor.'; - } - else if (bestellt != null && erteilt != null && akzeptiert != null) // akzeptiert - { - return 'Letzter Status: Angenommen. Vertrag wurde beidseitig abgeschlossen.'; - } + var text = 'Lehrauftrag in Bearbeitung. '; + + if (bestellt != null && erteilt == null && akzeptiert == null + && (betrag != vertrag_betrag || stunden != vertrag_stunden)) // geaendert (when never erteilt before) + { + text += 'Wartet auf Erteilung.'; + return text; + } + else if (bestellt != null && erteilt != null && akzeptiert == null + && (betrag != vertrag_betrag || stunden != vertrag_stunden)) // geaendert (when has been erteilt once) + { + text += 'Wartet auf erneute Erteilung.'; + return text; + } + else if (bestellt != null && erteilt == null && akzeptiert == null) // bestellt + { + return 'Letzter Status: Bestellt. Wartet auf Erteilung.'; + } + else if (bestellt != null && erteilt != null && akzeptiert == null) // erteilt + { + return 'Letzter Status: Erteilt. Wartet auf Annahme durch Lektor.'; + } + else if (bestellt != null && erteilt != null && akzeptiert != null) // akzeptiert + { + return 'Letzter Status: Angenommen. Vertrag wurde beidseitig abgeschlossen.'; + } + else if (is_storniert) + { + return 'Dieser Vertrag wurde storniert. Letzter Status vor Stornierung war: ' + + letzterStatus_vorStorniert; // storniert + } } // Generates bestellt tooltip @@ -429,6 +449,13 @@ akzeptiert_tooltip = function(cell){ } } +// Generates storniert tooltip +storniert_tooltip = function(cell){ + if (cell.getRow().getData().storniert_von != null) { + return 'Storniert von: ' + cell.getRow().getData().storniert_von; + } +} + $(function() { // Show all rows @@ -468,17 +495,20 @@ $(function() { ); }); - // Set png-icons into filter-buttons - $(".btn-lehrauftrag").each(function(){ - switch(this.id) { - case 'show-ordered': - this.innerHTML = ICON_LEHRAUFTRAG_ORDERED; - break; - case 'show-approved': - this.innerHTML = ICON_LEHRAUFTRAG_APPROVED; - break; - } - }); + // Set png-icons into filter-buttons + $(".btn-lehrauftrag").each(function(){ + switch(this.id) { + case 'show-ordered': + this.innerHTML = ICON_LEHRAUFTRAG_ORDERED; + break; + case 'show-approved': + this.innerHTML = ICON_LEHRAUFTRAG_APPROVED; + break; + case 'show-cancelled': + this.innerHTML = ICON_LEHRAUFTRAG_CANCELLED; + break; + } + }); // De/activate and un/focus on clicked button $(".btn-lehrauftrag").click(function() { @@ -488,8 +518,13 @@ $(function() { $(this).addClass('focus').addClass('active'); }); - // Approve Lehrauftraege - $("#accept-lehrauftraege").click(function(){ + // Redraw table stornierte lehrauftraege on button click + $('#collapseCancelledLehrauftraege').on('shown.bs.collapse', function () { + $('[tableuniqueid = cancelledLehrauftrag] #tableWidgetTabulator').tabulator('redraw', true); + }); + + // Approve Lehrauftraege + $("#accept-lehrauftraege").click(function(){ // Get selected rows data var selected_data = $('#tableWidgetTabulator').tabulator('getSelectedData') From 627ad0e499ad1629d6f2c38c0f4140517fbbd8a0 Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 18 Dec 2019 14:49:52 +0100 Subject: [PATCH 37/42] Added phrase 'Stornierte Lehrauftraege' to phrasesupdate --- system/phrasesupdate.php | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 4ec315575..a2af8b1a8 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -4074,7 +4074,27 @@ When on hold, the date is only a reminder.', 'insertvon' => 'system' ) ) - ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'stornierteLehrauftraege', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Stornierte Lehraufträge', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Cancelled lectureships', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ) ); From 4b33f6c0bd7210da10e021602edc346d112b949a Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 18 Dec 2019 14:51:45 +0100 Subject: [PATCH 38/42] Minor code prettyfying (tabs instead whitespaces, line wraps) --- .../lehre/lehrauftrag/acceptLehrauftrag.php | 18 +- .../js/lehre/lehrauftrag/acceptLehrauftrag.js | 578 +++++++++--------- 2 files changed, 302 insertions(+), 294 deletions(-) diff --git a/application/views/lehre/lehrauftrag/acceptLehrauftrag.php b/application/views/lehre/lehrauftrag/acceptLehrauftrag.php index 7e4e01aef..e575fd680 100644 --- a/application/views/lehre/lehrauftrag/acceptLehrauftrag.php +++ b/application/views/lehre/lehrauftrag/acceptLehrauftrag.php @@ -133,7 +133,7 @@ $this->load->view( - +
load->view('lehre/lehrauftrag/acceptLehrauftragData.php'); ?> @@ -146,10 +146,18 @@ $this->load->view(
'; - footer_html += '
'; + footer_html += ''; - footer_html += ''; + footer_html += ''; - footer_html += '
'; - footer_html += '
'; + footer_html += ''; + footer_html += ''; - return footer_html; + return footer_html; } // Performs download CSV function footer_downloadCSV(){ - $('#tableWidgetTabulator').tabulator("download", "csv", "data.csv", {bom:true}); // BOM for correct UTF-8 char output + $('#tableWidgetTabulator').tabulator("download", "csv", "data.csv", {bom:true}); // BOM for correct UTF-8 char output } /* @@ -286,12 +287,12 @@ function footer_downloadCSV(){ * Select all (filtered) rows and ignore rows that are bestellt and erteilt */ function footer_selectAll(){ - $('#tableWidgetTabulator').tabulator('getRows', true) - .filter(row => row.getData().bestellt != null && // bestellt - row.getData().erteilt != null && // AND erteilt - row.getData().akzeptiert == null && // AND NOT akzeptiert - row.getData().status != 'Geändert') // AND NOT geändert - .forEach((row => row.select())); + $('#tableWidgetTabulator').tabulator('getRows', true) + .filter(row => row.getData().bestellt != null && // bestellt + row.getData().erteilt != null && // AND erteilt + row.getData().akzeptiert == null && // AND NOT akzeptiert + row.getData().status != 'Geändert') // AND NOT geändert + .forEach((row => row.select())); } /* @@ -299,12 +300,12 @@ function footer_selectAll(){ * Deselect all (filtered) rows */ function footer_deselectAll(){ - $('#tableWidgetTabulator').tabulator('deselectRow'); + $('#tableWidgetTabulator').tabulator('deselectRow'); } // Displays number of selected rows on row selection change function func_rowSelectionChanged(data, rows){ - $('#number-selected').html("Für Annehmen ausgewählt: " + rows.length + ""); + $('#number-selected').html("Für Annehmen ausgewählt: " + rows.length + ""); } // ----------------------------------------------------------------------------------------------------------------- @@ -318,16 +319,16 @@ status_formatter = function(cell, formatterParams, onRendered){ var akzeptiert = cell.getRow().getData().akzeptiert; var is_storniert = cell.getRow().getData().storniert != undefined; - var stunden = parseFloat(cell.getRow().getData().stunden); - var vertrag_stunden = parseFloat(cell.getRow().getData().vertrag_stunden); + var stunden = parseFloat(cell.getRow().getData().stunden); + var vertrag_stunden = parseFloat(cell.getRow().getData().vertrag_stunden); - var betrag = parseFloat(cell.getRow().getData().betrag); - var vertrag_betrag = parseFloat(cell.getRow().getData().vertrag_betrag); + var betrag = parseFloat(cell.getRow().getData().betrag); + var vertrag_betrag = parseFloat(cell.getRow().getData().vertrag_betrag); - if (isNaN(betrag)) - { - betrag = 0; - } + if (isNaN(betrag)) + { + betrag = 0; + } // commented icons would be so nice to have with fontawsome 5.11... if (bestellt != null && isNaN(vertrag_betrag)) @@ -378,16 +379,16 @@ status_tooltip = function(cell){ var letzterStatus_vorStorniert = cell.getRow().getData().letzterStatus_vorStorniert; - var stunden = parseFloat(cell.getRow().getData().stunden); - var vertrag_stunden = parseFloat(cell.getRow().getData().vertrag_stunden); + var stunden = parseFloat(cell.getRow().getData().stunden); + var vertrag_stunden = parseFloat(cell.getRow().getData().vertrag_stunden); - var betrag = parseFloat(cell.getRow().getData().betrag); - var vertrag_betrag = parseFloat(cell.getRow().getData().vertrag_betrag); + var betrag = parseFloat(cell.getRow().getData().betrag); + var vertrag_betrag = parseFloat(cell.getRow().getData().vertrag_betrag); - if (isNaN(betrag)) - { - betrag = 0; - } + if (isNaN(betrag)) + { + betrag = 0; + } if (letzterStatus_vorStorniert != undefined && letzterStatus_vorStorniert == 'akzeptiert') { @@ -429,24 +430,24 @@ status_tooltip = function(cell){ // Generates bestellt tooltip bestellt_tooltip = function(cell){ - if (cell.getRow().getData().bestellt_von != null) - { - return 'Bestellt von: ' + cell.getRow().getData().bestellt_von; - } + if (cell.getRow().getData().bestellt_von != null) + { + return 'Bestellt von: ' + cell.getRow().getData().bestellt_von; + } } // Generates erteilt tooltip erteilt_tooltip = function(cell){ - if (cell.getRow().getData().erteilt_von != null) { - return 'Erteilt von: ' + cell.getRow().getData().erteilt_von; - } + if (cell.getRow().getData().erteilt_von != null) { + return 'Erteilt von: ' + cell.getRow().getData().erteilt_von; + } } // Generates akzeptiert tooltip akzeptiert_tooltip = function(cell){ - if (cell.getRow().getData().akzeptiert_von != null) { - return 'Angenommen von: ' + cell.getRow().getData().akzeptiert_von; - } + if (cell.getRow().getData().akzeptiert_von != null) { + return 'Angenommen von: ' + cell.getRow().getData().akzeptiert_von; + } } // Generates storniert tooltip @@ -457,43 +458,42 @@ storniert_tooltip = function(cell){ } $(function() { + // Show all rows + $("#show-all").click(function(){ + $('#tableWidgetTabulator').tabulator('clearFilter'); + }); - // Show all rows - $("#show-all").click(function(){ - $('#tableWidgetTabulator').tabulator('clearFilter'); - }); + // Show only rows with ordered lehrauftraege + $("#show-ordered").click(function(){ + $('#tableWidgetTabulator').tabulator('setFilter', + [ + {field: 'bestellt', type: '!=', value: null}, + {field: 'erteilt', type: '=', value: null}, + {field: 'akzeptiert', type: '=', value: null} + ] + ); + }); - // Show only rows with ordered lehrauftraege - $("#show-ordered").click(function(){ - $('#tableWidgetTabulator').tabulator('setFilter', - [ - {field: 'bestellt', type: '!=', value: null}, - {field: 'erteilt', type: '=', value: null}, - {field: 'akzeptiert', type: '=', value: null} - ] - ); - }); + // Show only rows with erteilte lehrauftraege + $("#show-approved").click(function(){ + $('#tableWidgetTabulator').tabulator('setFilter', [ + {field: 'bestellt', type: '!=', value: null}, // filter when is bestellt + {field: 'erteilt', type: '!=', value: null}, // and is erteilt + {field: 'akzeptiert', type: '=', value: null} // and is not akzeptiert + ] + ); + }); - // Show only rows with erteilte lehrauftraege - $("#show-approved").click(function(){ - $('#tableWidgetTabulator').tabulator('setFilter', [ - {field: 'bestellt', type: '!=', value: null}, // filter when is bestellt - {field: 'erteilt', type: '!=', value: null}, // and is erteilt - {field: 'akzeptiert', type: '=', value: null} // and is not akzeptiert - ] - ); - }); - - // Show only rows with akzeptierte lehrauftraege - $("#show-accepted").click(function(){ - $('#tableWidgetTabulator').tabulator('setFilter', - [ - {field: 'bestellt', type: '!=', value: null}, - {field: 'erteilt', type: '!=', value: null}, - {field: 'akzeptiert', type: '!=', value: null} - ] - ); - }); + // Show only rows with akzeptierte lehrauftraege + $("#show-accepted").click(function(){ + $('#tableWidgetTabulator').tabulator('setFilter', + [ + {field: 'bestellt', type: '!=', value: null}, + {field: 'erteilt', type: '!=', value: null}, + {field: 'akzeptiert', type: '!=', value: null} + ] + ); + }); // Set png-icons into filter-buttons $(".btn-lehrauftrag").each(function(){ @@ -510,13 +510,13 @@ $(function() { } }); - // De/activate and un/focus on clicked button - $(".btn-lehrauftrag").click(function() { + // De/activate and un/focus on clicked button + $(".btn-lehrauftrag").click(function() { - // De/activate and un/focus on clicked button - $(".btn-lehrauftrag").removeClass('focus').removeClass('active'); - $(this).addClass('focus').addClass('active'); - }); + // De/activate and un/focus on clicked button + $(".btn-lehrauftrag").removeClass('focus').removeClass('active'); + $(this).addClass('focus').addClass('active'); + }); // Redraw table stornierte lehrauftraege on button click $('#collapseCancelledLehrauftraege').on('shown.bs.collapse', function () { @@ -526,73 +526,73 @@ $(function() { // Approve Lehrauftraege $("#accept-lehrauftraege").click(function(){ - // Get selected rows data - var selected_data = $('#tableWidgetTabulator').tabulator('getSelectedData') - .map(function(data){ - // reduce to necessary fields - return { - 'row_index' : data.row_index, - 'vertrag_id' : data.vertrag_id - } - }); + // Get selected rows data + var selected_data = $('#tableWidgetTabulator').tabulator('getSelectedData') + .map(function(data){ + // reduce to necessary fields + return { + 'row_index' : data.row_index, + 'vertrag_id' : data.vertrag_id + } + }); - // Alert and exit if no lehraufgang is selected - if (selected_data.length == 0) - { - FHC_DialogLib.alertInfo('Bitte wählen Sie erst zumindest einen Lehrauftrag'); + // Alert and exit if no lehraufgang is selected + if (selected_data.length == 0) + { + FHC_DialogLib.alertInfo('Bitte wählen Sie erst zumindest einen Lehrauftrag'); - // Emtpy password field - $("#password").val(''); + // Emtpy password field + $("#password").val(''); - return; - } + return; + } - // Get password for verification - var password = $("#password").val(); - if (password == '') - { - FHC_DialogLib.alertInfo('Bitte verifizieren Sie sich mit Ihrem Login Passwort.'); + // Get password for verification + var password = $("#password").val(); + if (password == '') + { + FHC_DialogLib.alertInfo('Bitte verifizieren Sie sich mit Ihrem Login Passwort.'); - // Focus on password field - $("#password").focus(); + // Focus on password field + $("#password").focus(); - return; - } + return; + } - // Prepare data object for ajax call - var data = { - 'password': password, - 'selected_data': selected_data - }; + // Prepare data object for ajax call + var data = { + 'password': password, + 'selected_data': selected_data + }; - FHC_AjaxClient.ajaxCallPost( - FHC_JS_DATA_STORAGE_OBJECT.called_path + "/acceptLehrauftrag", - data, - { - successCallback: function (data, textStatus, jqXHR) - { - if (data.error) - { - // Password not verified - FHC_DialogLib.alertWarning(data.retval); - } - if (!data.error && data.retval != null) - { - // Update status 'Erteilt' - $('#tableWidgetTabulator').tabulator('updateData', data.retval); - FHC_DialogLib.alertSuccess(data.retval.length + " Lehraufträge wurden akzeptiert."); - } - }, - errorCallback: function (jqXHR, textStatus, errorThrown) - { - FHC_DialogLib.alertError("Systemfehler
Bitte kontaktieren Sie Ihren Administrator."); - } - } - ); + FHC_AjaxClient.ajaxCallPost( + FHC_JS_DATA_STORAGE_OBJECT.called_path + "/acceptLehrauftrag", + data, + { + successCallback: function (data, textStatus, jqXHR) + { + if (data.error) + { + // Password not verified + FHC_DialogLib.alertWarning(data.retval); + } + if (!data.error && data.retval != null) + { + // Update status 'Erteilt' + $('#tableWidgetTabulator').tabulator('updateData', data.retval); + FHC_DialogLib.alertSuccess(data.retval.length + " Lehraufträge wurden akzeptiert."); + } + }, + errorCallback: function (jqXHR, textStatus, errorThrown) + { + FHC_DialogLib.alertError("Systemfehler
Bitte kontaktieren Sie Ihren Administrator."); + } + } + ); - // Empty password field - $("#password").val(''); + // Empty password field + $("#password").val(''); - }); + }); }); From 83fb32bc185b100c813e83a0a2dd03841f797a3c Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 18 Dec 2019 15:37:25 +0100 Subject: [PATCH 39/42] Reordered columns: Now Ausbildungssemester right after STG-Typ-Kurzbezeichnung --- .../views/lehre/lehrauftrag/acceptLehrauftragData.php | 6 +++--- .../views/lehre/lehrauftrag/approveLehrauftragData.php | 6 +++--- .../views/lehre/lehrauftrag/orderLehrauftragData.php | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/application/views/lehre/lehrauftrag/acceptLehrauftragData.php b/application/views/lehre/lehrauftrag/acceptLehrauftragData.php index 13460d38e..70ab7247c 100644 --- a/application/views/lehre/lehrauftrag/acceptLehrauftragData.php +++ b/application/views/lehre/lehrauftrag/acceptLehrauftragData.php @@ -15,11 +15,11 @@ SELECT studiensemester_kurzbz, studiengang_kz, stg_typ_kurzbz, + semester, orgform_kurzbz, person_id, typ, auftrag, - semester, lv_oe_kurzbz, gruppe, stunden, @@ -293,11 +293,11 @@ $filterWidgetArray = array( 'Studiensemester', 'Studiengang-KZ', 'Studiengang', + 'Semester', 'OrgForm', 'Person-ID', 'Typ', 'LV- / Projektbezeichnung', - 'Semester', 'Organisationseinheit', 'Gruppe', 'Stunden', @@ -354,11 +354,11 @@ $filterWidgetArray = array( studiensemester_kurzbz: {visible: false}, studiengang_kz: {visible: false}, stg_typ_kurzbz: {headerFilter:"input", width: "5%"}, + semester: {headerFilter:"input"}, orgform_kurzbz: {headerFilter:"input"}, person_id: {visible: false}, typ: {headerFilter:"input", width: "7%"}, auftrag: {headerFilter:"input", width: "15%"}, - semester: {headerFilter:"input"}, lv_oe_kurzbz: {headerFilter:"input", width: "8%"}, gruppe: {headerFilter:"input", width: "5%"}, stunden: {align:"right", formatter: form_formatNulltoStringNumber, formatterParams:{precision:1}, diff --git a/application/views/lehre/lehrauftrag/approveLehrauftragData.php b/application/views/lehre/lehrauftrag/approveLehrauftragData.php index b8b0fd1a0..2f21ff0b3 100644 --- a/application/views/lehre/lehrauftrag/approveLehrauftragData.php +++ b/application/views/lehre/lehrauftrag/approveLehrauftragData.php @@ -16,11 +16,11 @@ SELECT studiensemester_kurzbz, studiengang_kz, stg_typ_kurzbz, + semester, orgform_kurzbz, person_id, typ, auftrag, - semester, lv_oe_kurzbz, gruppe, lektor, @@ -303,11 +303,11 @@ $filterWidgetArray = array( 'Studiensemester', 'Studiengang-KZ', 'Studiengang', + 'Semester', 'OrgForm', 'Person-ID', 'Typ', 'LV- / Projektbezeichnung', - 'Semester', 'Organisationseinheit', 'Gruppe', 'Lektor', @@ -374,11 +374,11 @@ $filterWidgetArray = array( studiensemester_kurzbz: {headerFilter:"input"}, studiengang_kz: {visible: false}, stg_typ_kurzbz: {headerFilter:"input", width: "5%"}, + semester: {headerFilter:"input"}, orgform_kurzbz: {headerFilter:"input"}, person_id: {visible: false}, typ: {headerFilter:"input"}, auftrag: {headerFilter:"input", width:"20%"}, - semester: {headerFilter:"input"}, lv_oe_kurzbz: {headerFilter:"input"}, gruppe: {headerFilter:"input"}, lektor: {headerFilter:"input"}, diff --git a/application/views/lehre/lehrauftrag/orderLehrauftragData.php b/application/views/lehre/lehrauftrag/orderLehrauftragData.php index ae75d8c48..746f65d10 100644 --- a/application/views/lehre/lehrauftrag/orderLehrauftragData.php +++ b/application/views/lehre/lehrauftrag/orderLehrauftragData.php @@ -16,6 +16,7 @@ SELECT studiensemester_kurzbz, studiengang_kz, stg_typ_kurzbz, + semester, /* get valid STPL(s), to which the lehrveranstaltung is assigned to (can be more) */ /* therefore join over lv, studiensemester and semester */ ( @@ -50,7 +51,6 @@ SELECT person_id, typ, auftrag, - semester, lv_oe_kurzbz, gruppe, lektor, @@ -335,12 +335,12 @@ $filterWidgetArray = array( 'Studiensemester', 'Studiengang-KZ', 'Studiengang', + 'Semester', 'Studienplan', 'OrgForm', 'Person-ID', 'Typ', 'LV- / Projektbezeichnung', - 'Semester', 'Organisationseinheit', 'Gruppe', 'Lektor', @@ -409,12 +409,12 @@ $filterWidgetArray = array( studiensemester_kurzbz: {headerFilter:"input"}, studiengang_kz: {visible: false}, stg_typ_kurzbz: {headerFilter:"input", width: "5%"}, + semester: {headerFilter:"input"}, studienplan_bezeichnung: {headerFilter:"input", width: "7%"}, orgform_kurzbz: {headerFilter:"input"}, person_id: {visible: false}, typ: {headerFilter:"input"}, auftrag: {headerFilter:"input", width:"15%"}, - semester: {headerFilter:"input"}, lv_oe_kurzbz: {headerFilter:"input"}, gruppe: {headerFilter:"input"}, lektor: {headerFilter:"input"}, From ff9aa5c48aaabd566fe9d56f6ab36bcb24d05ca2 Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 18 Dec 2019 15:40:16 +0100 Subject: [PATCH 40/42] Expanded 'lector'-column width --- application/views/lehre/lehrauftrag/approveLehrauftragData.php | 2 +- application/views/lehre/lehrauftrag/orderLehrauftragData.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/application/views/lehre/lehrauftrag/approveLehrauftragData.php b/application/views/lehre/lehrauftrag/approveLehrauftragData.php index 2f21ff0b3..befff5d5a 100644 --- a/application/views/lehre/lehrauftrag/approveLehrauftragData.php +++ b/application/views/lehre/lehrauftrag/approveLehrauftragData.php @@ -381,7 +381,7 @@ $filterWidgetArray = array( auftrag: {headerFilter:"input", width:"20%"}, lv_oe_kurzbz: {headerFilter:"input"}, gruppe: {headerFilter:"input"}, - lektor: {headerFilter:"input"}, + lektor: {headerFilter:"input", widthGrow: 3}, stunden: {align:"right", formatter: form_formatNulltoStringNumber, formatterParams:{precision:1}, headerFilter:"input", headerFilterFunc: hf_filterStringnumberWithOperator, bottomCalc:"sum", bottomCalcParams:{precision:1}}, diff --git a/application/views/lehre/lehrauftrag/orderLehrauftragData.php b/application/views/lehre/lehrauftrag/orderLehrauftragData.php index 746f65d10..3469a7c76 100644 --- a/application/views/lehre/lehrauftrag/orderLehrauftragData.php +++ b/application/views/lehre/lehrauftrag/orderLehrauftragData.php @@ -417,7 +417,7 @@ $filterWidgetArray = array( auftrag: {headerFilter:"input", width:"15%"}, lv_oe_kurzbz: {headerFilter:"input"}, gruppe: {headerFilter:"input"}, - lektor: {headerFilter:"input"}, + lektor: {headerFilter:"input", widthGrow: 3}, stunden: {align:"right", formatter: form_formatNulltoStringNumber, formatterParams:{precision:1}, headerFilter:"input", headerFilterFunc: hf_filterStringnumberWithOperator, bottomCalc:"sum", bottomCalcParams:{precision:1}}, From df057faa8fbedae7c41f8f0b9b6d694d7da7c290 Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 18 Dec 2019 15:45:34 +0100 Subject: [PATCH 41/42] Added default text 'Keine Daten vorhanden' for empty tables Before the tabulator sometimes looked kind of 'undone', when no data was loaded. Now a nice message is displayed if the table is empty. --- .../views/lehre/lehrauftrag/acceptLehrauftragData.php | 1 + .../views/lehre/lehrauftrag/approveLehrauftragData.php | 1 + .../views/lehre/lehrauftrag/cancelledLehrauftragData.php | 1 + .../views/lehre/lehrauftrag/orderLehrauftragData.php | 1 + public/js/lehre/lehrauftrag/acceptLehrauftrag.js | 6 ++++++ public/js/lehre/lehrauftrag/approveLehrauftrag.js | 7 +++++++ public/js/lehre/lehrauftrag/orderLehrauftrag.js | 7 +++++++ 7 files changed, 24 insertions(+) diff --git a/application/views/lehre/lehrauftrag/acceptLehrauftragData.php b/application/views/lehre/lehrauftrag/acceptLehrauftragData.php index 70ab7247c..9f96a0922 100644 --- a/application/views/lehre/lehrauftrag/acceptLehrauftragData.php +++ b/application/views/lehre/lehrauftrag/acceptLehrauftragData.php @@ -318,6 +318,7 @@ $filterWidgetArray = array( layout: "fitColumns", // fit columns to width of table responsiveLayout: "hide", // hide columns that dont fit on the table movableColumns: true, // allows changing column + placeholder: func_placeholder(), headerFilterPlaceholder: " ", index: "row_index", // assign specific column as unique id (important for row indexing) selectable: true, // allow row selection diff --git a/application/views/lehre/lehrauftrag/approveLehrauftragData.php b/application/views/lehre/lehrauftrag/approveLehrauftragData.php index befff5d5a..c9793fda7 100644 --- a/application/views/lehre/lehrauftrag/approveLehrauftragData.php +++ b/application/views/lehre/lehrauftrag/approveLehrauftragData.php @@ -329,6 +329,7 @@ $filterWidgetArray = array( layout: "fitColumns", // fit columns to width of table responsiveLayout: "hide", // hide columns that dont fit on the table movableColumns: true, // allows changing column + placeholder: func_placeholder(), headerFilterPlaceholder: " ", groupBy:"lehrveranstaltung_id", groupToggleElement:"header", //toggle group on click anywhere in the group header diff --git a/application/views/lehre/lehrauftrag/cancelledLehrauftragData.php b/application/views/lehre/lehrauftrag/cancelledLehrauftragData.php index ec286ced2..04d314636 100644 --- a/application/views/lehre/lehrauftrag/cancelledLehrauftragData.php +++ b/application/views/lehre/lehrauftrag/cancelledLehrauftragData.php @@ -67,6 +67,7 @@ $tableWidgetArray = array( layout: "fitColumns", // fit columns to width of table responsiveLayout: "hide", // hide columns that dont fit on the table movableColumns: true, // allows changing column + placeholder: func_placeholder(), rowFormatter:function(row){ func_rowFormatter(row); }, diff --git a/application/views/lehre/lehrauftrag/orderLehrauftragData.php b/application/views/lehre/lehrauftrag/orderLehrauftragData.php index 3469a7c76..2eed6ae63 100644 --- a/application/views/lehre/lehrauftrag/orderLehrauftragData.php +++ b/application/views/lehre/lehrauftrag/orderLehrauftragData.php @@ -363,6 +363,7 @@ $filterWidgetArray = array( layout:"fitColumns", // fit columns to width of table responsiveLayout:"hide", // hide columns that dont fit on the table movableColumns: true, // allows changing column + placeholder: func_placeholder(), headerFilterPlaceholder: " ", groupBy:"lehrveranstaltung_id", groupToggleElement:"header", //toggle group on click anywhere in the group header diff --git a/public/js/lehre/lehrauftrag/acceptLehrauftrag.js b/public/js/lehre/lehrauftrag/acceptLehrauftrag.js index 3be0bcb2b..03c72e2f2 100644 --- a/public/js/lehre/lehrauftrag/acceptLehrauftrag.js +++ b/public/js/lehre/lehrauftrag/acceptLehrauftrag.js @@ -81,6 +81,12 @@ function hf_filterStringnumberWithOperator(headerValue, rowValue, rowData){ // Tabulator table format functions // ----------------------------------------------------------------------------------------------------------------- +// Displays text when table is empty +function func_placeholder() +{ + return "

Keine Daten vorhanden.

"; +} + // Formats the rows function func_rowFormatter(row){ var bestellt = row.getData().bestellt; diff --git a/public/js/lehre/lehrauftrag/approveLehrauftrag.js b/public/js/lehre/lehrauftrag/approveLehrauftrag.js index da3697adf..94e6af473 100644 --- a/public/js/lehre/lehrauftrag/approveLehrauftrag.js +++ b/public/js/lehre/lehrauftrag/approveLehrauftrag.js @@ -94,6 +94,13 @@ function func_initialFilter(){ // ----------------------------------------------------------------------------------------------------------------- // Tabulator table format functions // ----------------------------------------------------------------------------------------------------------------- + +// Displays text when table is empty +function func_placeholder() +{ + return "

Keine Daten vorhanden.

"; +} + // Formats the group header function func_groupHeader(data){ return data[0].lv_bezeichnung + "  " + ' ( LV-ID: ' + data[0].lehrveranstaltung_id + ' )'; // change name to lehrveranstaltung; diff --git a/public/js/lehre/lehrauftrag/orderLehrauftrag.js b/public/js/lehre/lehrauftrag/orderLehrauftrag.js index d27da0e4e..4e58272e5 100644 --- a/public/js/lehre/lehrauftrag/orderLehrauftrag.js +++ b/public/js/lehre/lehrauftrag/orderLehrauftrag.js @@ -99,6 +99,13 @@ function func_dataLoaded(data, table){ // ----------------------------------------------------------------------------------------------------------------- // Tabulator table format functions // ----------------------------------------------------------------------------------------------------------------- + +// Displays text when table is empty +function func_placeholder() +{ + return "

Keine Daten vorhanden.

"; +} + // Formats the group header function func_groupHeader(data) { return data[0].lv_bezeichnung + "  " + ' ( LV-ID: ' + data[0].lehrveranstaltung_id + ' )'; // change name to lehrveranstaltung; From 2dd540c9e64460c86acf15c3890382fddba80543 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Wed, 18 Dec 2019 15:50:30 +0100 Subject: [PATCH 42/42] Changed Permission for Lehrauftrag-Report from lehre/bestellen to lehre/erteilen --- application/config/navigation.php | 3 +-- application/controllers/lehre/lehrauftrag/Lehrauftrag.php | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/application/config/navigation.php b/application/config/navigation.php index 9c641bb32..f0880cba1 100644 --- a/application/config/navigation.php +++ b/application/config/navigation.php @@ -163,10 +163,9 @@ $config['navigation_menu']['lehre/lehrauftrag/Lehrauftrag/*'] = array( 'lehrauftragLehrendeÜbersicht' => array( 'link' => site_url('lehre/lehrauftrag/Lehrauftrag/LehrendeUebersicht'), 'description' => 'Lehrendenübersicht', - 'requiredPermissions' => 'lehre/lehrauftrag_erteilen:r', 'icon' => '', 'sort' => 1, - 'requiredPermissions' => array('lehre/lehrauftrag_bestellen:r') + 'requiredPermissions' => array('lehre/lehrauftrag_erteilen:r') ) ); $config['navigation_menu']['lehre/lehrauftrag/LehrauftragErteilen/*'] = array( diff --git a/application/controllers/lehre/lehrauftrag/Lehrauftrag.php b/application/controllers/lehre/lehrauftrag/Lehrauftrag.php index 74094f7fb..9ff6d59b5 100644 --- a/application/controllers/lehre/lehrauftrag/Lehrauftrag.php +++ b/application/controllers/lehre/lehrauftrag/Lehrauftrag.php @@ -27,7 +27,7 @@ class Lehrauftrag extends Auth_Controller 'index' => 'lehre/lehrauftrag_bestellen:r', 'orderLehrauftrag' => 'lehre/lehrauftrag_bestellen:rw', 'Dashboard' => array('lehre/lehrauftrag_bestellen:r', 'lehre/lehrauftrag_erteilen:rw'), - 'LehrendeUebersicht' => array('lehre/lehrauftrag_bestellen:r') + 'LehrendeUebersicht' => array('lehre/lehrauftrag_erteilen:r') ) );