From 442cd67d084dba67f5ef3e61cb109eeda422cfd4 Mon Sep 17 00:00:00 2001 From: Cris Date: Mon, 30 Nov 2020 11:01:09 +0100 Subject: [PATCH 001/142] Changed COVID page text, Removed placeholder in COVID textarea Signed-off-by: cris-technikum --- locale/de-AT/global.php | 1 + locale/en-US/global.php | 1 + 2 files changed, 2 insertions(+) diff --git a/locale/de-AT/global.php b/locale/de-AT/global.php index b7f5fc769..586614ece 100644 --- a/locale/de-AT/global.php +++ b/locale/de-AT/global.php @@ -184,6 +184,7 @@ $this->phrasen['global/keineDatenGefunden']='Keine Daten gefunden'; $this->phrasen['global/erfolgreichAngelegt']='Erfolgreich angelegt'; $this->phrasen['global/keineSuchergebnisse']='Es liegen keine Daten zu Ihrer Suchanfrage vor'; $this->phrasen['global/bitteWaehlen']='Bitte wählen Sie'; +$this->phrasen['global/zusaetzlicheInformationen']='Zusätzliche Informationen'; //infrastruktur diff --git a/locale/en-US/global.php b/locale/en-US/global.php index 46a998cfb..5fa89acbb 100644 --- a/locale/en-US/global.php +++ b/locale/en-US/global.php @@ -182,6 +182,7 @@ $this->phrasen['global/keineDatenGefunden']='No data found'; $this->phrasen['global/erfolgreichAngelegt']='Created successfully'; $this->phrasen['global/keineSuchergebnisse']='No matches found'; $this->phrasen['global/bitteWaehlen']='Please select'; +$this->phrasen['global/zusaetzlicheInformationen']='Additional Information'; //infrastruktur From e7d9d8859c457b9a27fb3b6ea9e99fddf5ded3eb Mon Sep 17 00:00:00 2001 From: Cris Date: Tue, 22 Dec 2020 15:43:44 +0100 Subject: [PATCH 002/142] Created VIEW Anrechnungen for students (CIS) Signed-off-by: cris-technikum --- .../lehre/anrechnung/requestAnrechnung.php | 170 ++++++++++++++++++ 1 file changed, 170 insertions(+) create mode 100644 application/views/lehre/anrechnung/requestAnrechnung.php diff --git a/application/views/lehre/anrechnung/requestAnrechnung.php b/application/views/lehre/anrechnung/requestAnrechnung.php new file mode 100644 index 000000000..9b648e0dd --- /dev/null +++ b/application/views/lehre/anrechnung/requestAnrechnung.php @@ -0,0 +1,170 @@ +load->view( + 'templates/FHC-Header', + array( + 'title' => $this->p->t('ui', 'antragStellen'), + 'jquery' => true, + 'bootstrap' => true, + 'fontawesome' => true, + 'ajaxlib' => true, + 'dialoglib' => true, + 'phrases' => array( + 'global' => array( + 'anerkennungNachgewiesenerKenntnisse', + 'antragStellen' + ), + 'ui' => array( + 'hilfeZuDieserSeite', + ) + ), + 'customJSs' => array( + 'public/js/bootstrapper.js', + 'public/js/lehre/anrechnung/Anrechnung.js') + ) +); +?> + + +
+
+ +
+ +
+
+
+
+ +
+
+ +
+
+
+
+ p->t('anrechnung', 'antragsdaten'); ?> +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
StudentInCristina Hainberger
StudentInCristina Hainberger
StudentInCristina Hainberger
StudentInCristina Hainberger
StudentInCristina Hainberger
StudentInCristina Hainberger
StudentInCristina Hainberger
+
+
+
+ +
+
+
+
+ p->t('anrechnung', 'dokumentZumNachweis'); ?> +
+
+ +
+ +
+ + +
+ +
+
+
+
+ +
+
+
+
+
+ p->t('anrechnung', 'weitereInformationen'); ?> +
+
+ +
+
+
+
+
+
+ +
+
+
+

p->t('anrechnung', 'antragStellenText'); ?>

+
+ +
+
+ +
+
+
+
+
+
+
+ +
+
+
+
+
+
+ + +load->view('templates/FHC-Footer'); ?> From 8309dfb3cae78bca886ee183ff8ff8ab65b9814e Mon Sep 17 00:00:00 2001 From: Cris Date: Tue, 22 Dec 2020 16:00:07 +0100 Subject: [PATCH 003/142] Created CONTROLLER Anrechnungen for students (CIS) Signed-off-by: cris-technikum --- .../lehre/anrechnung/RequestAnrechnung.php | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 application/controllers/lehre/anrechnung/RequestAnrechnung.php diff --git a/application/controllers/lehre/anrechnung/RequestAnrechnung.php b/application/controllers/lehre/anrechnung/RequestAnrechnung.php new file mode 100644 index 000000000..368a463df --- /dev/null +++ b/application/controllers/lehre/anrechnung/RequestAnrechnung.php @@ -0,0 +1,66 @@ + 'admin:rw', + 'uploadFile' => 'admin:rw', + ) + ); + + // Load models + $this->load->model('system/Benutzerrolle_model', 'BenutzerrolleModel'); + + // Load libraries + $this->load->library('WidgetLib'); + $this->load->library('PermissionLib'); + + // Load helpers + $this->load->helper('form'); + $this->load->helper('url'); + $this->load->helper('hlp_sancho_helper'); + + // Load language phrases + $this->loadPhrases( + array( + 'global', + 'ui', + 'anrechnung' + ) + ); + + $this->_setAuthUID(); + + $this->setControllerId(); + } + + public function index() + { + $this->load->view('lehre/anrechnung/requestAnrechnung.php'); + + } + + public function uploadFile($filename = null) + { +// $this->extensionslib->installExtension(urldecode($filename)); + } + + + /** + * Retrieve the UID of the logged user and checks if it is valid + */ + private function _setAuthUID() + { + $this->_uid = getAuthUID(); + + if (!$this->_uid) show_error('User authentification failed'); + } + + +} \ No newline at end of file From fb29dc1e0ec6eb7947a945fc35c8d605127e3409 Mon Sep 17 00:00:00 2001 From: Cris Date: Tue, 5 Jan 2021 12:17:41 +0100 Subject: [PATCH 004/142] Added method getLvByStudent() to Lehrveranstaltung_model Signed-off-by: cris-technikum --- .../education/Lehrveranstaltung_model.php | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/application/models/education/Lehrveranstaltung_model.php b/application/models/education/Lehrveranstaltung_model.php index d80d02b41..ef5373f5f 100644 --- a/application/models/education/Lehrveranstaltung_model.php +++ b/application/models/education/Lehrveranstaltung_model.php @@ -273,4 +273,24 @@ class Lehrveranstaltung_model extends DB_Model return $this->execQuery($query, $parametersarray); } + + /** + * Gets Lehrveranstaltung and its Lehreinheiten (multiple rows possible). + * Returns empty array if student has no Lehrveranstaltung. + * @param $uid + * @param $studiensemester_kurzbz + * @param $lehrveranstaltung_id + * @return array|null + */ + public function getLvByStudent($uid, $studiensemester_kurzbz, $lehrveranstaltung_id) + { + $query = ' + SELECT * FROM campus.vw_student_lehrveranstaltung + WHERE uid = ? + AND studiensemester_kurzbz = ? + AND lehrveranstaltung_id = ?; + '; + + return $this->execQuery($query, array($uid, $studiensemester_kurzbz, $lehrveranstaltung_id)); + } } From 04174d35f5d0c628f68f98be9cb76e30153470c2 Mon Sep 17 00:00:00 2001 From: Cris Date: Tue, 5 Jan 2021 12:19:27 +0100 Subject: [PATCH 005/142] Added Anrechnungsdata (student, lv and lectors of lv) Signed-off-by: cris-technikum --- .../lehre/anrechnung/RequestAnrechnung.php | 15 ++++- application/libraries/AnrechnungLib.php | 65 +++++++++++++++++++ application/models/person/Person_model.php | 2 +- .../lehre/anrechnung/requestAnrechnung.php | 54 ++++++++++----- 4 files changed, 115 insertions(+), 21 deletions(-) create mode 100644 application/libraries/AnrechnungLib.php diff --git a/application/controllers/lehre/anrechnung/RequestAnrechnung.php b/application/controllers/lehre/anrechnung/RequestAnrechnung.php index 368a463df..b79c2797b 100644 --- a/application/controllers/lehre/anrechnung/RequestAnrechnung.php +++ b/application/controllers/lehre/anrechnung/RequestAnrechnung.php @@ -20,6 +20,7 @@ class requestAnrechnung extends Auth_Controller // Load libraries $this->load->library('WidgetLib'); $this->load->library('PermissionLib'); + $this->load->library('AnrechnungLib'); // Load helpers $this->load->helper('form'); @@ -31,7 +32,9 @@ class requestAnrechnung extends Auth_Controller array( 'global', 'ui', - 'anrechnung' + 'anrechnung', + 'person', + 'lehre' ) ); @@ -42,8 +45,14 @@ class requestAnrechnung extends Auth_Controller public function index() { - $this->load->view('lehre/anrechnung/requestAnrechnung.php'); - + $studiensemester_kurzbz = $this->input->get('studiensemester'); + $lv_id = $this->input->get('lv_id'); + + $viewData = array( + 'anrechnungData' => $this->anrechnunglib->getAnrechnungData($this->_uid, $studiensemester_kurzbz, $lv_id) + ); + + $this->load->view('lehre/anrechnung/requestAnrechnung.php', $viewData); } public function uploadFile($filename = null) diff --git a/application/libraries/AnrechnungLib.php b/application/libraries/AnrechnungLib.php new file mode 100644 index 000000000..472a2c0e1 --- /dev/null +++ b/application/libraries/AnrechnungLib.php @@ -0,0 +1,65 @@ +ci =& get_instance(); + + $this->ci->load->model('person/Person_model', 'PersonModel'); + $this->ci->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel'); + $this->ci->load->model('organisation/Studiengang_model', 'StudiengangModel'); + } + + /** + * Get Anrechnung data + * @param $uid + * @param $studiensemester_kurzbz + * @param $lv_id + * @return StdClass + */ + public function getAnrechnungData($uid, $studiensemester_kurzbz, $lv_id) + { + $anrechnung_data = new StdClass(); + + // Get lehrveranstaltung data. Break, if course is not assigned to student. + if(!$lv = getData($this->ci->LehrveranstaltungModel->getLvByStudent($uid, $studiensemester_kurzbz, $lv_id))[0]) + { + show_error('You are not assigned to this course yet.'); + } + + // Get the students personal data + if (!$person = getData($this->ci->PersonModel->getByUid($uid))[0]) + { + show_error('Failed loading person data.'); + } + + // Get studiengang bezeichnung + if (!$studiengang = getData($this->ci->StudiengangModel->load($lv->studiengang_kz))[0]) + { + show_error('Failed loading studiengang data.'); + } + + // Get lectors of lehrveranstaltung + $anrechnung_data->lektoren = array(); + if (!$lv_lektoren = getData($this->ci->LehrveranstaltungModel->getLecturersByLv($studiensemester_kurzbz, $lv_id))) + { + show_error('Failed loading course lectors.'); + } + + // Set the given studiensemester + $anrechnung_data->lv_bezeichnung = $lv->bezeichnung; + $anrechnung_data->ects = $lv->ects; + $anrechnung_data->studiensemester_kurzbz = $studiensemester_kurzbz; + $anrechnung_data->vorname = $person->vorname; + $anrechnung_data->nachname = $person->nachname; + $anrechnung_data->bpk = $person->bpk; + $anrechnung_data->stg_bezeichnung = $studiengang->bezeichnung; + $anrechnung_data->lektoren = $lv_lektoren; + + return $anrechnung_data; + } + +} \ No newline at end of file diff --git a/application/models/person/Person_model.php b/application/models/person/Person_model.php index d8ddb381c..bf85efe33 100644 --- a/application/models/person/Person_model.php +++ b/application/models/person/Person_model.php @@ -191,7 +191,7 @@ class Person_model extends DB_Model */ public function getByUid($uid) { - $this->addSelect('vorname, nachname, gebdatum, person_id'); + $this->addSelect('vorname, nachname, gebdatum, person_id, bpk'); $this->addJoin('tbl_benutzer', 'person_id'); return $this->loadWhere(array('uid' => $uid)); diff --git a/application/views/lehre/anrechnung/requestAnrechnung.php b/application/views/lehre/anrechnung/requestAnrechnung.php index 9b648e0dd..87ae62b0f 100644 --- a/application/views/lehre/anrechnung/requestAnrechnung.php +++ b/application/views/lehre/anrechnung/requestAnrechnung.php @@ -2,7 +2,7 @@ $this->load->view( 'templates/FHC-Header', array( - 'title' => $this->p->t('ui', 'antragStellen'), + 'title' => $this->p->t('anrechnung', 'antragStellen'), 'jquery' => true, 'bootstrap' => true, 'fontawesome' => true, @@ -15,7 +15,19 @@ $this->load->view( ), 'ui' => array( 'hilfeZuDieserSeite', - ) + 'hochladen' + ), + 'person' => array( + 'student', + 'personenkennzeichen' + ), + 'lehre' => array( + 'studiensemester', + 'studiengang', + 'lehrveranstaltung', + 'ects', + 'lektor', + ) ), 'customJSs' => array( 'public/js/bootstrapper.js', @@ -51,36 +63,43 @@ $this->load->view(
p->t('anrechnung', 'antragsdaten'); ?> + Status: p->t('anrechnung', 'neu'); ?>
- - + + - - + + - - + + - - + + - - + + - - + + - - + +
StudentInCristina Hainbergerp->t('person', 'student'); ?>vorname. ' '. $anrechnungData->nachname; ?>
StudentInCristina Hainbergerp->t('person', 'personenkennzeichen'); ?>bpk ?>
StudentInCristina Hainbergerp->t('lehre', 'studiensemester'); ?>studiensemester_kurzbz ?>
StudentInCristina Hainbergerp->t('lehre', 'studiengang'); ?>stg_bezeichnung ?>
StudentInCristina Hainbergerp->t('lehre', 'lehrveranstaltung'); ?>lv_bezeichnung ?>
StudentInCristina Hainbergerp->t('lehre', 'ects'); ?>ects ?>
StudentInCristina Hainbergerp->t('lehre', 'lektor'); ?> + lektoren) - 1 ?> + lektoren as $key => $lektor): ?> + vorname. ' '. $lektor->nachname; + echo $key === $len ? '' : ', ' ?> + +
@@ -112,7 +131,8 @@ $this->load->view(
  • bla.pdf -
  • + +
    From 1fefffcab3e2f13131188b63d729847f5e496d2c Mon Sep 17 00:00:00 2001 From: Cris Date: Mon, 11 Jan 2021 13:43:57 +0100 Subject: [PATCH 006/142] Added / Adapted DB for Anrechnungen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Added column dms_id, studiensemester_kurzbz, anmerkung_student und empfehlung_anrechnung in tbl_anrechnung - Changed genehmigt_von and begruendung_id to be NULLABLE in tbl_anrechnung - Added DMS category "anrechnung" - Added DMS category permissiongroup for DMS category "anrechnung" - Add table anrechnung_status - Added table anrechnung_anrechnungstatus - Für bestehende genehmigte Anrechnungsanträge wird ein Eintrag mit dem Status 'approved' angelegt Signed-off-by: cris-technikum --- system/dbupdate_3.3.php | 146 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 145 insertions(+), 1 deletion(-) diff --git a/system/dbupdate_3.3.php b/system/dbupdate_3.3.php index 2336ebad4..f4ecc29d1 100644 --- a/system/dbupdate_3.3.php +++ b/system/dbupdate_3.3.php @@ -4465,6 +4465,148 @@ if($result = $db->db_query("SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE } } +// Add column dms_id, studiensemester_kurzbz, anmerkung_student und empfehlung_anrechnung +// Change genehmigt_von and begruendung_id to be NULLABLE +if(!$result = @$db->db_query("SELECT dms_id FROM lehre.tbl_anrechnung")) +{ + $qry = " + ALTER TABLE lehre.tbl_anrechnung ADD COLUMN dms_id bigint; + ALTER TABLE lehre.tbl_anrechnung ADD COLUMN studiensemester_kurzbz varchar(6); + ALTER TABLE lehre.tbl_anrechnung ADD COLUMN anmerkung_student text; + ALTER TABLE lehre.tbl_anrechnung ADD COLUMN empfehlung_anrechnung boolean DEFAULT FALSE; + + ALTER TABLE lehre.tbl_anrechnung ADD CONSTRAINT fk_anrechnung_studiensemester FOREIGN KEY (studiensemester_kurzbz) REFERENCES public.tbl_studiensemester(studiensemester_kurzbz) ON DELETE RESTRICT ON UPDATE CASCADE; + ALTER TABLE lehre.tbl_anrechnung ADD CONSTRAINT fk_anrechnung_dms FOREIGN KEY (dms_id) REFERENCES campus.tbl_dms(dms_id) ON DELETE RESTRICT ON UPDATE CASCADE; + + ALTER TABLE lehre.tbl_anrechnung ALTER COLUMN genehmigt_von DROP NOT NULL; + ALTER TABLE lehre.tbl_anrechnung ALTER COLUMN begruendung_id DROP NOT NULL; + "; + + + if(!$db->db_query($qry)) + echo 'lehre.tbl_anrechnung: '.$db->db_last_error().'
    '; + else + echo '
    lehre.tbl_anrechnung: Neue Spalten dms_id, studiensemester_kurzbz, anmerkung_student und empfehlung_anrechnung hinzugefuegt. Not null constraint entfernt für genehmigt_von und begruendung_id'; +} + +// Add DMS category "anrechnung" +if ($result = @$db->db_query("SELECT 1 FROM campus.tbl_dms_kategorie WHERE kategorie_kurzbz = 'anrechnung';")) +{ + if ($db->db_num_rows($result) == 0) + { + $qry = "INSERT INTO campus.tbl_dms_kategorie ( + kategorie_kurzbz, + bezeichnung, + beschreibung, + parent_kategorie_kurzbz, + oe_kurzbz, + berechtigung_kurzbz + ) VALUES( + 'anrechnung', + 'Anrechnung', + 'Dokumente zur Anrechnung von Lehrveranstaltungen', + 'studium', + 'etw', + NULL + );"; + if (!$db->db_query($qry)) + echo 'campus.tbl_dms_kategorie '.$db->db_last_error().'
    '; + else + echo ' campus.tbl_dms_kategorie: Added category "anrechnung"!
    '; + } +} + + +// Add DMS category permissiongroup for DMS category "anrechnung" +if ($result = @$db->db_query("SELECT 1 FROM campus.tbl_dms_kategorie_gruppe WHERE kategorie_kurzbz = 'anrechnung';")) +{ + if ($db->db_num_rows($result) == 0) + { + $qry = "INSERT INTO campus.tbl_dms_kategorie_gruppe ( + kategorie_kurzbz, + gruppe_kurzbz, + insertamum, + insertvon + ) VALUES( + 'anrechnung', + 'CMS_LOCK', + NOW(), + 'dbcheck' + );"; + if (!$db->db_query($qry)) + echo 'campus.tbl_dms_kategorie_gruppe '.$db->db_last_error().'
    '; + else + echo ' campus.tbl_dms_kategorie_gruppe: Added category group "CMS_LOCK" to category "anrechnung"!
    '; + } +} + +// Add table anrechnung_status +if(!$result = @$db->db_query("SELECT 1 FROM lehre.tbl_anrechnungstatus LIMIT 1;")) +{ + $qry = " + CREATE TABLE lehre.tbl_anrechnungstatus + ( + status_kurzbz varchar(32) NOT NULL, + bezeichnung_mehrsprachig varchar(64)[] + ); + + ALTER TABLE lehre.tbl_anrechnungstatus ADD CONSTRAINT pk_anrechnungstatus PRIMARY KEY (status_kurzbz); + + INSERT INTO lehre.tbl_anrechnungstatus(status_kurzbz, bezeichnung_mehrsprachig) VALUES('inProgressDP', '{\'bearbeitet von STG-Leitung\',\'processed by STG-Director\'}'); + INSERT INTO lehre.tbl_anrechnungstatus(status_kurzbz, bezeichnung_mehrsprachig) VALUES('inProgressKF', '{\'bearbeitet von KF-Leitung\',\'processed by KF-Manager\'}'); + INSERT INTO lehre.tbl_anrechnungstatus(status_kurzbz, bezeichnung_mehrsprachig) VALUES('approved', '{\'genehmigt\',\'approved\'}'); + INSERT INTO lehre.tbl_anrechnungstatus(status_kurzbz, bezeichnung_mehrsprachig) VALUES('rejected', '{\'abgelehnt\',\'rejected\'}'); + + GRANT SELECT ON lehre.tbl_anrechnungstatus TO web; + GRANT SELECT, UPDATE, INSERT, DELETE ON lehre.tbl_anrechnungstatus TO vilesci; + "; + + if(!$db->db_query($qry)) + echo 'lehre.tbl_anrechnungstatus: '.$db->db_last_error().'
    '; + else + echo ' lehre.tbl_anrechnungstatus: Tabelle hinzugefuegt
    '; +} + +// Add table anrechnung_anrechnungstatus +// Für bestehende genehmigte Anrechnungsanträge wird ein Eintrag mit dem Status 'approved' angelegt +if(!$result = @$db->db_query("SELECT 1 FROM lehre.tbl_anrechnung_anrechnungstatus LIMIT 1;")) +{ + $qry = " + CREATE TABLE lehre.tbl_anrechnung_anrechnungstatus + ( + anrechnungstatus_id integer NOT NULL, + anrechnung_id integer, + status_kurzbz varchar(32), + datum timestamp default now(), + insertamum timestamp default now(), + insertvon varchar(32) + ); + + ALTER TABLE lehre.tbl_anrechnung_anrechnungstatus ADD CONSTRAINT pk_anrechnung_anrechnungstatus PRIMARY KEY (anrechnungstatus_id); + ALTER TABLE lehre.tbl_anrechnung_anrechnungstatus ADD CONSTRAINT fk_anrechnung_anrechnungstatus_anrechnung FOREIGN KEY (anrechnung_id) REFERENCES lehre.tbl_anrechnung(anrechnung_id) ON DELETE RESTRICT ON UPDATE CASCADE; + ALTER TABLE lehre.tbl_anrechnung_anrechnungstatus ADD CONSTRAINT fk_anrechnung_anrechnungstatus_anrechnungstatus FOREIGN KEY (status_kurzbz) REFERENCES lehre.tbl_anrechnungstatus (status_kurzbz) ON DELETE RESTRICT ON UPDATE CASCADE; + + CREATE SEQUENCE lehre.seq_anrechnung_anrechnungstatus_anrechnungstatus_id + START WITH 1 + INCREMENT BY 1 + NO MAXVALUE + NO MINVALUE + CACHE 1; + ALTER TABLE lehre.tbl_anrechnung_anrechnungstatus ALTER COLUMN anrechnungstatus_id SET DEFAULT nextval('lehre.seq_anrechnung_anrechnungstatus_anrechnungstatus_id'); + + INSERT INTO lehre.tbl_anrechnung_anrechnungstatus(anrechnung_id, status_kurzbz) SELECT anrechnung_id, 'approved' as status_kurzbz FROM lehre.tbl_anrechnung WHERE genehmigt_von is not null; + + GRANT SELECT ON lehre.tbl_anrechnung_anrechnungstatus TO web; + GRANT SELECT, UPDATE, INSERT, DELETE ON lehre.tbl_anrechnung_anrechnungstatus TO vilesci; + GRANT SELECT, UPDATE ON lehre.seq_anrechnung_anrechnungstatus_anrechnungstatus_id TO vilesci; + "; + + if(!$db->db_query($qry)) + echo 'lehre.tbl_anrechnung_anrechnungstatus: '.$db->db_last_error().'
    '; + else + echo ' lehre.tbl_anrechnung_anrechnungstatus: Tabelle hinzugefuegt
    '; +} + // *** Pruefung und hinzufuegen der neuen Attribute und Tabellen echo '

    Pruefe Tabellen und Attribute!

    '; @@ -4571,8 +4713,10 @@ $tabellen=array( "lehre.tbl_abschlusspruefung" => array("abschlusspruefung_id","student_uid","vorsitz","pruefer1","pruefer2","pruefer3","abschlussbeurteilung_kurzbz","akadgrad_id","pruefungstyp_kurzbz","datum","uhrzeit","sponsion","anmerkung","updateamum","updatevon","insertamum","insertvon","ext_id","note","protokoll","endezeit","pruefungsantritt_kurzbz","freigabedatum"), "lehre.tbl_abschlusspruefung_antritt" => array("pruefungsantritt_kurzbz","bezeichnung","bezeichnung_english","sort"), "lehre.tbl_akadgrad" => array("akadgrad_id","akadgrad_kurzbz","studiengang_kz","titel","geschlecht"), - "lehre.tbl_anrechnung" => array("anrechnung_id","prestudent_id","lehrveranstaltung_id","begruendung_id","lehrveranstaltung_id_kompatibel","genehmigt_von","insertamum","insertvon","updateamum","updatevon","ext_id"), + "lehre.tbl_anrechnung" => array("anrechnung_id","prestudent_id","lehrveranstaltung_id","begruendung_id","lehrveranstaltung_id_kompatibel","genehmigt_von","insertamum","insertvon","updateamum","updatevon","ext_id", "dms_id", "studiensemester_kurzbz", "anmerkung_student", "empfehlung_anrechnung"), + "lehre.tbl_anrechnung_anrechnungstatus" => array("anrechnungstatus_id", "anrechnung_id","status_kurzbz","datum", "insertamum","insertvon"), "lehre.tbl_anrechnung_begruendung" => array("begruendung_id","bezeichnung"), + "lehre.tbl_anrechnungstatus" => array("status_kurzbz","bezeichnung_mehrsprachig"), "lehre.tbl_betreuerart" => array("betreuerart_kurzbz","beschreibung","aktiv"), "lehre.tbl_ferien" => array("bezeichnung","studiengang_kz","vondatum","bisdatum"), "lehre.tbl_lehreinheit" => array("lehreinheit_id","lehrveranstaltung_id","studiensemester_kurzbz","lehrfach_id","lehrform_kurzbz","stundenblockung","wochenrythmus","start_kw","raumtyp","raumtypalternativ","sprache","lehre","anmerkung","unr","lvnr","updateamum","updatevon","insertamum","insertvon","ext_id","lehrfach_id_old","gewicht"), From 5cd163819dae36eeb3bf84d33d36ba7760e95611 Mon Sep 17 00:00:00 2001 From: Cris Date: Mon, 11 Jan 2021 15:24:12 +0100 Subject: [PATCH 007/142] Added upload function to DmsLib Signed-off-by: cris-technikum --- application/libraries/DmsLib.php | 54 +++++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/application/libraries/DmsLib.php b/application/libraries/DmsLib.php index f32df5fd1..04204012b 100644 --- a/application/libraries/DmsLib.php +++ b/application/libraries/DmsLib.php @@ -5,7 +5,10 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); class DmsLib { const FILE_CONTENT_PROPERTY = 'file_content'; - + + const FILE_INPUT_NAME = 'uploadfile'; // name of the HTML input tag containing the uploaded file + private $UPLOAD_PATH = DMS_PATH; // temporary directory to store the upload file + /** * Object initialization */ @@ -92,6 +95,42 @@ class DmsLib return $result; } + + /** + * Uploads a document and saves it to DMS + * @param $dms DMS assoc array + * @param array $allowed_types Default: all. Param example: array(jpg, pdf) + * @return array + */ + public function upload($dms, $allowed_types = array('*')) + { + // Init upload configs + $this->_loadUploadLibrary($allowed_types); + + if (!$this->ci->upload->do_upload(DmsLib::FILE_INPUT_NAME)) + { + return error($this->ci->upload->display_errors()); + } + + $upload_data = $this->ci->upload->data(); // data about the uploaded file + $filename = $upload_data['file_name']; + + // Insert to DMS table + if (!$result = $this->ci->DmsModel->insert($this->ci->DmsModel->filterFields($dms))) + { + return error('Failed inserting to DMS'); + } + + // Insert DMS version + if (!$result = $this->ci->DmsVersionModel->insert( + $this->ci->DmsVersionModel->filterFields($dms, $result->retval, $filename))) + { + return error('Failed inserting DMS version'); + } + + // return result of uploaded data + return success($upload_data); // data about the uploaded file + } /** * Saves a Document @@ -302,4 +341,17 @@ class DmsLib return $result; } + + /** + * Loads the upload library of CI + */ + private function _loadUploadLibrary($allowed_types) + { + $config['upload_path'] = $this->UPLOAD_PATH; + $config['allowed_types'] = implode('|', $allowed_types); + $config['overwrite'] = true; + + $this->ci->load->library('upload', $config); + $this->ci->upload->initialize($config); + } } From 2454104cc32cff6374ca53bc75699af0c371ab6e Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 13 Jan 2021 14:37:55 +0100 Subject: [PATCH 008/142] Changed datum type from timestamp to date in tbl_anrechnung_anrechnungstatus Signed-off-by: cris-technikum --- system/dbupdate_3.3.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/dbupdate_3.3.php b/system/dbupdate_3.3.php index f4ecc29d1..1e0a76e35 100644 --- a/system/dbupdate_3.3.php +++ b/system/dbupdate_3.3.php @@ -4577,7 +4577,7 @@ if(!$result = @$db->db_query("SELECT 1 FROM lehre.tbl_anrechnung_anrechnungstatu anrechnungstatus_id integer NOT NULL, anrechnung_id integer, status_kurzbz varchar(32), - datum timestamp default now(), + datum date default now(), insertamum timestamp default now(), insertvon varchar(32) ); From 47f66644ef4c295c4293a214b274d02a0e48fefa Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 13 Jan 2021 14:55:50 +0100 Subject: [PATCH 009/142] Added Bezeichnung 'berufliche Praxis' to Anrechnungbegruendung Signed-off-by: cris-technikum --- system/dbupdate_3.3.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/system/dbupdate_3.3.php b/system/dbupdate_3.3.php index 1e0a76e35..af3ae2fff 100644 --- a/system/dbupdate_3.3.php +++ b/system/dbupdate_3.3.php @@ -4607,6 +4607,19 @@ if(!$result = @$db->db_query("SELECT 1 FROM lehre.tbl_anrechnung_anrechnungstatu echo ' lehre.tbl_anrechnung_anrechnungstatus: Tabelle hinzugefuegt
    '; } +// Added Bezeichnung 'berufliche Praxis' to Anrechnungbegruendung +if ($result = @$db->db_query("SELECT 1 FROM lehre.tbl_anrechnung_begruendung WHERE bezeichnung = 'berufliche Praxis';")) +{ + if ($db->db_num_rows($result) == 0) + { + $qry = "INSERT INTO lehre.tbl_anrechnung_begruendung (bezeichnung) VALUES('berufliche Praxis');"; + if (!$db->db_query($qry)) + echo 'lehre.tbl_anrechnung_begruendung '.$db->db_last_error().'
    '; + else + echo ' lehre.tbl_anrechnung_begruendung: Added bezeichnung "berufliche Praxis"
    '; + } +} + // *** Pruefung und hinzufuegen der neuen Attribute und Tabellen echo '

    Pruefe Tabellen und Attribute!

    '; From 78e4edd59005046327fc972e99deb2ef3a5232e8 Mon Sep 17 00:00:00 2001 From: Cris Date: Thu, 14 Jan 2021 08:36:53 +0100 Subject: [PATCH 010/142] Added permission student/anrechnung_beantragen Signed-off-by: cris-technikum --- system/dbupdate_3.3.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/system/dbupdate_3.3.php b/system/dbupdate_3.3.php index af3ae2fff..1a0a2838e 100644 --- a/system/dbupdate_3.3.php +++ b/system/dbupdate_3.3.php @@ -4620,6 +4620,20 @@ if ($result = @$db->db_query("SELECT 1 FROM lehre.tbl_anrechnung_begruendung WHE } } +// Add permission to apply for Anrechnung +if($result = @$db->db_query("SELECT 1 FROM system.tbl_berechtigung WHERE berechtigung_kurzbz = 'student/anrechnung_beantragen';")) +{ + if($db->db_num_rows($result) == 0) + { + $qry = "INSERT INTO system.tbl_berechtigung(berechtigung_kurzbz, beschreibung) VALUES('student/anrechnung_beantragen', 'Anrechnung beantragen');"; + + if(!$db->db_query($qry)) + echo 'system.tbl_berechtigung '.$db->db_last_error().'
    '; + else + echo ' system.tbl_berechtigung: Added permission for student/anrechnung_beantragen
    '; + } +} + // *** Pruefung und hinzufuegen der neuen Attribute und Tabellen echo '

    Pruefe Tabellen und Attribute!

    '; From 44e8bd57b07e723d3359f8c17154ea602a1e089a Mon Sep 17 00:00:00 2001 From: Cris Date: Thu, 14 Jan 2021 10:00:44 +0100 Subject: [PATCH 011/142] Set default value to NOW() for insertamum in lehre.tbl_anrechnung Signed-off-by: cris-technikum --- system/dbupdate_3.3.php | 1 + 1 file changed, 1 insertion(+) diff --git a/system/dbupdate_3.3.php b/system/dbupdate_3.3.php index 1a0a2838e..9ca75012b 100644 --- a/system/dbupdate_3.3.php +++ b/system/dbupdate_3.3.php @@ -4480,6 +4480,7 @@ if(!$result = @$db->db_query("SELECT dms_id FROM lehre.tbl_anrechnung")) ALTER TABLE lehre.tbl_anrechnung ALTER COLUMN genehmigt_von DROP NOT NULL; ALTER TABLE lehre.tbl_anrechnung ALTER COLUMN begruendung_id DROP NOT NULL; + ALTER TABLE lehre.tbl_anrechnung ALTER COLUMN insertamum SET DEFAULT NOW(); "; From 3116d4c7c90ca96f53919378989295041bdb94c7 Mon Sep 17 00:00:00 2001 From: Cris Date: Thu, 14 Jan 2021 14:04:49 +0100 Subject: [PATCH 012/142] Adapted index method and library(deadline, status, refactored code, lib functions) - Check if application deadline is expired - Refactored retrieving Anrechnung data (reusable) - Adapted status for student view (new, in progress) Signed-off-by: cris-technikum --- .../lehre/anrechnung/RequestAnrechnung.php | 122 +++++++++++++++++- application/libraries/AnrechnungLib.php | 95 ++++++++++++-- 2 files changed, 201 insertions(+), 16 deletions(-) diff --git a/application/controllers/lehre/anrechnung/RequestAnrechnung.php b/application/controllers/lehre/anrechnung/RequestAnrechnung.php index b79c2797b..482c5ab7b 100644 --- a/application/controllers/lehre/anrechnung/RequestAnrechnung.php +++ b/application/controllers/lehre/anrechnung/RequestAnrechnung.php @@ -4,6 +4,15 @@ class requestAnrechnung extends Auth_Controller { + const REQUEST_ANRECHNUNG_URI = '/lehre/anrechnung/RequestAnrechnung'; + + const ANRECHNUNGSTATUS_PROGRESSED_BY_STGL = 'inProgressDP'; + const ANRECHNUNGSTATUS_PROGRESSED_BY_KF = 'inProgressKF'; + const ANRECHNUNGSTATUS_APPROVED = 'approved'; + const ANRECHNUNGSTATUS_REJECTED = 'rejected'; + + const DEADLINE_INTERVAL_NACH_SEMESTERSTART = 'P1M'; // Deadline for application + public function __construct() { // Set required permissions @@ -15,12 +24,14 @@ class requestAnrechnung extends Auth_Controller ); // Load models - $this->load->model('system/Benutzerrolle_model', 'BenutzerrolleModel'); + $this->load->model('education/Anrechnung_model', 'AnrechnungModel'); + $this->load->model('content/DmsVersion_model', 'DmsVersionModel'); // Load libraries $this->load->library('WidgetLib'); $this->load->library('PermissionLib'); $this->load->library('AnrechnungLib'); + $this->load->library('DmsLib'); // Load helpers $this->load->helper('form'); @@ -46,10 +57,35 @@ class requestAnrechnung extends Auth_Controller public function index() { $studiensemester_kurzbz = $this->input->get('studiensemester'); - $lv_id = $this->input->get('lv_id'); + $lehrveranstaltung_id = $this->input->get('lv_id'); + + if (!is_numeric($lehrveranstaltung_id) || !is_string($studiensemester_kurzbz)) + { + show_error('Missing correct parameter'); + } + + // Check if application deadline is expired + $is_expired = $this->_checkAntragDeadline($studiensemester_kurzbz); + + // Get Anrechung data + $result = $this->anrechnunglib->getAnrechnungData($lehrveranstaltung_id); + if (!$anrechnungData = getData($result)) + { + show_error(getError($anrechnungData)); + } + + // Overwrite progress status for student view. If no Anrechnung exists yet, set to new. + $anrechnungData->status = empty($anrechnungData->status) + ? getUserLanguage() == 'German' ? 'neu' : 'new' + : $this->_getLastAnrechnungstatus($anrechnungData->anrechnung_id); $viewData = array( - 'anrechnungData' => $this->anrechnunglib->getAnrechnungData($this->_uid, $studiensemester_kurzbz, $lv_id) + 'antragData' => $this->anrechnunglib->getAntragData($this->_uid, $studiensemester_kurzbz, $lehrveranstaltung_id), + 'anrechnungData' => $anrechnungData, + 'is_expired' => $is_expired, + 'disabled' => $is_expired && empty($anrechnungData->anrechnung_id) || !empty($anrechnungData->anrechnung_id) + ? 'disabled' + : '' ); $this->load->view('lehre/anrechnung/requestAnrechnung.php', $viewData); @@ -71,5 +107,85 @@ class requestAnrechnung extends Auth_Controller if (!$this->_uid) show_error('User authentification failed'); } + /** + * Load Prestudent by uid and Studiensemester. + * @param $uid + * @param $studiensemester_kurzbz + * @return mixed + */ + private function _loadPrestudent($uid, $studiensemester_kurzbz) + { + $this->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel'); + $this->load->model('crm/Student_model', 'StudentModel'); + + $this->PrestudentstatusModel->addJoin('public.tbl_student', 'prestudent_id'); + return $this->PrestudentstatusModel->loadWhere(array( + 'student_uid' => $uid, + 'studiensemester_kurzbz' => $studiensemester_kurzbz + ) + ); + } + /** + * Check if application deadline is expired. + * @param $studiensemester_kurzbz + * @return bool True if semester start is more then 1 week ago + * @throws Exception + */ + private function _checkAntragDeadline($studiensemester_kurzbz) + { + $this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel'); + $this->StudiensemesterModel->addSelect('start'); + if (!$start = getData($this->StudiensemesterModel->load($studiensemester_kurzbz))) + { + show_error(getError($start)); + } + + $start = new DateTime($start[0]->start); + $today = new DateTime('today midnight'); + + // True if today > application deadline + return ($today > $start->add((new DateInterval(self::DEADLINE_INTERVAL_NACH_SEMESTERSTART)))); + } + + /** + * Get Anrechnung by Lehrveranstaltung + * @param $lehrveranstaltung_id + * @return mixed + */ + private function _getAnrechnung($lehrveranstaltung_id) + { + $result = $this->AnrechnungModel->loadWhere(array( + 'lehrveranstaltung_id' => $lehrveranstaltung_id + )); + + if (isError($result)) + { + show_error(getError($result)); + } + + return $result; + } + + /** + * Get last Anrechnungstatus. Modify progress status for student view. + * @param $anrechnung_id + * @return string + */ + private function _getLastAnrechnungstatus($anrechnung_id) + { + $result = $this->AnrechnungModel->getLastAnrechnungstatus($anrechnung_id); + $status_kurzbz = getData($result)[0]->status_kurzbz; + + // Dont show who is progressing the application + if ($status_kurzbz == 'inProgressDP' || $status_kurzbz == 'inProgressKF') + { + return getUserLanguage() == 'German' ? 'in Bearbeitung' : 'in process'; + } + else + { + $status_mehrsprachig = getData($result)[0]->bezeichnung_mehrsprachig; + return getUserLanguage() == 'German' ? $status_mehrsprachig[0] : $status_mehrsprachig[1]; + } + } } \ No newline at end of file diff --git a/application/libraries/AnrechnungLib.php b/application/libraries/AnrechnungLib.php index 472a2c0e1..ad3ce44b9 100644 --- a/application/libraries/AnrechnungLib.php +++ b/application/libraries/AnrechnungLib.php @@ -8,21 +8,23 @@ class AnrechnungLib { $this->ci =& get_instance(); + $this->ci->load->model('education/Anrechnung_model', 'AnrechnungModel'); $this->ci->load->model('person/Person_model', 'PersonModel'); $this->ci->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel'); $this->ci->load->model('organisation/Studiengang_model', 'StudiengangModel'); + $this->ci->load->model('content/DmsVersion_model', 'DmsVersionModel'); } /** - * Get Anrechnung data + * Get Antrag data * @param $uid * @param $studiensemester_kurzbz * @param $lv_id * @return StdClass */ - public function getAnrechnungData($uid, $studiensemester_kurzbz, $lv_id) + public function getAntragData($uid, $studiensemester_kurzbz, $lv_id) { - $anrechnung_data = new StdClass(); + $antrag_data = new StdClass(); // Get lehrveranstaltung data. Break, if course is not assigned to student. if(!$lv = getData($this->ci->LehrveranstaltungModel->getLvByStudent($uid, $studiensemester_kurzbz, $lv_id))[0]) @@ -43,23 +45,90 @@ class AnrechnungLib } // Get lectors of lehrveranstaltung - $anrechnung_data->lektoren = array(); + $antrag_data->lektoren = array(); if (!$lv_lektoren = getData($this->ci->LehrveranstaltungModel->getLecturersByLv($studiensemester_kurzbz, $lv_id))) { show_error('Failed loading course lectors.'); } // Set the given studiensemester - $anrechnung_data->lv_bezeichnung = $lv->bezeichnung; - $anrechnung_data->ects = $lv->ects; - $anrechnung_data->studiensemester_kurzbz = $studiensemester_kurzbz; - $anrechnung_data->vorname = $person->vorname; - $anrechnung_data->nachname = $person->nachname; - $anrechnung_data->bpk = $person->bpk; - $anrechnung_data->stg_bezeichnung = $studiengang->bezeichnung; - $anrechnung_data->lektoren = $lv_lektoren; + $antrag_data->lv_id = $lv_id; + $antrag_data->lv_bezeichnung = $lv->bezeichnung; + $antrag_data->ects = $lv->ects; + $antrag_data->studiensemester_kurzbz = $studiensemester_kurzbz; + $antrag_data->vorname = $person->vorname; + $antrag_data->nachname = $person->nachname; + $antrag_data->bpk = $person->bpk; + $antrag_data->stg_bezeichnung = $studiengang->bezeichnung; + $antrag_data->lektoren = $lv_lektoren; - return $anrechnung_data; + return $antrag_data; + } + + /** + * Get Anrechnung data by Lehrveranstaltung. Also retrieves last status and Nachweisdokument dms data. + * @param $lehrveranstaltung_id + * @return array + * @throws Exception + */ + public function getAnrechnungData($lehrveranstaltung_id) + { + $anrechnung_data = new StdClass(); + $anrechnung_data->anrechnung_id = ''; + $anrechnung_data->begruendung_id = ''; + $anrechnung_data->anmerkung = ''; + $anrechnung_data->dms_id = ''; + $anrechnung_data->insertamum = ''; + $anrechnung_data->insertvon = ''; + $anrechnung_data->studiensemester_kurzbz = ''; + $anrechnung_data->empfehlung = false; + $anrechnung_data->status = ''; + $anrechnung_data->dokumentname = ''; + + $result = $this->ci->AnrechnungModel->loadWhere(array('lehrveranstaltung_id' => $lehrveranstaltung_id)); + + if (isError($result)) + { + show_error(getError($result)); + } + + if ($anrechnung = getData($result)[0]) + { + // Get Anrechnung data + $anrechnung_data->anrechnung_id = $anrechnung->anrechnung_id; + $anrechnung_data->begruendung_id = $anrechnung->begruendung_id; + $anrechnung_data->anmerkung = $anrechnung->anmerkung_student; + $anrechnung_data->dms_id = $anrechnung->dms_id; + $anrechnung_data->insertamum = (new DateTime($anrechnung->insertamum))->format('d.m.Y'); + $anrechnung_data->insertvon= $anrechnung->insertvon; + $anrechnung_data->studiensemester_kurzbz= $anrechnung->studiensemster_kurzbz; + $anrechnung_data->empfehlung= $anrechnung->empfehlung_anrechnung; + + // Get last status bezeichnung in the users language + $anrechnung_data->status = $this->getLastAnrechnungstatus($anrechnung->anrechnung_id); + + // Get document name + $this->ci->DmsVersionModel->addSelect('name'); + $result = $this->ci->DmsVersionModel->loadWhere(array('dms_id' => $anrechnung->dms_id)); + $anrechnung_data->dokumentname = $result->retval[0]->name; + } + + return success($anrechnung_data); + } + + /** + * @param $anrechnung_id + * @return mixed + */ + public function getLastAnrechnungstatus($anrechnung_id) + { + $result = $this->ci->AnrechnungModel->getLastAnrechnungstatus($anrechnung_id); + + $status_mehrsprachig = getData($result)[0]->bezeichnung_mehrsprachig; + $status = getUserLanguage() == 'German' ? $status_mehrsprachig[0] : $status_mehrsprachig[1]; + + return $status; } + } \ No newline at end of file From 5af134312c06f2692b6d16f5afd999c3fd47186d Mon Sep 17 00:00:00 2001 From: Cris Date: Thu, 14 Jan 2021 14:12:08 +0100 Subject: [PATCH 013/142] Added logic for uploading file and saving anrechnung Signed-off-by: cris-technikum --- .../lehre/anrechnung/RequestAnrechnung.php | 99 ++++++++++++++++++- application/libraries/DmsLib.php | 1 + 2 files changed, 98 insertions(+), 2 deletions(-) diff --git a/application/controllers/lehre/anrechnung/RequestAnrechnung.php b/application/controllers/lehre/anrechnung/RequestAnrechnung.php index 482c5ab7b..d831f4f2d 100644 --- a/application/controllers/lehre/anrechnung/RequestAnrechnung.php +++ b/application/controllers/lehre/anrechnung/RequestAnrechnung.php @@ -91,9 +91,104 @@ class requestAnrechnung extends Auth_Controller $this->load->view('lehre/anrechnung/requestAnrechnung.php', $viewData); } - public function uploadFile($filename = null) + public function apply() { -// $this->extensionslib->installExtension(urldecode($filename)); + $anmerkung = $this->input->post('anmerkung'); + $begruendung_id = $this->input->post('begruendung'); + $lehrveranstaltung_id = $this->input->post('lehrveranstaltung_id'); + $studiensemester_kurzbz = $this->input->post('studiensemester_kurzbz'); + + if (empty($_FILES['uploadfile']['name'])) + { + show_error('Missing upload file'); + } + + if (!is_numeric($begruendung_id) || !is_numeric($lehrveranstaltung_id) || !is_string($studiensemester_kurzbz)) + { + show_error('Missing correct parameter'); + } + + $result = $this->_getAnrechnung($lehrveranstaltung_id); + if (hasData($result)) + { + show_error('Der Antrag wurde bereits gestellt'); + } + + // Start DB transaction + $this->db->trans_start(false); + + // Upload document + $dms = array( + 'kategorie_kurzbz' => 'anrechnung', + 'version' => 0, + 'name' => $_FILES['uploadfile']['name'], + 'mimetype' => $_FILES['uploadfile']['type'], + 'insertamum' => (new DateTime())->format('Y-m-d H:i:s'), + 'insertvon' => $this->_uid + ); + + if(isError($uploaddata = $this->dmslib->upload($dms, array('jpg', 'pdf')))) + { + show_error(getError($uploaddata)); + } + + // Get PrestudentID + $result = $this->_loadPrestudent($this->_uid, $studiensemester_kurzbz); + + if (!$prestudent = getData($result)[0]) + { + show_error('Failed retrieving prestudent'); + } + + // Save Anrechnung with Status 'inProgressSTGL' + $result = $this->AnrechnungModel->insert(array( + 'prestudent_id' => $prestudent->prestudent_id, + 'lehrveranstaltung_id' => $lehrveranstaltung_id, + 'begruendung_id' => $begruendung_id, + 'dms_id' => $uploaddata->retval['dms_id'], + 'studiensemester_kurzbz' => $studiensemester_kurzbz, + 'anmerkung_student' => $anmerkung + )); + + if (isError($result)) + { + show_error('Failed inserting Anrechnung'); + } + + $result = $this->AnrechnungModel->saveAnrechnungstatus($result->retval, self::ANRECHNUNGSTATUS_PROGRESSED_BY_STGL); + + if (isError($result)) + { + show_error('Failed saving Anrechnungstatus'); + } + + // Transaction complete! + $this->db->trans_complete(); + + if ($this->db->trans_status() === false || isError($result)) + { + $this->db->trans_rollback(); + show_error($result->msg, EXIT_ERROR); + } + + // Send mail to STGL + $this->load->model('organisation/Studiengang_model', 'StudiengangModel'); + $studiengang = $this->StudiengangModel->load($prestudent->studiengang_kz); + + // Send mail + $this->load->library('MailLib'); + if(!$this->maillib->send( + "noreply@". DOMAIN, + $studiengang->retval[0]->email, + 'Neuer LV-Anrechnungsantrag', + 'Eine neuer LV Anrechnungsantrag steht zur Prüfung bereit.')) + { + show_error('Failed sending email to STGL'); + } + else + { + redirect(site_url(). self::REQUEST_ANRECHNUNG_URI. '?studiensemester='. $studiensemester_kurzbz. '&lv_id='. $lehrveranstaltung_id); + } } diff --git a/application/libraries/DmsLib.php b/application/libraries/DmsLib.php index 04204012b..bad9e0acf 100644 --- a/application/libraries/DmsLib.php +++ b/application/libraries/DmsLib.php @@ -120,6 +120,7 @@ class DmsLib { return error('Failed inserting to DMS'); } + $upload_data['dms_id'] = $result->retval; // Insert DMS version if (!$result = $this->ci->DmsVersionModel->insert( From b57a3ec90f6a50f5746eafbb527055fa09623735 Mon Sep 17 00:00:00 2001 From: Cris Date: Thu, 14 Jan 2021 14:13:17 +0100 Subject: [PATCH 014/142] Added logic to download and open a document Signed-off-by: cris-technikum --- .../lehre/anrechnung/RequestAnrechnung.php | 14 +++++++ application/libraries/DmsLib.php | 41 +++++++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/application/controllers/lehre/anrechnung/RequestAnrechnung.php b/application/controllers/lehre/anrechnung/RequestAnrechnung.php index d831f4f2d..68e06ca80 100644 --- a/application/controllers/lehre/anrechnung/RequestAnrechnung.php +++ b/application/controllers/lehre/anrechnung/RequestAnrechnung.php @@ -191,6 +191,20 @@ class requestAnrechnung extends Auth_Controller } } + /** + * Download and open uploaded document (Nachweisdokument). + */ + public function download() + { + $dms_id = $this->input->get('dms_id'); + + if (!is_numeric($dms_id)) + { + show_error('Wrong parameter'); + } + + $this->dmslib->download($dms_id); + } /** * Retrieve the UID of the logged user and checks if it is valid diff --git a/application/libraries/DmsLib.php b/application/libraries/DmsLib.php index bad9e0acf..64d58f987 100644 --- a/application/libraries/DmsLib.php +++ b/application/libraries/DmsLib.php @@ -132,6 +132,47 @@ class DmsLib // return result of uploaded data return success($upload_data); // data about the uploaded file } + + /** + * Download a document + * @param $dms_id + */ + public function download($dms_id) + { + if (!is_numeric($dms_id)) + { + show_error('Wrong parameter'); + } + + $this->ci->DmsVersionModel->addSelect('filename'); + $result = $this->ci->DmsVersionModel->loadWhere(array('dms_id' => $dms_id)); + + if (isError($result)) + { + show_error(getError($result)); + } + + $filename = $result->retval[0]->filename; + $file = DMS_PATH. $filename; + + if (file_exists($file)) + { + $finfo = new finfo(FILEINFO_MIME); + + header('Content-Description: File Transfer'); + header('Content-Type: '.$finfo->file($file)); + header('Expires: 0'); + header('Cache-Control: must-revalidate'); + header('Pragma: public'); + header('Content-Length: ' . filesize($file)); + readfile($file); + exit; + } + else + { + show_error('File does not exist'); + } + } /** * Saves a Document From 091d921efad112f058caa7665f6c6712ae207863 Mon Sep 17 00:00:00 2001 From: Cris Date: Thu, 14 Jan 2021 14:16:53 +0100 Subject: [PATCH 015/142] Redesigned and adapted GUI Added download, alerts, new layout and styles that fit better to new adaptations and to other GUIs. Signed-off-by: cris-technikum --- .../lehre/anrechnung/requestAnrechnung.php | 212 ++++++++++-------- 1 file changed, 114 insertions(+), 98 deletions(-) diff --git a/application/views/lehre/anrechnung/requestAnrechnung.php b/application/views/lehre/anrechnung/requestAnrechnung.php index 87ae62b0f..c1e9b7818 100644 --- a/application/views/lehre/anrechnung/requestAnrechnung.php +++ b/application/views/lehre/anrechnung/requestAnrechnung.php @@ -31,7 +31,7 @@ $this->load->view( ), 'customJSs' => array( 'public/js/bootstrapper.js', - 'public/js/lehre/anrechnung/Anrechnung.js') + 'public/js/lehre/anrechnung/requestAnrechnung.js') ) ); ?> @@ -40,149 +40,165 @@ $this->load->view(
    -
    - +
    + + 'requestAnrechnung-form'], + ['lehrveranstaltung_id' => $antragData->lv_id, 'studiensemester_kurzbz' => $antragData->studiensemester_kurzbz] + ); ?>
    -
    -
    - -
    -
    - -
    -
    -
    -
    - p->t('anrechnung', 'antragsdaten'); ?> - Status: p->t('anrechnung', 'neu'); ?> -
    - - +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + p->t('anrechnung', 'antrag'); ?> + Status: status; ?> +
    +
    + - + - + - + - + - + - + - -
    p->t('person', 'student'); ?>vorname. ' '. $anrechnungData->nachname; ?>vorname. ' '. $antragData->nachname; ?>
    p->t('person', 'personenkennzeichen'); ?>bpk ?>bpk ?>
    p->t('lehre', 'studiensemester'); ?>studiensemester_kurzbz ?>studiensemester_kurzbz ?>
    p->t('lehre', 'studiengang'); ?>stg_bezeichnung ?>stg_bezeichnung ?>
    p->t('lehre', 'lehrveranstaltung'); ?>lv_bezeichnung ?>lv_bezeichnung ?>
    p->t('lehre', 'ects'); ?>ects ?>ects ?>
    p->t('lehre', 'lektor'); ?> - lektoren) - 1 ?> - lektoren as $key => $lektor): ?> - vorname. ' '. $lektor->nachname; - echo $key === $len ? '' : ', ' ?> - + lektoren) - 1 ?> + lektoren as $key => $lektor): ?> + vorname. ' '. $lektor->nachname; + echo $key === $len ? '' : ', ' ?> +
    + + +
    -
    - -
    -
    -
    -
    - p->t('anrechnung', 'dokumentZumNachweis'); ?> -
    -
    - -
    - + +
    +
    +
    +

    p->t('anrechnung', 'antragStellenText'); ?>

    +
    + +
    +
    +
    - -
    -
    -
    -
    - -
    -
    -
    -
    -
    - p->t('anrechnung', 'weitereInformationen'); ?> + +
    +
    +
    +
    + p->t('anrechnung', 'nachweisdokumente'); ?> +
    +
    +
    + > +
    + dms_id)): ?> + dokumentname ?> + +
    -
    - +
    +
    + +
    +
    +
    +
    +
    +
    + p->t('anrechnung', 'weitereInformationen'); ?> +
    +
    + +
    +
    +
    - -
    -
    -
    -

    p->t('anrechnung', 'antragStellenText'); ?>

    -
    - -
    -
    - -
    -
    -
    -
    +
    +
    + Status: status; ?> +
    + anrechnung_id)): ?> +
    + Antrag gestellt am insertamum; ?> +
    + + +
    + p->t('global', 'bearbeitungGesperrt'); ?> + anrechnung_id)? ': '. $this->p->t('anrechnung', 'deadlineUeberschritten') : ''; ?> +anrechnung_id) ? $this->p->t('anrechnung', 'anrechnungIst'). ' '. $anrechnungData->status : ''; ?> +
    + +
    -
    -
    +
    From 85ec64876d18ff384fd35642fc2c4bb029195628 Mon Sep 17 00:00:00 2001 From: Cris Date: Thu, 14 Jan 2021 14:18:28 +0100 Subject: [PATCH 016/142] Changed permission to student/anrechnung_beantragen Signed-off-by: cris-technikum --- .../controllers/lehre/anrechnung/RequestAnrechnung.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/application/controllers/lehre/anrechnung/RequestAnrechnung.php b/application/controllers/lehre/anrechnung/RequestAnrechnung.php index 68e06ca80..c4f188f0c 100644 --- a/application/controllers/lehre/anrechnung/RequestAnrechnung.php +++ b/application/controllers/lehre/anrechnung/RequestAnrechnung.php @@ -18,8 +18,9 @@ class requestAnrechnung extends Auth_Controller // Set required permissions parent::__construct( array( - 'index' => 'admin:rw', - 'uploadFile' => 'admin:rw', + 'index' => 'student/anrechnung_beantragen:rw', + 'apply' => 'student/anrechnung_beantragen:rw', + 'download' => 'student/anrechnung_beantragen:rw', ) ); From dc84c91dae8f116940ce7d664c287a72de80247c Mon Sep 17 00:00:00 2001 From: Cris Date: Thu, 14 Jan 2021 14:21:00 +0100 Subject: [PATCH 017/142] Added methods saveAnrechnungstatus() and getLastAnrechnungstatus() Signed-off-by: cris-technikum --- .../models/education/Anrechnung_model.php | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/application/models/education/Anrechnung_model.php b/application/models/education/Anrechnung_model.php index f16310fe4..56d3f3062 100644 --- a/application/models/education/Anrechnung_model.php +++ b/application/models/education/Anrechnung_model.php @@ -11,4 +11,40 @@ class Anrechnung_model extends DB_Model $this->dbTable = 'lehre.tbl_anrechnung'; $this->pk = 'anrechnung_id'; } + + /** + * Save Anrechnungstatus. + * @param $anrechnung_id + * @param $status_kurzbz + * @return array|null + */ + public function saveAnrechnungstatus($anrechnung_id, $status_kurzbz) + { + $qry = ' + INSERT INTO lehre.tbl_anrechnung_anrechnungstatus ( + anrechnung_id, status_kurzbz, insertvon + ) VALUES ( ?, ?, ?); + '; + + return $this->execQuery($qry, array($anrechnung_id, $status_kurzbz, getAuthUID())); + } + + /** + * Get the last inserted Anrechnungstatus + * @param $anrechnung_id + * @return array|null + */ + public function getLastAnrechnungstatus($anrechnung_id) + { + $qry = ' + SELECT status_kurzbz, bezeichnung_mehrsprachig + FROM lehre.tbl_anrechnungstatus + JOIN lehre.tbl_anrechnung_anrechnungstatus USING (status_kurzbz) + WHERE anrechnung_id = ? + ORDER BY insertamum DESC + LIMIT 1 + '; + + return $this->execQuery($qry, array($anrechnung_id)); + } } From a1dfd3f598f3fb528572563a4522acdde4cfc000 Mon Sep 17 00:00:00 2001 From: Cris Date: Thu, 14 Jan 2021 14:21:53 +0100 Subject: [PATCH 018/142] Created new model Anrechnungstatus_model Signed-off-by: cris-technikum --- .../models/education/Anrechnungstatus_model.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 application/models/education/Anrechnungstatus_model.php diff --git a/application/models/education/Anrechnungstatus_model.php b/application/models/education/Anrechnungstatus_model.php new file mode 100644 index 000000000..6ae5ffd22 --- /dev/null +++ b/application/models/education/Anrechnungstatus_model.php @@ -0,0 +1,15 @@ +dbTable = 'lehre.tbl_anrechnungstatus'; + $this->pk = 'status_kurzbz'; + } +} From aff838d3c3307ed580d4c845583a584fcedc53d5 Mon Sep 17 00:00:00 2001 From: Cris Date: Thu, 14 Jan 2021 14:55:42 +0100 Subject: [PATCH 019/142] Fixed typo studiensemester in AnrechnungLib Signed-off-by: cris-technikum --- application/libraries/AnrechnungLib.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/application/libraries/AnrechnungLib.php b/application/libraries/AnrechnungLib.php index ad3ce44b9..d317e4dfc 100644 --- a/application/libraries/AnrechnungLib.php +++ b/application/libraries/AnrechnungLib.php @@ -101,9 +101,8 @@ class AnrechnungLib $anrechnung_data->dms_id = $anrechnung->dms_id; $anrechnung_data->insertamum = (new DateTime($anrechnung->insertamum))->format('d.m.Y'); $anrechnung_data->insertvon= $anrechnung->insertvon; - $anrechnung_data->studiensemester_kurzbz= $anrechnung->studiensemster_kurzbz; + $anrechnung_data->studiensemester_kurzbz= $anrechnung->studiensemester_kurzbz; $anrechnung_data->empfehlung= $anrechnung->empfehlung_anrechnung; - // Get last status bezeichnung in the users language $anrechnung_data->status = $this->getLastAnrechnungstatus($anrechnung->anrechnung_id); From 67c130f9c1c46ce831261cbff2e84d2c64fbc0e0 Mon Sep 17 00:00:00 2001 From: Cris Date: Thu, 14 Jan 2021 15:22:20 +0100 Subject: [PATCH 020/142] Included Anrechnung beantragen into CIS Menu Signed-off-by: cris-technikum --- config/global.config-default.inc.php | 1 + include/tw/cis_menu_lv.inc.php | 15 ++++++++++++++- locale/de-AT/lehre.php | 1 + locale/en-US/lehre.php | 2 ++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/config/global.config-default.inc.php b/config/global.config-default.inc.php index 496eb73cb..b31447994 100644 --- a/config/global.config-default.inc.php +++ b/config/global.config-default.inc.php @@ -26,6 +26,7 @@ define('CIS_LEHRVERANSTALTUNG_LEISTUNGSUEBERSICHT_ANZEIGEN',true); define('CIS_LEHRVERANSTALTUNG_SEMESTERINFO_ANZEIGEN',true); define('CIS_LEHRVERANSTALTUNG_LEHRFACH_ANZEIGEN',false); define('CIS_LEHRVERANSTALTUNG_GESAMTNOTE_ANZEIGEN', true); +define('CIS_LEHRVERANSTALTUNG_ANRECHNUNG_ANZEIGEN', true); // Im CIS Menue Links bei Modulen anzeigen wenn Lehrauftrag define('CIS_LEHRVERANSTALTUNG_MODULE_LINK',true); diff --git a/include/tw/cis_menu_lv.inc.php b/include/tw/cis_menu_lv.inc.php index b8c42da11..173b8d88c 100644 --- a/include/tw/cis_menu_lv.inc.php +++ b/include/tw/cis_menu_lv.inc.php @@ -421,7 +421,6 @@ function checkZeilenUmbruch() 'link'=>'../../../cms/news.php?studiengang_kz='.urlencode($studiengang_kz).'&semester='.urlencode($semester), 'text'=>$text ); - } if(!defined('CIS_LEHRVERANSTALTUNG_ABMELDUNG_ANZEIGEN') || CIS_LEHRVERANSTALTUNG_ABMELDUNG_ANZEIGEN) @@ -466,6 +465,20 @@ function checkZeilenUmbruch() } } + // Anerkennung nachgewiesener Kenntnisse (Anrechnung) + if((!defined('CIS_LEHRVERANSTALTUNG_ANRECHNUNG_ANZEIGEN') || CIS_LEHRVERANSTALTUNG_ANRECHNUNG_ANZEIGEN) + && $rechte->isBerechtigt('student/anrechnung_beantragen')) + { + $menu[]=array + ( + 'id'=>'core_menu_anerkennungNachgewiesenerKenntnisse', + 'position'=>'128', + 'name'=>$p->t('lehre/anerkennungNachgewiesenerKenntnisse'), + 'icon'=>'../../../skin/images/button_kreuzerltool.png', + 'link' => APP_ROOT. 'index.ci.php/lehre/anrechnung/RequestAnrechnung?studiensemester='.urlencode($angezeigtes_stsem).'&lv_id='.urlencode($lvid) + ); + } + //************* Menuepunkte anzeigen **************** diff --git a/locale/de-AT/lehre.php b/locale/de-AT/lehre.php index 46633c747..3262020d8 100644 --- a/locale/de-AT/lehre.php +++ b/locale/de-AT/lehre.php @@ -40,4 +40,5 @@ $this->phrasen['lehre/nichtzugeteilt']='Sie sind nicht zu dieser Lehrveranstaltu $this->phrasen['lehre/studienordnung']='Studienordnung'; $this->phrasen['lehre/studienplan']='Studienplan'; $this->phrasen['lehre/noteneingabedeaktiviert']='Noteneingabe deaktiviert'; +$this->phrasen['lehre/anerkennungNachgewiesenerKenntnisse']='Anerkennung nachgewiesener Kenntnisse'; ?> diff --git a/locale/en-US/lehre.php b/locale/en-US/lehre.php index 3fd6e5cd0..df990b6a1 100644 --- a/locale/en-US/lehre.php +++ b/locale/en-US/lehre.php @@ -40,4 +40,6 @@ $this->phrasen['lehre/nichtzugeteilt']='Sie sind nicht zu dieser Lehrveranstaltu $this->phrasen['lehre/studienordnung']='Studienordnung'; $this->phrasen['lehre/studienplan']='Studienplan'; $this->phrasen['lehre/noteneingabedeaktiviert']='Grading disabled'; +$this->phrasen['lehre/anerkennungNachgewiesenerKenntnisse']='Crediting for proven knowledge'; + ?> From 0d546dc0c0bc636cba626c5234c0f0345f1360a4 Mon Sep 17 00:00:00 2001 From: Cris Date: Thu, 14 Jan 2021 15:24:26 +0100 Subject: [PATCH 021/142] Renamed POST parameter lv_id, studiensemester ...to stay consistent Signed-off-by: cris-technikum --- .../controllers/lehre/anrechnung/RequestAnrechnung.php | 4 ++-- application/views/lehre/anrechnung/requestAnrechnung.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/application/controllers/lehre/anrechnung/RequestAnrechnung.php b/application/controllers/lehre/anrechnung/RequestAnrechnung.php index c4f188f0c..b9d751611 100644 --- a/application/controllers/lehre/anrechnung/RequestAnrechnung.php +++ b/application/controllers/lehre/anrechnung/RequestAnrechnung.php @@ -96,8 +96,8 @@ class requestAnrechnung extends Auth_Controller { $anmerkung = $this->input->post('anmerkung'); $begruendung_id = $this->input->post('begruendung'); - $lehrveranstaltung_id = $this->input->post('lehrveranstaltung_id'); - $studiensemester_kurzbz = $this->input->post('studiensemester_kurzbz'); + $lehrveranstaltung_id = $this->input->post('lv_id'); + $studiensemester_kurzbz = $this->input->post('studiensemester'); if (empty($_FILES['uploadfile']['name'])) { diff --git a/application/views/lehre/anrechnung/requestAnrechnung.php b/application/views/lehre/anrechnung/requestAnrechnung.php index c1e9b7818..7dd39b2e6 100644 --- a/application/views/lehre/anrechnung/requestAnrechnung.php +++ b/application/views/lehre/anrechnung/requestAnrechnung.php @@ -51,7 +51,7 @@ $this->load->view( 'requestAnrechnung-form'], - ['lehrveranstaltung_id' => $antragData->lv_id, 'studiensemester_kurzbz' => $antragData->studiensemester_kurzbz] + ['lv_id' => $antragData->lv_id, 'studiensemester' => $antragData->studiensemester_kurzbz] ); ?>
    From b6f5bc27037a9b11d419a5397fa5a20c88a40bdd Mon Sep 17 00:00:00 2001 From: Cris Date: Thu, 14 Jan 2021 15:27:44 +0100 Subject: [PATCH 022/142] Added phrases for Anrechnung beantragen Signed-off-by: cris-technikum --- system/phrasesupdate.php | 304 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 302 insertions(+), 2 deletions(-) diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 727a389e4..cefdd6844 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -48,6 +48,26 @@ $phrases = array( ) ) ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'bearbeitungGesperrt', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Bearbeitung gesperrt', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Locked for editing', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), array( 'app' => 'core', 'category' => 'global', @@ -1549,7 +1569,7 @@ $phrases = array( 'phrases' => array( array( 'sprache' => 'German', - 'text' => 'Student', + 'text' => 'StudentIn', 'description' => '', 'insertvon' => 'system' ), @@ -2471,7 +2491,7 @@ $phrases = array( 'phrases' => array( array( 'sprache' => 'German', - 'text' => 'Lektor', + 'text' => 'LektorIn', 'description' => '', 'insertvon' => 'system' ), @@ -7988,6 +8008,286 @@ Any unusual occurrences 'insertvon' => 'system' ) ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'anerkennungNachgewiesenerKenntnisse', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Anerkennung nachgewiesener Kenntnisse', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Crediting for proven knowledge', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'anrechnungBeantragen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Anrechnung beantragen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Apply', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'antragStellen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Antrag stellen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Submit an application', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'antragsdaten', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Antragsdaten', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Application data', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'nachweisdokumente', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Nachweisdokumente', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Verification documents', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'person', + 'phrase' => 'personenkennzeichen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Personenkennzeichen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Personal identity number', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'hochladen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Hochladen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Upload', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'antragStellenText', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Ich beantrage die Feststellung der Gleichwertigkeit aufgrund', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'antragStellenWegenZeugnis', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'eines Zeugnisses (vgl. § 4 Abs. 4, Satzungsteil 5 der FHTW)', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'antragStellenWegenPraxis', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'der nachgewiesenen beruflichen Praxis (vgl. § 4 Abs. 5, Satzungsteil 5 der FHTW)', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'weitereInformationen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Weitere Informationen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Further information', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'antrag', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Antrag', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Application', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'anrechnungIst', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Antrag ist', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Application is', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'deadlineUeberschritten', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Deadline ist überschritten', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Deadline is exceeded', + 'description' => '', + 'insertvon' => 'system' + ) + ) ) ); From de5c67d2f18003e118b74fb0e585c8989f82440f Mon Sep 17 00:00:00 2001 From: Cris Date: Mon, 18 Jan 2021 13:41:46 +0100 Subject: [PATCH 023/142] Devided methods getAnrechnungData and getAnrechnungDataByLv Signed-off-by: cris-technikum --- .../lehre/anrechnung/RequestAnrechnung.php | 2 +- application/libraries/AnrechnungLib.php | 81 ++++++++++++++----- 2 files changed, 64 insertions(+), 19 deletions(-) diff --git a/application/controllers/lehre/anrechnung/RequestAnrechnung.php b/application/controllers/lehre/anrechnung/RequestAnrechnung.php index b9d751611..187d26685 100644 --- a/application/controllers/lehre/anrechnung/RequestAnrechnung.php +++ b/application/controllers/lehre/anrechnung/RequestAnrechnung.php @@ -69,7 +69,7 @@ class requestAnrechnung extends Auth_Controller $is_expired = $this->_checkAntragDeadline($studiensemester_kurzbz); // Get Anrechung data - $result = $this->anrechnunglib->getAnrechnungData($lehrveranstaltung_id); + $result = $this->anrechnunglib->getAnrechnungDataByLv($lehrveranstaltung_id); if (!$anrechnungData = getData($result)) { show_error(getError($anrechnungData)); diff --git a/application/libraries/AnrechnungLib.php b/application/libraries/AnrechnungLib.php index d317e4dfc..f77565e7c 100644 --- a/application/libraries/AnrechnungLib.php +++ b/application/libraries/AnrechnungLib.php @@ -65,13 +65,44 @@ class AnrechnungLib return $antrag_data; } + /** + * Get Anrechnung data, last status and Nachweisdokument dms data. + * @param $anrechnung_id + * @return array + * @throws Exception + */ + public function getAnrechnungData($anrechnung_id) + { + if (!is_numeric($anrechnung_id)) + { + show_error('Incorrect parameter'); + } + + $anrechnung_data = new StdClass(); + + $result = $this->ci->AnrechnungModel->load($anrechnung_id); + + if (isError($result)) + { + show_error(getError($result)); + } + + if ($anrechnung = getData($result)[0]) + { + $anrechnung_data = $this->_setAnrechnungDataObject($anrechnung); + } + + return success($anrechnung_data); + + } + /** * Get Anrechnung data by Lehrveranstaltung. Also retrieves last status and Nachweisdokument dms data. * @param $lehrveranstaltung_id * @return array * @throws Exception */ - public function getAnrechnungData($lehrveranstaltung_id) + public function getAnrechnungDataByLv($lehrveranstaltung_id) { $anrechnung_data = new StdClass(); $anrechnung_data->anrechnung_id = ''; @@ -94,22 +125,7 @@ class AnrechnungLib if ($anrechnung = getData($result)[0]) { - // Get Anrechnung data - $anrechnung_data->anrechnung_id = $anrechnung->anrechnung_id; - $anrechnung_data->begruendung_id = $anrechnung->begruendung_id; - $anrechnung_data->anmerkung = $anrechnung->anmerkung_student; - $anrechnung_data->dms_id = $anrechnung->dms_id; - $anrechnung_data->insertamum = (new DateTime($anrechnung->insertamum))->format('d.m.Y'); - $anrechnung_data->insertvon= $anrechnung->insertvon; - $anrechnung_data->studiensemester_kurzbz= $anrechnung->studiensemester_kurzbz; - $anrechnung_data->empfehlung= $anrechnung->empfehlung_anrechnung; - // Get last status bezeichnung in the users language - $anrechnung_data->status = $this->getLastAnrechnungstatus($anrechnung->anrechnung_id); - - // Get document name - $this->ci->DmsVersionModel->addSelect('name'); - $result = $this->ci->DmsVersionModel->loadWhere(array('dms_id' => $anrechnung->dms_id)); - $anrechnung_data->dokumentname = $result->retval[0]->name; + $anrechnung_data = $this->_setAnrechnungDataObject($anrechnung); } return success($anrechnung_data); @@ -128,6 +144,35 @@ class AnrechnungLib return $status; } - + private function _setAnrechnungDataObject($anrechnung) + { + $anrechnung_data = new StdClass(); + + // Get Anrechnung data + $anrechnung_data->anrechnung_id = $anrechnung->anrechnung_id; + $anrechnung_data->begruendung_id = $anrechnung->begruendung_id; + $anrechnung_data->anmerkung = $anrechnung->anmerkung_student; + $anrechnung_data->dms_id = $anrechnung->dms_id; + $anrechnung_data->insertamum = (new DateTime($anrechnung->insertamum))->format('d.m.Y'); + $anrechnung_data->insertvon= $anrechnung->insertvon; + $anrechnung_data->studiensemester_kurzbz= $anrechnung->studiensemester_kurzbz; + $anrechnung_data->empfehlung= $anrechnung->empfehlung_anrechnung; + + // Get last status bezeichnung in the users language + $anrechnung_data->status = $this->getLastAnrechnungstatus($anrechnung->anrechnung_id); + + // Get document name + $this->ci->DmsVersionModel->addSelect('name'); + $result = $this->ci->DmsVersionModel->loadWhere(array('dms_id' => $anrechnung->dms_id)); + + if (isError($result)) + { + show_error(getError($result)); + } + + $anrechnung_data->dokumentname = $result->retval[0]->name; + + return $anrechnung_data; + } } \ No newline at end of file From 4e0fd56d9913e71c71745ab28e8df146f617705e Mon Sep 17 00:00:00 2001 From: Cris Date: Mon, 18 Jan 2021 13:45:11 +0100 Subject: [PATCH 024/142] Corrected empfehlung default value Now default value is empty instead of false, as there are 3 different stati to retrieve 1. null = no recommendation at all (default) 1. true = recommended 1. false = not recommended Signed-off-by: cris-technikum --- application/libraries/AnrechnungLib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/libraries/AnrechnungLib.php b/application/libraries/AnrechnungLib.php index f77565e7c..a39e40fb3 100644 --- a/application/libraries/AnrechnungLib.php +++ b/application/libraries/AnrechnungLib.php @@ -112,7 +112,7 @@ class AnrechnungLib $anrechnung_data->insertamum = ''; $anrechnung_data->insertvon = ''; $anrechnung_data->studiensemester_kurzbz = ''; - $anrechnung_data->empfehlung = false; + $anrechnung_data->empfehlung = ''; $anrechnung_data->status = ''; $anrechnung_data->dokumentname = ''; From 0edccc299ce367aeffbf0e1badf0e9c0304a8534 Mon Sep 17 00:00:00 2001 From: Cris Date: Mon, 18 Jan 2021 13:52:26 +0100 Subject: [PATCH 025/142] Deleted js-file - not needed by now Signed-off-by: cris-technikum --- application/views/lehre/anrechnung/requestAnrechnung.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/views/lehre/anrechnung/requestAnrechnung.php b/application/views/lehre/anrechnung/requestAnrechnung.php index 7dd39b2e6..726a2892d 100644 --- a/application/views/lehre/anrechnung/requestAnrechnung.php +++ b/application/views/lehre/anrechnung/requestAnrechnung.php @@ -30,8 +30,8 @@ $this->load->view( ) ), 'customJSs' => array( - 'public/js/bootstrapper.js', - 'public/js/lehre/anrechnung/requestAnrechnung.js') + 'public/js/bootstrapper.js' + ) ) ); ?> From 3ffc5c7d3f16a491cd7f126b67ae84ba9eb8f5f0 Mon Sep 17 00:00:00 2001 From: Cris Date: Mon, 18 Jan 2021 13:55:45 +0100 Subject: [PATCH 026/142] Deactivated application deadline Deactivated application deadline by setting checking variable is_expired to false. This is to keep the logic for a later time when the application deadline is going to be defined. Signed-off-by: cris-technikum --- .../lehre/anrechnung/RequestAnrechnung.php | 3 ++- .../views/lehre/anrechnung/requestAnrechnung.php | 11 +++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/application/controllers/lehre/anrechnung/RequestAnrechnung.php b/application/controllers/lehre/anrechnung/RequestAnrechnung.php index 187d26685..ed09b131a 100644 --- a/application/controllers/lehre/anrechnung/RequestAnrechnung.php +++ b/application/controllers/lehre/anrechnung/RequestAnrechnung.php @@ -66,7 +66,8 @@ class requestAnrechnung extends Auth_Controller } // Check if application deadline is expired - $is_expired = $this->_checkAntragDeadline($studiensemester_kurzbz); + // $is_expired = $this->_checkAntragDeadline($studiensemester_kurzbz); + $is_expired = false; // Set to false until Deadline is defined // Get Anrechung data $result = $this->anrechnunglib->getAnrechnungDataByLv($lehrveranstaltung_id); diff --git a/application/views/lehre/anrechnung/requestAnrechnung.php b/application/views/lehre/anrechnung/requestAnrechnung.php index 726a2892d..0b11094e4 100644 --- a/application/views/lehre/anrechnung/requestAnrechnung.php +++ b/application/views/lehre/anrechnung/requestAnrechnung.php @@ -182,12 +182,11 @@ $this->load->view( Antrag gestellt am insertamum; ?>
    - -
    - p->t('global', 'bearbeitungGesperrt'); ?> - anrechnung_id)? ': '. $this->p->t('anrechnung', 'deadlineUeberschritten') : ''; ?> -anrechnung_id) ? $this->p->t('anrechnung', 'anrechnungIst'). ' '. $anrechnungData->status : ''; ?> -
    + +
    + p->t('global', 'bearbeitungGesperrt'); ?> + anrechnung_id)? ': '. $this->p->t('anrechnung', 'deadlineUeberschritten') : ''; ?> +
    From e04e58441037b89a539e18d7807d7f2ec67d28ed Mon Sep 17 00:00:00 2001 From: Cris Date: Mon, 18 Jan 2021 15:08:16 +0100 Subject: [PATCH 027/142] Added Anrechnungsdatum Signed-off-by: cris-technikum --- .../lehre/anrechnung/requestAnrechnung.php | 7 +------ system/phrasesupdate.php | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/application/views/lehre/anrechnung/requestAnrechnung.php b/application/views/lehre/anrechnung/requestAnrechnung.php index 0b11094e4..7e37e9e52 100644 --- a/application/views/lehre/anrechnung/requestAnrechnung.php +++ b/application/views/lehre/anrechnung/requestAnrechnung.php @@ -66,7 +66,7 @@ $this->load->view(
    p->t('anrechnung', 'antrag'); ?> - Status: status; ?> + p->t('anrechnung', 'antragdatum'); ?>: anrechnung_id) ? $anrechnungData->insertamum : '-' ?>
    @@ -177,11 +177,6 @@ $this->load->view(
    Status: status; ?>
    - anrechnung_id)): ?> -
    - Antrag gestellt am insertamum; ?> -
    -
    p->t('global', 'bearbeitungGesperrt'); ?> diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index cefdd6844..d6cec5a1e 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -8288,6 +8288,26 @@ Any unusual occurrences 'insertvon' => 'system' ) ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'antragdatum', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Antragsdatum', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Application date', + 'description' => '', + 'insertvon' => 'system' + ) + ) ) ); From 4df012798f38b684e4f74d539a722cc6a9e67de0 Mon Sep 17 00:00:00 2001 From: Cris Date: Mon, 18 Jan 2021 15:09:01 +0100 Subject: [PATCH 028/142] Changed bpk to Matrikelnummer Signed-off-by: cris-technikum --- application/libraries/AnrechnungLib.php | 3 ++- application/models/person/Person_model.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/application/libraries/AnrechnungLib.php b/application/libraries/AnrechnungLib.php index a39e40fb3..4a8f0f962 100644 --- a/application/libraries/AnrechnungLib.php +++ b/application/libraries/AnrechnungLib.php @@ -58,7 +58,8 @@ class AnrechnungLib $antrag_data->studiensemester_kurzbz = $studiensemester_kurzbz; $antrag_data->vorname = $person->vorname; $antrag_data->nachname = $person->nachname; - $antrag_data->bpk = $person->bpk; +// $antrag_data->bpk = $person->bpk; + $antrag_data->bpk = $person->matr_nr; $antrag_data->stg_bezeichnung = $studiengang->bezeichnung; $antrag_data->lektoren = $lv_lektoren; diff --git a/application/models/person/Person_model.php b/application/models/person/Person_model.php index bf85efe33..128af7860 100644 --- a/application/models/person/Person_model.php +++ b/application/models/person/Person_model.php @@ -191,7 +191,7 @@ class Person_model extends DB_Model */ public function getByUid($uid) { - $this->addSelect('vorname, nachname, gebdatum, person_id, bpk'); + $this->addSelect('vorname, nachname, gebdatum, person_id, bpk, matr_nr'); $this->addJoin('tbl_benutzer', 'person_id'); return $this->loadWhere(array('uid' => $uid)); From c0952af290d0e3e8c35761b2450fc8832dcd105d Mon Sep 17 00:00:00 2001 From: Cris Date: Tue, 19 Jan 2021 08:27:59 +0100 Subject: [PATCH 029/142] Corrected default value for empfehlung_anrechnung to be nullable Signed-off-by: cris-technikum --- system/dbupdate_3.3.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/dbupdate_3.3.php b/system/dbupdate_3.3.php index 9ca75012b..0e172f9f0 100644 --- a/system/dbupdate_3.3.php +++ b/system/dbupdate_3.3.php @@ -4473,7 +4473,7 @@ if(!$result = @$db->db_query("SELECT dms_id FROM lehre.tbl_anrechnung")) ALTER TABLE lehre.tbl_anrechnung ADD COLUMN dms_id bigint; ALTER TABLE lehre.tbl_anrechnung ADD COLUMN studiensemester_kurzbz varchar(6); ALTER TABLE lehre.tbl_anrechnung ADD COLUMN anmerkung_student text; - ALTER TABLE lehre.tbl_anrechnung ADD COLUMN empfehlung_anrechnung boolean DEFAULT FALSE; + ALTER TABLE lehre.tbl_anrechnung ADD COLUMN empfehlung_anrechnung boolean; ALTER TABLE lehre.tbl_anrechnung ADD CONSTRAINT fk_anrechnung_studiensemester FOREIGN KEY (studiensemester_kurzbz) REFERENCES public.tbl_studiensemester(studiensemester_kurzbz) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE lehre.tbl_anrechnung ADD CONSTRAINT fk_anrechnung_dms FOREIGN KEY (dms_id) REFERENCES campus.tbl_dms(dms_id) ON DELETE RESTRICT ON UPDATE CASCADE; From f185c92db7628efda3df56dc85984ab66c4bb642 Mon Sep 17 00:00:00 2001 From: Cris Date: Tue, 19 Jan 2021 13:03:26 +0100 Subject: [PATCH 030/142] Created Anrechnungen Students GUI, Controller, DB-tables, library, phrases Signed-off-by: cris-technikum --- .../lehre/anrechnung/RequestAnrechnung.php | 302 ++++++++++++++++ application/libraries/AnrechnungLib.php | 179 ++++++++++ application/libraries/DmsLib.php | 96 +++++- .../models/education/Anrechnung_model.php | 36 ++ .../education/Anrechnungstatus_model.php | 15 + .../education/Lehrveranstaltung_model.php | 20 ++ application/models/person/Person_model.php | 2 +- .../lehre/anrechnung/requestAnrechnung.php | 200 +++++++++++ config/global.config-default.inc.php | 1 + include/tw/cis_menu_lv.inc.php | 15 +- locale/de-AT/lehre.php | 1 + locale/en-US/lehre.php | 2 + system/dbupdate_3.3.php | 174 +++++++++- system/phrasesupdate.php | 324 +++++++++++++++++- 14 files changed, 1361 insertions(+), 6 deletions(-) create mode 100644 application/controllers/lehre/anrechnung/RequestAnrechnung.php create mode 100644 application/libraries/AnrechnungLib.php create mode 100644 application/models/education/Anrechnungstatus_model.php create mode 100644 application/views/lehre/anrechnung/requestAnrechnung.php diff --git a/application/controllers/lehre/anrechnung/RequestAnrechnung.php b/application/controllers/lehre/anrechnung/RequestAnrechnung.php new file mode 100644 index 000000000..ed09b131a --- /dev/null +++ b/application/controllers/lehre/anrechnung/RequestAnrechnung.php @@ -0,0 +1,302 @@ + 'student/anrechnung_beantragen:rw', + 'apply' => 'student/anrechnung_beantragen:rw', + 'download' => 'student/anrechnung_beantragen:rw', + ) + ); + + // Load models + $this->load->model('education/Anrechnung_model', 'AnrechnungModel'); + $this->load->model('content/DmsVersion_model', 'DmsVersionModel'); + + // Load libraries + $this->load->library('WidgetLib'); + $this->load->library('PermissionLib'); + $this->load->library('AnrechnungLib'); + $this->load->library('DmsLib'); + + // Load helpers + $this->load->helper('form'); + $this->load->helper('url'); + $this->load->helper('hlp_sancho_helper'); + + // Load language phrases + $this->loadPhrases( + array( + 'global', + 'ui', + 'anrechnung', + 'person', + 'lehre' + ) + ); + + $this->_setAuthUID(); + + $this->setControllerId(); + } + + public function index() + { + $studiensemester_kurzbz = $this->input->get('studiensemester'); + $lehrveranstaltung_id = $this->input->get('lv_id'); + + if (!is_numeric($lehrveranstaltung_id) || !is_string($studiensemester_kurzbz)) + { + show_error('Missing correct parameter'); + } + + // Check if application deadline is expired + // $is_expired = $this->_checkAntragDeadline($studiensemester_kurzbz); + $is_expired = false; // Set to false until Deadline is defined + + // Get Anrechung data + $result = $this->anrechnunglib->getAnrechnungDataByLv($lehrveranstaltung_id); + if (!$anrechnungData = getData($result)) + { + show_error(getError($anrechnungData)); + } + + // Overwrite progress status for student view. If no Anrechnung exists yet, set to new. + $anrechnungData->status = empty($anrechnungData->status) + ? getUserLanguage() == 'German' ? 'neu' : 'new' + : $this->_getLastAnrechnungstatus($anrechnungData->anrechnung_id); + + $viewData = array( + 'antragData' => $this->anrechnunglib->getAntragData($this->_uid, $studiensemester_kurzbz, $lehrveranstaltung_id), + 'anrechnungData' => $anrechnungData, + 'is_expired' => $is_expired, + 'disabled' => $is_expired && empty($anrechnungData->anrechnung_id) || !empty($anrechnungData->anrechnung_id) + ? 'disabled' + : '' + ); + + $this->load->view('lehre/anrechnung/requestAnrechnung.php', $viewData); + } + + public function apply() + { + $anmerkung = $this->input->post('anmerkung'); + $begruendung_id = $this->input->post('begruendung'); + $lehrveranstaltung_id = $this->input->post('lv_id'); + $studiensemester_kurzbz = $this->input->post('studiensemester'); + + if (empty($_FILES['uploadfile']['name'])) + { + show_error('Missing upload file'); + } + + if (!is_numeric($begruendung_id) || !is_numeric($lehrveranstaltung_id) || !is_string($studiensemester_kurzbz)) + { + show_error('Missing correct parameter'); + } + + $result = $this->_getAnrechnung($lehrveranstaltung_id); + if (hasData($result)) + { + show_error('Der Antrag wurde bereits gestellt'); + } + + // Start DB transaction + $this->db->trans_start(false); + + // Upload document + $dms = array( + 'kategorie_kurzbz' => 'anrechnung', + 'version' => 0, + 'name' => $_FILES['uploadfile']['name'], + 'mimetype' => $_FILES['uploadfile']['type'], + 'insertamum' => (new DateTime())->format('Y-m-d H:i:s'), + 'insertvon' => $this->_uid + ); + + if(isError($uploaddata = $this->dmslib->upload($dms, array('jpg', 'pdf')))) + { + show_error(getError($uploaddata)); + } + + // Get PrestudentID + $result = $this->_loadPrestudent($this->_uid, $studiensemester_kurzbz); + + if (!$prestudent = getData($result)[0]) + { + show_error('Failed retrieving prestudent'); + } + + // Save Anrechnung with Status 'inProgressSTGL' + $result = $this->AnrechnungModel->insert(array( + 'prestudent_id' => $prestudent->prestudent_id, + 'lehrveranstaltung_id' => $lehrveranstaltung_id, + 'begruendung_id' => $begruendung_id, + 'dms_id' => $uploaddata->retval['dms_id'], + 'studiensemester_kurzbz' => $studiensemester_kurzbz, + 'anmerkung_student' => $anmerkung + )); + + if (isError($result)) + { + show_error('Failed inserting Anrechnung'); + } + + $result = $this->AnrechnungModel->saveAnrechnungstatus($result->retval, self::ANRECHNUNGSTATUS_PROGRESSED_BY_STGL); + + if (isError($result)) + { + show_error('Failed saving Anrechnungstatus'); + } + + // Transaction complete! + $this->db->trans_complete(); + + if ($this->db->trans_status() === false || isError($result)) + { + $this->db->trans_rollback(); + show_error($result->msg, EXIT_ERROR); + } + + // Send mail to STGL + $this->load->model('organisation/Studiengang_model', 'StudiengangModel'); + $studiengang = $this->StudiengangModel->load($prestudent->studiengang_kz); + + // Send mail + $this->load->library('MailLib'); + if(!$this->maillib->send( + "noreply@". DOMAIN, + $studiengang->retval[0]->email, + 'Neuer LV-Anrechnungsantrag', + 'Eine neuer LV Anrechnungsantrag steht zur Prüfung bereit.')) + { + show_error('Failed sending email to STGL'); + } + else + { + redirect(site_url(). self::REQUEST_ANRECHNUNG_URI. '?studiensemester='. $studiensemester_kurzbz. '&lv_id='. $lehrveranstaltung_id); + } + } + + /** + * Download and open uploaded document (Nachweisdokument). + */ + public function download() + { + $dms_id = $this->input->get('dms_id'); + + if (!is_numeric($dms_id)) + { + show_error('Wrong parameter'); + } + + $this->dmslib->download($dms_id); + } + + /** + * Retrieve the UID of the logged user and checks if it is valid + */ + private function _setAuthUID() + { + $this->_uid = getAuthUID(); + + if (!$this->_uid) show_error('User authentification failed'); + } + + /** + * Load Prestudent by uid and Studiensemester. + * @param $uid + * @param $studiensemester_kurzbz + * @return mixed + */ + private function _loadPrestudent($uid, $studiensemester_kurzbz) + { + $this->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel'); + $this->load->model('crm/Student_model', 'StudentModel'); + + $this->PrestudentstatusModel->addJoin('public.tbl_student', 'prestudent_id'); + return $this->PrestudentstatusModel->loadWhere(array( + 'student_uid' => $uid, + 'studiensemester_kurzbz' => $studiensemester_kurzbz + ) + ); + } + + /** + * Check if application deadline is expired. + * @param $studiensemester_kurzbz + * @return bool True if semester start is more then 1 week ago + * @throws Exception + */ + private function _checkAntragDeadline($studiensemester_kurzbz) + { + $this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel'); + $this->StudiensemesterModel->addSelect('start'); + if (!$start = getData($this->StudiensemesterModel->load($studiensemester_kurzbz))) + { + show_error(getError($start)); + } + + $start = new DateTime($start[0]->start); + $today = new DateTime('today midnight'); + + // True if today > application deadline + return ($today > $start->add((new DateInterval(self::DEADLINE_INTERVAL_NACH_SEMESTERSTART)))); + } + + /** + * Get Anrechnung by Lehrveranstaltung + * @param $lehrveranstaltung_id + * @return mixed + */ + private function _getAnrechnung($lehrveranstaltung_id) + { + $result = $this->AnrechnungModel->loadWhere(array( + 'lehrveranstaltung_id' => $lehrveranstaltung_id + )); + + if (isError($result)) + { + show_error(getError($result)); + } + + return $result; + } + + /** + * Get last Anrechnungstatus. Modify progress status for student view. + * @param $anrechnung_id + * @return string + */ + private function _getLastAnrechnungstatus($anrechnung_id) + { + $result = $this->AnrechnungModel->getLastAnrechnungstatus($anrechnung_id); + $status_kurzbz = getData($result)[0]->status_kurzbz; + + // Dont show who is progressing the application + if ($status_kurzbz == 'inProgressDP' || $status_kurzbz == 'inProgressKF') + { + return getUserLanguage() == 'German' ? 'in Bearbeitung' : 'in process'; + } + else + { + $status_mehrsprachig = getData($result)[0]->bezeichnung_mehrsprachig; + return getUserLanguage() == 'German' ? $status_mehrsprachig[0] : $status_mehrsprachig[1]; + } + } +} \ No newline at end of file diff --git a/application/libraries/AnrechnungLib.php b/application/libraries/AnrechnungLib.php new file mode 100644 index 000000000..4a8f0f962 --- /dev/null +++ b/application/libraries/AnrechnungLib.php @@ -0,0 +1,179 @@ +ci =& get_instance(); + + $this->ci->load->model('education/Anrechnung_model', 'AnrechnungModel'); + $this->ci->load->model('person/Person_model', 'PersonModel'); + $this->ci->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel'); + $this->ci->load->model('organisation/Studiengang_model', 'StudiengangModel'); + $this->ci->load->model('content/DmsVersion_model', 'DmsVersionModel'); + } + + /** + * Get Antrag data + * @param $uid + * @param $studiensemester_kurzbz + * @param $lv_id + * @return StdClass + */ + public function getAntragData($uid, $studiensemester_kurzbz, $lv_id) + { + $antrag_data = new StdClass(); + + // Get lehrveranstaltung data. Break, if course is not assigned to student. + if(!$lv = getData($this->ci->LehrveranstaltungModel->getLvByStudent($uid, $studiensemester_kurzbz, $lv_id))[0]) + { + show_error('You are not assigned to this course yet.'); + } + + // Get the students personal data + if (!$person = getData($this->ci->PersonModel->getByUid($uid))[0]) + { + show_error('Failed loading person data.'); + } + + // Get studiengang bezeichnung + if (!$studiengang = getData($this->ci->StudiengangModel->load($lv->studiengang_kz))[0]) + { + show_error('Failed loading studiengang data.'); + } + + // Get lectors of lehrveranstaltung + $antrag_data->lektoren = array(); + if (!$lv_lektoren = getData($this->ci->LehrveranstaltungModel->getLecturersByLv($studiensemester_kurzbz, $lv_id))) + { + show_error('Failed loading course lectors.'); + } + + // Set the given studiensemester + $antrag_data->lv_id = $lv_id; + $antrag_data->lv_bezeichnung = $lv->bezeichnung; + $antrag_data->ects = $lv->ects; + $antrag_data->studiensemester_kurzbz = $studiensemester_kurzbz; + $antrag_data->vorname = $person->vorname; + $antrag_data->nachname = $person->nachname; +// $antrag_data->bpk = $person->bpk; + $antrag_data->bpk = $person->matr_nr; + $antrag_data->stg_bezeichnung = $studiengang->bezeichnung; + $antrag_data->lektoren = $lv_lektoren; + + return $antrag_data; + } + + /** + * Get Anrechnung data, last status and Nachweisdokument dms data. + * @param $anrechnung_id + * @return array + * @throws Exception + */ + public function getAnrechnungData($anrechnung_id) + { + if (!is_numeric($anrechnung_id)) + { + show_error('Incorrect parameter'); + } + + $anrechnung_data = new StdClass(); + + $result = $this->ci->AnrechnungModel->load($anrechnung_id); + + if (isError($result)) + { + show_error(getError($result)); + } + + if ($anrechnung = getData($result)[0]) + { + $anrechnung_data = $this->_setAnrechnungDataObject($anrechnung); + } + + return success($anrechnung_data); + + } + + /** + * Get Anrechnung data by Lehrveranstaltung. Also retrieves last status and Nachweisdokument dms data. + * @param $lehrveranstaltung_id + * @return array + * @throws Exception + */ + public function getAnrechnungDataByLv($lehrveranstaltung_id) + { + $anrechnung_data = new StdClass(); + $anrechnung_data->anrechnung_id = ''; + $anrechnung_data->begruendung_id = ''; + $anrechnung_data->anmerkung = ''; + $anrechnung_data->dms_id = ''; + $anrechnung_data->insertamum = ''; + $anrechnung_data->insertvon = ''; + $anrechnung_data->studiensemester_kurzbz = ''; + $anrechnung_data->empfehlung = ''; + $anrechnung_data->status = ''; + $anrechnung_data->dokumentname = ''; + + $result = $this->ci->AnrechnungModel->loadWhere(array('lehrveranstaltung_id' => $lehrveranstaltung_id)); + + if (isError($result)) + { + show_error(getError($result)); + } + + if ($anrechnung = getData($result)[0]) + { + $anrechnung_data = $this->_setAnrechnungDataObject($anrechnung); + } + + return success($anrechnung_data); + } + + /** + * @param $anrechnung_id + * @return mixed + */ + public function getLastAnrechnungstatus($anrechnung_id) + { + $result = $this->ci->AnrechnungModel->getLastAnrechnungstatus($anrechnung_id); + + $status_mehrsprachig = getData($result)[0]->bezeichnung_mehrsprachig; + $status = getUserLanguage() == 'German' ? $status_mehrsprachig[0] : $status_mehrsprachig[1]; + + return $status; + } + + private function _setAnrechnungDataObject($anrechnung) + { + $anrechnung_data = new StdClass(); + + // Get Anrechnung data + $anrechnung_data->anrechnung_id = $anrechnung->anrechnung_id; + $anrechnung_data->begruendung_id = $anrechnung->begruendung_id; + $anrechnung_data->anmerkung = $anrechnung->anmerkung_student; + $anrechnung_data->dms_id = $anrechnung->dms_id; + $anrechnung_data->insertamum = (new DateTime($anrechnung->insertamum))->format('d.m.Y'); + $anrechnung_data->insertvon= $anrechnung->insertvon; + $anrechnung_data->studiensemester_kurzbz= $anrechnung->studiensemester_kurzbz; + $anrechnung_data->empfehlung= $anrechnung->empfehlung_anrechnung; + + // Get last status bezeichnung in the users language + $anrechnung_data->status = $this->getLastAnrechnungstatus($anrechnung->anrechnung_id); + + // Get document name + $this->ci->DmsVersionModel->addSelect('name'); + $result = $this->ci->DmsVersionModel->loadWhere(array('dms_id' => $anrechnung->dms_id)); + + if (isError($result)) + { + show_error(getError($result)); + } + + $anrechnung_data->dokumentname = $result->retval[0]->name; + + return $anrechnung_data; + } +} \ No newline at end of file diff --git a/application/libraries/DmsLib.php b/application/libraries/DmsLib.php index f32df5fd1..64d58f987 100644 --- a/application/libraries/DmsLib.php +++ b/application/libraries/DmsLib.php @@ -5,7 +5,10 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); class DmsLib { const FILE_CONTENT_PROPERTY = 'file_content'; - + + const FILE_INPUT_NAME = 'uploadfile'; // name of the HTML input tag containing the uploaded file + private $UPLOAD_PATH = DMS_PATH; // temporary directory to store the upload file + /** * Object initialization */ @@ -92,6 +95,84 @@ class DmsLib return $result; } + + /** + * Uploads a document and saves it to DMS + * @param $dms DMS assoc array + * @param array $allowed_types Default: all. Param example: array(jpg, pdf) + * @return array + */ + public function upload($dms, $allowed_types = array('*')) + { + // Init upload configs + $this->_loadUploadLibrary($allowed_types); + + if (!$this->ci->upload->do_upload(DmsLib::FILE_INPUT_NAME)) + { + return error($this->ci->upload->display_errors()); + } + + $upload_data = $this->ci->upload->data(); // data about the uploaded file + $filename = $upload_data['file_name']; + + // Insert to DMS table + if (!$result = $this->ci->DmsModel->insert($this->ci->DmsModel->filterFields($dms))) + { + return error('Failed inserting to DMS'); + } + $upload_data['dms_id'] = $result->retval; + + // Insert DMS version + if (!$result = $this->ci->DmsVersionModel->insert( + $this->ci->DmsVersionModel->filterFields($dms, $result->retval, $filename))) + { + return error('Failed inserting DMS version'); + } + + // return result of uploaded data + return success($upload_data); // data about the uploaded file + } + + /** + * Download a document + * @param $dms_id + */ + public function download($dms_id) + { + if (!is_numeric($dms_id)) + { + show_error('Wrong parameter'); + } + + $this->ci->DmsVersionModel->addSelect('filename'); + $result = $this->ci->DmsVersionModel->loadWhere(array('dms_id' => $dms_id)); + + if (isError($result)) + { + show_error(getError($result)); + } + + $filename = $result->retval[0]->filename; + $file = DMS_PATH. $filename; + + if (file_exists($file)) + { + $finfo = new finfo(FILEINFO_MIME); + + header('Content-Description: File Transfer'); + header('Content-Type: '.$finfo->file($file)); + header('Expires: 0'); + header('Cache-Control: must-revalidate'); + header('Pragma: public'); + header('Content-Length: ' . filesize($file)); + readfile($file); + exit; + } + else + { + show_error('File does not exist'); + } + } /** * Saves a Document @@ -302,4 +383,17 @@ class DmsLib return $result; } + + /** + * Loads the upload library of CI + */ + private function _loadUploadLibrary($allowed_types) + { + $config['upload_path'] = $this->UPLOAD_PATH; + $config['allowed_types'] = implode('|', $allowed_types); + $config['overwrite'] = true; + + $this->ci->load->library('upload', $config); + $this->ci->upload->initialize($config); + } } diff --git a/application/models/education/Anrechnung_model.php b/application/models/education/Anrechnung_model.php index f16310fe4..56d3f3062 100644 --- a/application/models/education/Anrechnung_model.php +++ b/application/models/education/Anrechnung_model.php @@ -11,4 +11,40 @@ class Anrechnung_model extends DB_Model $this->dbTable = 'lehre.tbl_anrechnung'; $this->pk = 'anrechnung_id'; } + + /** + * Save Anrechnungstatus. + * @param $anrechnung_id + * @param $status_kurzbz + * @return array|null + */ + public function saveAnrechnungstatus($anrechnung_id, $status_kurzbz) + { + $qry = ' + INSERT INTO lehre.tbl_anrechnung_anrechnungstatus ( + anrechnung_id, status_kurzbz, insertvon + ) VALUES ( ?, ?, ?); + '; + + return $this->execQuery($qry, array($anrechnung_id, $status_kurzbz, getAuthUID())); + } + + /** + * Get the last inserted Anrechnungstatus + * @param $anrechnung_id + * @return array|null + */ + public function getLastAnrechnungstatus($anrechnung_id) + { + $qry = ' + SELECT status_kurzbz, bezeichnung_mehrsprachig + FROM lehre.tbl_anrechnungstatus + JOIN lehre.tbl_anrechnung_anrechnungstatus USING (status_kurzbz) + WHERE anrechnung_id = ? + ORDER BY insertamum DESC + LIMIT 1 + '; + + return $this->execQuery($qry, array($anrechnung_id)); + } } diff --git a/application/models/education/Anrechnungstatus_model.php b/application/models/education/Anrechnungstatus_model.php new file mode 100644 index 000000000..6ae5ffd22 --- /dev/null +++ b/application/models/education/Anrechnungstatus_model.php @@ -0,0 +1,15 @@ +dbTable = 'lehre.tbl_anrechnungstatus'; + $this->pk = 'status_kurzbz'; + } +} diff --git a/application/models/education/Lehrveranstaltung_model.php b/application/models/education/Lehrveranstaltung_model.php index d80d02b41..ef5373f5f 100644 --- a/application/models/education/Lehrveranstaltung_model.php +++ b/application/models/education/Lehrveranstaltung_model.php @@ -273,4 +273,24 @@ class Lehrveranstaltung_model extends DB_Model return $this->execQuery($query, $parametersarray); } + + /** + * Gets Lehrveranstaltung and its Lehreinheiten (multiple rows possible). + * Returns empty array if student has no Lehrveranstaltung. + * @param $uid + * @param $studiensemester_kurzbz + * @param $lehrveranstaltung_id + * @return array|null + */ + public function getLvByStudent($uid, $studiensemester_kurzbz, $lehrveranstaltung_id) + { + $query = ' + SELECT * FROM campus.vw_student_lehrveranstaltung + WHERE uid = ? + AND studiensemester_kurzbz = ? + AND lehrveranstaltung_id = ?; + '; + + return $this->execQuery($query, array($uid, $studiensemester_kurzbz, $lehrveranstaltung_id)); + } } diff --git a/application/models/person/Person_model.php b/application/models/person/Person_model.php index d8ddb381c..128af7860 100644 --- a/application/models/person/Person_model.php +++ b/application/models/person/Person_model.php @@ -191,7 +191,7 @@ class Person_model extends DB_Model */ public function getByUid($uid) { - $this->addSelect('vorname, nachname, gebdatum, person_id'); + $this->addSelect('vorname, nachname, gebdatum, person_id, bpk, matr_nr'); $this->addJoin('tbl_benutzer', 'person_id'); return $this->loadWhere(array('uid' => $uid)); diff --git a/application/views/lehre/anrechnung/requestAnrechnung.php b/application/views/lehre/anrechnung/requestAnrechnung.php new file mode 100644 index 000000000..7e37e9e52 --- /dev/null +++ b/application/views/lehre/anrechnung/requestAnrechnung.php @@ -0,0 +1,200 @@ +load->view( + 'templates/FHC-Header', + array( + 'title' => $this->p->t('anrechnung', 'antragStellen'), + 'jquery' => true, + 'bootstrap' => true, + 'fontawesome' => true, + 'ajaxlib' => true, + 'dialoglib' => true, + 'phrases' => array( + 'global' => array( + 'anerkennungNachgewiesenerKenntnisse', + 'antragStellen' + ), + 'ui' => array( + 'hilfeZuDieserSeite', + 'hochladen' + ), + 'person' => array( + 'student', + 'personenkennzeichen' + ), + 'lehre' => array( + 'studiensemester', + 'studiengang', + 'lehrveranstaltung', + 'ects', + 'lektor', + ) + ), + 'customJSs' => array( + 'public/js/bootstrapper.js' + ) + ) +); +?> + + +
    +
    + +
    + +
    + + 'requestAnrechnung-form'], + ['lv_id' => $antragData->lv_id, 'studiensemester' => $antragData->studiensemester_kurzbz] + ); ?> +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + p->t('anrechnung', 'antrag'); ?> + p->t('anrechnung', 'antragdatum'); ?>: anrechnung_id) ? $anrechnungData->insertamum : '-' ?> +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    p->t('person', 'student'); ?>vorname. ' '. $antragData->nachname; ?>
    p->t('person', 'personenkennzeichen'); ?>bpk ?>
    p->t('lehre', 'studiensemester'); ?>studiensemester_kurzbz ?>
    p->t('lehre', 'studiengang'); ?>stg_bezeichnung ?>
    p->t('lehre', 'lehrveranstaltung'); ?>lv_bezeichnung ?>
    p->t('lehre', 'ects'); ?>ects ?>
    p->t('lehre', 'lektor'); ?> + lektoren) - 1 ?> + lektoren as $key => $lektor): ?> + vorname. ' '. $lektor->nachname; + echo $key === $len ? '' : ', ' ?> + +
    +
    +
    +
    + +
    +
    +
    +

    p->t('anrechnung', 'antragStellenText'); ?>

    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    +
    +
    + p->t('anrechnung', 'nachweisdokumente'); ?> +
    +
    +
    + > +
    + dms_id)): ?> + dokumentname ?> + +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    + p->t('anrechnung', 'weitereInformationen'); ?> +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + Status: status; ?> +
    + +
    + p->t('global', 'bearbeitungGesperrt'); ?> + anrechnung_id)? ': '. $this->p->t('anrechnung', 'deadlineUeberschritten') : ''; ?> +
    + +
    + + +
    +
    + > +
    +
    + + + + + +load->view('templates/FHC-Footer'); ?> diff --git a/config/global.config-default.inc.php b/config/global.config-default.inc.php index 496eb73cb..b31447994 100644 --- a/config/global.config-default.inc.php +++ b/config/global.config-default.inc.php @@ -26,6 +26,7 @@ define('CIS_LEHRVERANSTALTUNG_LEISTUNGSUEBERSICHT_ANZEIGEN',true); define('CIS_LEHRVERANSTALTUNG_SEMESTERINFO_ANZEIGEN',true); define('CIS_LEHRVERANSTALTUNG_LEHRFACH_ANZEIGEN',false); define('CIS_LEHRVERANSTALTUNG_GESAMTNOTE_ANZEIGEN', true); +define('CIS_LEHRVERANSTALTUNG_ANRECHNUNG_ANZEIGEN', true); // Im CIS Menue Links bei Modulen anzeigen wenn Lehrauftrag define('CIS_LEHRVERANSTALTUNG_MODULE_LINK',true); diff --git a/include/tw/cis_menu_lv.inc.php b/include/tw/cis_menu_lv.inc.php index b8c42da11..173b8d88c 100644 --- a/include/tw/cis_menu_lv.inc.php +++ b/include/tw/cis_menu_lv.inc.php @@ -421,7 +421,6 @@ function checkZeilenUmbruch() 'link'=>'../../../cms/news.php?studiengang_kz='.urlencode($studiengang_kz).'&semester='.urlencode($semester), 'text'=>$text ); - } if(!defined('CIS_LEHRVERANSTALTUNG_ABMELDUNG_ANZEIGEN') || CIS_LEHRVERANSTALTUNG_ABMELDUNG_ANZEIGEN) @@ -466,6 +465,20 @@ function checkZeilenUmbruch() } } + // Anerkennung nachgewiesener Kenntnisse (Anrechnung) + if((!defined('CIS_LEHRVERANSTALTUNG_ANRECHNUNG_ANZEIGEN') || CIS_LEHRVERANSTALTUNG_ANRECHNUNG_ANZEIGEN) + && $rechte->isBerechtigt('student/anrechnung_beantragen')) + { + $menu[]=array + ( + 'id'=>'core_menu_anerkennungNachgewiesenerKenntnisse', + 'position'=>'128', + 'name'=>$p->t('lehre/anerkennungNachgewiesenerKenntnisse'), + 'icon'=>'../../../skin/images/button_kreuzerltool.png', + 'link' => APP_ROOT. 'index.ci.php/lehre/anrechnung/RequestAnrechnung?studiensemester='.urlencode($angezeigtes_stsem).'&lv_id='.urlencode($lvid) + ); + } + //************* Menuepunkte anzeigen **************** diff --git a/locale/de-AT/lehre.php b/locale/de-AT/lehre.php index 46633c747..3262020d8 100644 --- a/locale/de-AT/lehre.php +++ b/locale/de-AT/lehre.php @@ -40,4 +40,5 @@ $this->phrasen['lehre/nichtzugeteilt']='Sie sind nicht zu dieser Lehrveranstaltu $this->phrasen['lehre/studienordnung']='Studienordnung'; $this->phrasen['lehre/studienplan']='Studienplan'; $this->phrasen['lehre/noteneingabedeaktiviert']='Noteneingabe deaktiviert'; +$this->phrasen['lehre/anerkennungNachgewiesenerKenntnisse']='Anerkennung nachgewiesener Kenntnisse'; ?> diff --git a/locale/en-US/lehre.php b/locale/en-US/lehre.php index 3fd6e5cd0..df990b6a1 100644 --- a/locale/en-US/lehre.php +++ b/locale/en-US/lehre.php @@ -40,4 +40,6 @@ $this->phrasen['lehre/nichtzugeteilt']='Sie sind nicht zu dieser Lehrveranstaltu $this->phrasen['lehre/studienordnung']='Studienordnung'; $this->phrasen['lehre/studienplan']='Studienplan'; $this->phrasen['lehre/noteneingabedeaktiviert']='Grading disabled'; +$this->phrasen['lehre/anerkennungNachgewiesenerKenntnisse']='Crediting for proven knowledge'; + ?> diff --git a/system/dbupdate_3.3.php b/system/dbupdate_3.3.php index 2336ebad4..0e172f9f0 100644 --- a/system/dbupdate_3.3.php +++ b/system/dbupdate_3.3.php @@ -4465,6 +4465,176 @@ if($result = $db->db_query("SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE } } +// Add column dms_id, studiensemester_kurzbz, anmerkung_student und empfehlung_anrechnung +// Change genehmigt_von and begruendung_id to be NULLABLE +if(!$result = @$db->db_query("SELECT dms_id FROM lehre.tbl_anrechnung")) +{ + $qry = " + ALTER TABLE lehre.tbl_anrechnung ADD COLUMN dms_id bigint; + ALTER TABLE lehre.tbl_anrechnung ADD COLUMN studiensemester_kurzbz varchar(6); + ALTER TABLE lehre.tbl_anrechnung ADD COLUMN anmerkung_student text; + ALTER TABLE lehre.tbl_anrechnung ADD COLUMN empfehlung_anrechnung boolean; + + ALTER TABLE lehre.tbl_anrechnung ADD CONSTRAINT fk_anrechnung_studiensemester FOREIGN KEY (studiensemester_kurzbz) REFERENCES public.tbl_studiensemester(studiensemester_kurzbz) ON DELETE RESTRICT ON UPDATE CASCADE; + ALTER TABLE lehre.tbl_anrechnung ADD CONSTRAINT fk_anrechnung_dms FOREIGN KEY (dms_id) REFERENCES campus.tbl_dms(dms_id) ON DELETE RESTRICT ON UPDATE CASCADE; + + ALTER TABLE lehre.tbl_anrechnung ALTER COLUMN genehmigt_von DROP NOT NULL; + ALTER TABLE lehre.tbl_anrechnung ALTER COLUMN begruendung_id DROP NOT NULL; + ALTER TABLE lehre.tbl_anrechnung ALTER COLUMN insertamum SET DEFAULT NOW(); + "; + + + if(!$db->db_query($qry)) + echo 'lehre.tbl_anrechnung: '.$db->db_last_error().'
    '; + else + echo '
    lehre.tbl_anrechnung: Neue Spalten dms_id, studiensemester_kurzbz, anmerkung_student und empfehlung_anrechnung hinzugefuegt. Not null constraint entfernt für genehmigt_von und begruendung_id'; +} + +// Add DMS category "anrechnung" +if ($result = @$db->db_query("SELECT 1 FROM campus.tbl_dms_kategorie WHERE kategorie_kurzbz = 'anrechnung';")) +{ + if ($db->db_num_rows($result) == 0) + { + $qry = "INSERT INTO campus.tbl_dms_kategorie ( + kategorie_kurzbz, + bezeichnung, + beschreibung, + parent_kategorie_kurzbz, + oe_kurzbz, + berechtigung_kurzbz + ) VALUES( + 'anrechnung', + 'Anrechnung', + 'Dokumente zur Anrechnung von Lehrveranstaltungen', + 'studium', + 'etw', + NULL + );"; + if (!$db->db_query($qry)) + echo 'campus.tbl_dms_kategorie '.$db->db_last_error().'
    '; + else + echo ' campus.tbl_dms_kategorie: Added category "anrechnung"!
    '; + } +} + + +// Add DMS category permissiongroup for DMS category "anrechnung" +if ($result = @$db->db_query("SELECT 1 FROM campus.tbl_dms_kategorie_gruppe WHERE kategorie_kurzbz = 'anrechnung';")) +{ + if ($db->db_num_rows($result) == 0) + { + $qry = "INSERT INTO campus.tbl_dms_kategorie_gruppe ( + kategorie_kurzbz, + gruppe_kurzbz, + insertamum, + insertvon + ) VALUES( + 'anrechnung', + 'CMS_LOCK', + NOW(), + 'dbcheck' + );"; + if (!$db->db_query($qry)) + echo 'campus.tbl_dms_kategorie_gruppe '.$db->db_last_error().'
    '; + else + echo ' campus.tbl_dms_kategorie_gruppe: Added category group "CMS_LOCK" to category "anrechnung"!
    '; + } +} + +// Add table anrechnung_status +if(!$result = @$db->db_query("SELECT 1 FROM lehre.tbl_anrechnungstatus LIMIT 1;")) +{ + $qry = " + CREATE TABLE lehre.tbl_anrechnungstatus + ( + status_kurzbz varchar(32) NOT NULL, + bezeichnung_mehrsprachig varchar(64)[] + ); + + ALTER TABLE lehre.tbl_anrechnungstatus ADD CONSTRAINT pk_anrechnungstatus PRIMARY KEY (status_kurzbz); + + INSERT INTO lehre.tbl_anrechnungstatus(status_kurzbz, bezeichnung_mehrsprachig) VALUES('inProgressDP', '{\'bearbeitet von STG-Leitung\',\'processed by STG-Director\'}'); + INSERT INTO lehre.tbl_anrechnungstatus(status_kurzbz, bezeichnung_mehrsprachig) VALUES('inProgressKF', '{\'bearbeitet von KF-Leitung\',\'processed by KF-Manager\'}'); + INSERT INTO lehre.tbl_anrechnungstatus(status_kurzbz, bezeichnung_mehrsprachig) VALUES('approved', '{\'genehmigt\',\'approved\'}'); + INSERT INTO lehre.tbl_anrechnungstatus(status_kurzbz, bezeichnung_mehrsprachig) VALUES('rejected', '{\'abgelehnt\',\'rejected\'}'); + + GRANT SELECT ON lehre.tbl_anrechnungstatus TO web; + GRANT SELECT, UPDATE, INSERT, DELETE ON lehre.tbl_anrechnungstatus TO vilesci; + "; + + if(!$db->db_query($qry)) + echo 'lehre.tbl_anrechnungstatus: '.$db->db_last_error().'
    '; + else + echo ' lehre.tbl_anrechnungstatus: Tabelle hinzugefuegt
    '; +} + +// Add table anrechnung_anrechnungstatus +// Für bestehende genehmigte Anrechnungsanträge wird ein Eintrag mit dem Status 'approved' angelegt +if(!$result = @$db->db_query("SELECT 1 FROM lehre.tbl_anrechnung_anrechnungstatus LIMIT 1;")) +{ + $qry = " + CREATE TABLE lehre.tbl_anrechnung_anrechnungstatus + ( + anrechnungstatus_id integer NOT NULL, + anrechnung_id integer, + status_kurzbz varchar(32), + datum date default now(), + insertamum timestamp default now(), + insertvon varchar(32) + ); + + ALTER TABLE lehre.tbl_anrechnung_anrechnungstatus ADD CONSTRAINT pk_anrechnung_anrechnungstatus PRIMARY KEY (anrechnungstatus_id); + ALTER TABLE lehre.tbl_anrechnung_anrechnungstatus ADD CONSTRAINT fk_anrechnung_anrechnungstatus_anrechnung FOREIGN KEY (anrechnung_id) REFERENCES lehre.tbl_anrechnung(anrechnung_id) ON DELETE RESTRICT ON UPDATE CASCADE; + ALTER TABLE lehre.tbl_anrechnung_anrechnungstatus ADD CONSTRAINT fk_anrechnung_anrechnungstatus_anrechnungstatus FOREIGN KEY (status_kurzbz) REFERENCES lehre.tbl_anrechnungstatus (status_kurzbz) ON DELETE RESTRICT ON UPDATE CASCADE; + + CREATE SEQUENCE lehre.seq_anrechnung_anrechnungstatus_anrechnungstatus_id + START WITH 1 + INCREMENT BY 1 + NO MAXVALUE + NO MINVALUE + CACHE 1; + ALTER TABLE lehre.tbl_anrechnung_anrechnungstatus ALTER COLUMN anrechnungstatus_id SET DEFAULT nextval('lehre.seq_anrechnung_anrechnungstatus_anrechnungstatus_id'); + + INSERT INTO lehre.tbl_anrechnung_anrechnungstatus(anrechnung_id, status_kurzbz) SELECT anrechnung_id, 'approved' as status_kurzbz FROM lehre.tbl_anrechnung WHERE genehmigt_von is not null; + + GRANT SELECT ON lehre.tbl_anrechnung_anrechnungstatus TO web; + GRANT SELECT, UPDATE, INSERT, DELETE ON lehre.tbl_anrechnung_anrechnungstatus TO vilesci; + GRANT SELECT, UPDATE ON lehre.seq_anrechnung_anrechnungstatus_anrechnungstatus_id TO vilesci; + "; + + if(!$db->db_query($qry)) + echo 'lehre.tbl_anrechnung_anrechnungstatus: '.$db->db_last_error().'
    '; + else + echo ' lehre.tbl_anrechnung_anrechnungstatus: Tabelle hinzugefuegt
    '; +} + +// Added Bezeichnung 'berufliche Praxis' to Anrechnungbegruendung +if ($result = @$db->db_query("SELECT 1 FROM lehre.tbl_anrechnung_begruendung WHERE bezeichnung = 'berufliche Praxis';")) +{ + if ($db->db_num_rows($result) == 0) + { + $qry = "INSERT INTO lehre.tbl_anrechnung_begruendung (bezeichnung) VALUES('berufliche Praxis');"; + if (!$db->db_query($qry)) + echo 'lehre.tbl_anrechnung_begruendung '.$db->db_last_error().'
    '; + else + echo ' lehre.tbl_anrechnung_begruendung: Added bezeichnung "berufliche Praxis"
    '; + } +} + +// Add permission to apply for Anrechnung +if($result = @$db->db_query("SELECT 1 FROM system.tbl_berechtigung WHERE berechtigung_kurzbz = 'student/anrechnung_beantragen';")) +{ + if($db->db_num_rows($result) == 0) + { + $qry = "INSERT INTO system.tbl_berechtigung(berechtigung_kurzbz, beschreibung) VALUES('student/anrechnung_beantragen', 'Anrechnung beantragen');"; + + if(!$db->db_query($qry)) + echo 'system.tbl_berechtigung '.$db->db_last_error().'
    '; + else + echo ' system.tbl_berechtigung: Added permission for student/anrechnung_beantragen
    '; + } +} + // *** Pruefung und hinzufuegen der neuen Attribute und Tabellen echo '

    Pruefe Tabellen und Attribute!

    '; @@ -4571,8 +4741,10 @@ $tabellen=array( "lehre.tbl_abschlusspruefung" => array("abschlusspruefung_id","student_uid","vorsitz","pruefer1","pruefer2","pruefer3","abschlussbeurteilung_kurzbz","akadgrad_id","pruefungstyp_kurzbz","datum","uhrzeit","sponsion","anmerkung","updateamum","updatevon","insertamum","insertvon","ext_id","note","protokoll","endezeit","pruefungsantritt_kurzbz","freigabedatum"), "lehre.tbl_abschlusspruefung_antritt" => array("pruefungsantritt_kurzbz","bezeichnung","bezeichnung_english","sort"), "lehre.tbl_akadgrad" => array("akadgrad_id","akadgrad_kurzbz","studiengang_kz","titel","geschlecht"), - "lehre.tbl_anrechnung" => array("anrechnung_id","prestudent_id","lehrveranstaltung_id","begruendung_id","lehrveranstaltung_id_kompatibel","genehmigt_von","insertamum","insertvon","updateamum","updatevon","ext_id"), + "lehre.tbl_anrechnung" => array("anrechnung_id","prestudent_id","lehrveranstaltung_id","begruendung_id","lehrveranstaltung_id_kompatibel","genehmigt_von","insertamum","insertvon","updateamum","updatevon","ext_id", "dms_id", "studiensemester_kurzbz", "anmerkung_student", "empfehlung_anrechnung"), + "lehre.tbl_anrechnung_anrechnungstatus" => array("anrechnungstatus_id", "anrechnung_id","status_kurzbz","datum", "insertamum","insertvon"), "lehre.tbl_anrechnung_begruendung" => array("begruendung_id","bezeichnung"), + "lehre.tbl_anrechnungstatus" => array("status_kurzbz","bezeichnung_mehrsprachig"), "lehre.tbl_betreuerart" => array("betreuerart_kurzbz","beschreibung","aktiv"), "lehre.tbl_ferien" => array("bezeichnung","studiengang_kz","vondatum","bisdatum"), "lehre.tbl_lehreinheit" => array("lehreinheit_id","lehrveranstaltung_id","studiensemester_kurzbz","lehrfach_id","lehrform_kurzbz","stundenblockung","wochenrythmus","start_kw","raumtyp","raumtypalternativ","sprache","lehre","anmerkung","unr","lvnr","updateamum","updatevon","insertamum","insertvon","ext_id","lehrfach_id_old","gewicht"), diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 727a389e4..d6cec5a1e 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -48,6 +48,26 @@ $phrases = array( ) ) ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'bearbeitungGesperrt', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Bearbeitung gesperrt', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Locked for editing', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), array( 'app' => 'core', 'category' => 'global', @@ -1549,7 +1569,7 @@ $phrases = array( 'phrases' => array( array( 'sprache' => 'German', - 'text' => 'Student', + 'text' => 'StudentIn', 'description' => '', 'insertvon' => 'system' ), @@ -2471,7 +2491,7 @@ $phrases = array( 'phrases' => array( array( 'sprache' => 'German', - 'text' => 'Lektor', + 'text' => 'LektorIn', 'description' => '', 'insertvon' => 'system' ), @@ -7988,6 +8008,306 @@ Any unusual occurrences 'insertvon' => 'system' ) ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'anerkennungNachgewiesenerKenntnisse', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Anerkennung nachgewiesener Kenntnisse', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Crediting for proven knowledge', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'anrechnungBeantragen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Anrechnung beantragen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Apply', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'antragStellen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Antrag stellen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Submit an application', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'antragsdaten', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Antragsdaten', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Application data', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'nachweisdokumente', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Nachweisdokumente', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Verification documents', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'person', + 'phrase' => 'personenkennzeichen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Personenkennzeichen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Personal identity number', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'hochladen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Hochladen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Upload', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'antragStellenText', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Ich beantrage die Feststellung der Gleichwertigkeit aufgrund', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'antragStellenWegenZeugnis', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'eines Zeugnisses (vgl. § 4 Abs. 4, Satzungsteil 5 der FHTW)', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'antragStellenWegenPraxis', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'der nachgewiesenen beruflichen Praxis (vgl. § 4 Abs. 5, Satzungsteil 5 der FHTW)', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'weitereInformationen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Weitere Informationen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Further information', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'antrag', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Antrag', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Application', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'anrechnungIst', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Antrag ist', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Application is', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'deadlineUeberschritten', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Deadline ist überschritten', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Deadline is exceeded', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'antragdatum', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Antragsdatum', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Application date', + 'description' => '', + 'insertvon' => 'system' + ) + ) ) ); From b5dd85f2a684ab30091630e7c3e84b1a920a0f74 Mon Sep 17 00:00:00 2001 From: Cris Date: Tue, 19 Jan 2021 13:24:16 +0100 Subject: [PATCH 031/142] Created Anrechnungen STGL: GUI, Controller, Tabledata, Phrases Signed-off-by: cris-technikum --- .../ApproveAnrechnungUebersicht.php | 98 +++++++++++ .../approveAnrechnungUebersicht.php | 128 ++++++++++++++ .../approveAnrechnungUebersichtData.php | 106 ++++++++++++ public/css/Tabulator.css | 30 ++++ .../anrechnung/approveAnrechnungUebersicht.js | 38 ++++ system/phrasesupdate.php | 162 +++++++++++++++++- 6 files changed, 561 insertions(+), 1 deletion(-) create mode 100644 application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php create mode 100644 application/views/lehre/anrechnung/approveAnrechnungUebersicht.php create mode 100644 application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php create mode 100644 public/js/lehre/anrechnung/approveAnrechnungUebersicht.js diff --git a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php new file mode 100644 index 000000000..c9dd9a0d4 --- /dev/null +++ b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php @@ -0,0 +1,98 @@ + 'admin:rw', + 'download' => 'admin:rw' + ) + ); + + // Load models + $this->load->model('education/Anrechnung_model', 'AnrechnungModel'); + $this->load->model('content/DmsVersion_model', 'DmsVersionModel'); + + // Load libraries + $this->load->library('WidgetLib'); + $this->load->library('PermissionLib'); + $this->load->library('AnrechnungLib'); + $this->load->library('DmsLib'); + + // Load helpers + $this->load->helper('form'); + $this->load->helper('url'); + $this->load->helper('hlp_sancho_helper'); + + // Load language phrases + $this->loadPhrases( + array( + 'global', + 'ui', + 'anrechnung', + 'person', + 'lehre', + 'table' + ) + ); + + $this->_setAuthUID(); + + $this->setControllerId(); + } + + public function index() + { + $studiensemester_kurzbz = $this->input->get('studiensemester'); + + if (!is_string($studiensemester_kurzbz)) + { + $studiensemester = $this->StudiensemesterModel->getNearest(); // TODO check + if (hasData($studiensemester)) + { + $studiensemester_kurzbz = $studiensemester->retval[0]->studiensemester_kurzbz; + } + elseif (isError($studiensemester)) + { + show_error(getError($studiensemester)); + } + } + + $viewData = array( + 'studiensemester_selected' => $studiensemester_kurzbz + ); + + $this->load->view('lehre/anrechnung/approveAnrechnungUebersicht.php', $viewData); + } + + /** + * Download and open uploaded document (Nachweisdokument). + */ + public function download() + { + $dms_id = $this->input->get('dms_id'); + + if (!is_numeric($dms_id)) + { + show_error('Wrong parameter'); + } + + $this->dmslib->download($dms_id); + } + + + /** + * Retrieve the UID of the logged user and checks if it is valid + */ + private function _setAuthUID() + { + $this->_uid = getAuthUID(); + + if (!$this->_uid) show_error('User authentification failed'); + } +} \ No newline at end of file diff --git a/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php b/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php new file mode 100644 index 000000000..c4c108665 --- /dev/null +++ b/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php @@ -0,0 +1,128 @@ +load->view( + 'templates/FHC-Header', + array( + 'title' => $this->p->t('anrechnung', 'anrechnungenGenehmigen'), + 'jquery' => true, + 'jqueryui' => true, + 'bootstrap' => true, + 'fontawesome' => true, + 'tabulator' => true, + 'ajaxlib' => true, + 'dialoglib' => true, + 'tablewidget' => true, + 'phrases' => array( + 'global' => array( + 'begruendung' + ), + 'anrechnung' => array( + 'nachweisdokumente', + 'empfehlung' + ), + 'ui' => array( + 'anzeigen', + 'alleAnzeigen', + 'hilfeZuDieserSeite', + 'hochladen', + 'spaltenEinstellen', + 'hilfeZuDieserSeite', + 'alleAuswaehlen', + 'alleAbwaehlen', + 'ausgewaehlteZeilen', + 'hilfe', + 'tabelleneinstellungen', + 'keineDatenVorhanden', + 'spaltenEinstellen', + ), + 'person' => array( + 'student', + 'personenkennzeichen', + 'vorname', + 'nachname' + ), + 'lehre' => array( + 'studiensemester', + 'studiengang', + 'lehrveranstaltung', + 'ects', + 'lektor', + ), + 'table' => array( + 'spaltenEinAusblenden', + 'spaltenEinAusblendenMitKlickOeffnen', + 'spaltenEinAusblendenAufEinstellungenKlicken', + 'spaltenEinAusblendenMitKlickAktivieren', + 'spaltenEinAusblendenMitKlickSchliessen', + 'spaltenbreiteVeraendern', + 'spaltenbreiteVeraendernText', + 'spaltenbreiteVeraendernInfotext', + 'zeilenAuswaehlen', + 'zeilenAuswaehlenEinzeln', + 'zeilenAuswaehlenBereich', + 'zeilenAuswaehlenAlle' + ) + ), + 'customJSs' => array( + 'public/js/bootstrapper.js', + 'public/js/lehre/anrechnung/approveAnrechnungUebersicht.js' + ) + ) +); +?> + + +
    +
    + +
    + +
    + +
    +
    +
    +
    + widgetlib->widget( + 'Studiensemester_widget', + array( + DropdownWidget::SELECTED_ELEMENT => $studiensemester_selected + ), + array( + 'name' => 'studiensemester', + 'id' => 'studiensemester' + ) + ); + ?> +
    + +
    +
    +
    + +
    +
    + load->view('lehre/anrechnung/approveAnrechnungUebersichtData.php'); ?> +
    +
    + +
    +
    +
    + + + +
    +
    +
    +
    +
    + + +load->view('templates/FHC-Footer'); ?> + diff --git a/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php b/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php new file mode 100644 index 000000000..b596d8f41 --- /dev/null +++ b/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php @@ -0,0 +1,106 @@ +>' . $LANGUAGE_INDEX . ' AS "status_bezeichnung" + FROM anrechnungen + JOIN lehre.tbl_anrechnungstatus as anrechnungstatus ON (anrechnungstatus.status_kurzbz = anrechnungen.status_kurzbz) + WHERE studiensemester_kurzbz = \'' . $STUDIENSEMESTER . '\' +'; + +$filterWidgetArray = array( + 'query' => $query, + 'tableUniqueId' => 'approveAnrechnungUebersicht', + 'requiredPermissions' => 'admin', + 'datasetRepresentation' => 'tabulator', + 'columnsAliases' => array( + 'anrechnung_id', + 'lehrveranstaltung_id', + 'begruendung_id', + 'dms_id', + 'studiensemester_kurzbz', + 'studiengang_kz', + ucfirst($this->p->t('lehre', 'studiengang')), + ucfirst($this->p->t('lehre', 'lehrveranstaltung')), + ucfirst($this->p->t('person', 'studentIn')), + ucfirst($this->p->t('global', 'begruendung')), + ucfirst($this->p->t('anrechnung', 'nachweisdokumente')), + ucfirst($this->p->t('anrechnung', 'empfehlung')), + 'status_kurzbz', + 'Status' + ), + 'datasetRepOptions' => '{ + height: func_height(this), + layout: "fitColumns", // fit columns to width of table + autoResize: false, // prevent auto resizing of table (false to allow adapting table size when cols are (de-)activated + headerFilterPlaceholder: " ", + index: "anrechnung_id", // assign specific column as unique id (important for row indexing) + selectable: true, // allow row selection + selectableRangeMode: "click", // allow range selection using shift end click on end of range + selectablePersistence:false, // deselect previously selected rows when table is filtered, sorted or paginated + tableBuilt: function(){ + func_tableBuilt(this); + }, + tableWidgetFooter: { + selectButtons: true + } + }', // tabulator properties + 'datasetRepFieldsDefs' => '{ + anrechnung_id: {visible: false}, + lehrveranstaltung_id: {visible: false}, + begruendung_id: {visible: false}, + dms_id: {visible: false}, + studiensemester_kurzbz: {visible: false}, + studiengang_kz: {visible: false}, + stg_bezeichnung: {headerFilter:"input"}, + lv_bezeichnung: {headerFilter:"input"}, + student: {headerFilter:"input"}, + begruendung: {headerFilter:"input"}, + dokument_bezeichnung: {headerFilter:"input", formatter:"link", formatterParams:{ + labelField:"dokument_bezeichnung", + url:function(cell){return "'. current_url() .'/download?dms_id=" + cell.getData().dms_id}, + target:"_blank" + }}, + empfehlung_anrechnung: {headerFilter:"input", align:"center", formatter: format_nullToMinus}, + status_kurzbz: {visible: false}, + status_bezeichnung: {headerFilter:"input"} + }', // col properties +); + +echo $this->widgetlib->widget('TableWidget', $filterWidgetArray); + +?> \ No newline at end of file diff --git a/public/css/Tabulator.css b/public/css/Tabulator.css index 22eeb4f5c..e9045dc85 100644 --- a/public/css/Tabulator.css +++ b/public/css/Tabulator.css @@ -39,4 +39,34 @@ .btn-select-col-selected { background-color: #e6e6e6; +} + +.btn-w200 +{ + width: 200px; +} + +.btn-mr5 +{ + margin-right: 10px; +} + +.btn-mr10 +{ + margin-right: 10px; +} + +.btn-mr20 +{ + margin-right: 20px; +} + +.btn-mr40 +{ + margin-right: 40px; +} + +.btn-mr50 +{ + margin-right: 50px; } \ No newline at end of file diff --git a/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js b/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js new file mode 100644 index 000000000..527961d09 --- /dev/null +++ b/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js @@ -0,0 +1,38 @@ +const BASE_URL = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router; +const APPROVE_ANRECHNUNG_DETAIL_URI = "lehre/anrechnung/ApproveAnrechnungDetail"; + +// TABULATOR FUNCTIONS +// --------------------------------------------------------------------------------------------------------------------- +// Returns relative height (depending on screen size) +function func_height(table){ + return $(window).height() * 0.50; +} + +// Adds column details +function func_tableBuilt(table) { + table.addColumn( + { + title: "Details", + align: "center", + width: 100, + formatter: "link", + formatterParams:{ + label:"Details", + url:function(cell){ + return BASE_URL + "/" + APPROVE_ANRECHNUNG_DETAIL_URI + "?anrechnung_id=" + cell.getData().anrechnung_id + }, + target:"_blank" + } + }, false, "status" // place column after status + ); +} + +// Formats null values to '-' +var format_nullToMinus = function(cell, formatterParams){ + return (cell.getValue() == null) ? '-' : cell.getValue(); +} + + +$(function(){ + +}); \ No newline at end of file diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index d6cec5a1e..9c8d5a329 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -1569,7 +1569,7 @@ $phrases = array( 'phrases' => array( array( 'sprache' => 'German', - 'text' => 'StudentIn', + 'text' => 'Student', 'description' => '', 'insertvon' => 'system' ), @@ -8308,6 +8308,166 @@ Any unusual occurrences 'insertvon' => 'system' ) ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'anrechnungenGenehmigen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Anrechnungen genehmigen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Approve applications', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'anrechnungGenehmigen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Anrechnung genehmigen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Approve application', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'empfehlungAnfordern', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Empfehlung anfordern', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Request recommendation', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'genehmigen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Genehmigen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Approve', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'ablehnen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Ablehnen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Reject', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'empfehlung', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Empfehlung', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Recommendation', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'begruendung', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Begründung', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Reason', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'person', + 'phrase' => 'studentIn', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'StudentIn', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'student', + 'description' => '', + 'insertvon' => 'system' + ) + ) ) ); From 1a050adea49e7625f69ef1f931a87d8b958298bb Mon Sep 17 00:00:00 2001 From: Cris Date: Tue, 19 Jan 2021 15:42:08 +0100 Subject: [PATCH 032/142] Added permission to DB: lehre/anrechnung_genehmigen and lehre/anrechnung_empfehlen Signed-off-by: cris-technikum --- system/dbupdate_3.3.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/system/dbupdate_3.3.php b/system/dbupdate_3.3.php index 0e172f9f0..7cd63494b 100644 --- a/system/dbupdate_3.3.php +++ b/system/dbupdate_3.3.php @@ -4635,6 +4635,34 @@ if($result = @$db->db_query("SELECT 1 FROM system.tbl_berechtigung WHERE berecht } } +// Add permission to approve Anrechnung +if($result = @$db->db_query("SELECT 1 FROM system.tbl_berechtigung WHERE berechtigung_kurzbz = 'lehre/anrechnung_genehmigen';")) +{ + if($db->db_num_rows($result) == 0) + { + $qry = "INSERT INTO system.tbl_berechtigung(berechtigung_kurzbz, beschreibung) VALUES('lehre/anrechnung_genehmigen', 'Anrechnung genehmigen');"; + + if(!$db->db_query($qry)) + echo 'system.tbl_berechtigung '.$db->db_last_error().'
    '; + else + echo ' system.tbl_berechtigung: Added permission for lehre/anrechnung_genehmigen
    '; + } +} + +// Add permission to recommend Anrechnung +if($result = @$db->db_query("SELECT 1 FROM system.tbl_berechtigung WHERE berechtigung_kurzbz = 'lehre/anrechnung_empfehlen';")) +{ + if($db->db_num_rows($result) == 0) + { + $qry = "INSERT INTO system.tbl_berechtigung(berechtigung_kurzbz, beschreibung) VALUES('lehre/anrechnung_empfehlen', 'Anrechnung empfehlen');"; + + if(!$db->db_query($qry)) + echo 'system.tbl_berechtigung '.$db->db_last_error().'
    '; + else + echo ' system.tbl_berechtigung: Added permission for lehre/anrechnung_empfehlen
    '; + } +} + // *** Pruefung und hinzufuegen der neuen Attribute und Tabellen echo '

    Pruefe Tabellen und Attribute!

    '; From 8d26cc9a86d68810b1efd8ec843cf1999b4bdff8 Mon Sep 17 00:00:00 2001 From: Cris Date: Tue, 19 Jan 2021 15:45:04 +0100 Subject: [PATCH 033/142] Added permission lehre/anrechnung_genehmigen to Controller Signed-off-by: cris-technikum --- .../lehre/anrechnung/ApproveAnrechnungUebersicht.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php index c9dd9a0d4..3a69847c9 100644 --- a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php +++ b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php @@ -9,8 +9,8 @@ class approveAnrechnungUebersicht extends Auth_Controller // Set required permissions parent::__construct( array( - 'index' => 'admin:rw', - 'download' => 'admin:rw' + 'index' => 'lehre/anrechnung_genehmigen:rw', + 'download' => 'lehre/anrechnung_genehmigen:rw' ) ); From 360aec41ee76cef3e3cd380c8b81d4ef5c2fb3a2 Mon Sep 17 00:00:00 2001 From: Cris Date: Tue, 19 Jan 2021 15:47:31 +0100 Subject: [PATCH 034/142] Restricted tabledata to retrieve only for studies of STGL Signed-off-by: cris-technikum --- .../lehre/anrechnung/ApproveAnrechnungUebersicht.php | 10 +++++++++- .../anrechnung/approveAnrechnungUebersichtData.php | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php index 3a69847c9..140fec28f 100644 --- a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php +++ b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php @@ -4,6 +4,7 @@ class approveAnrechnungUebersicht extends Auth_Controller { + const BERECHTIGUNG_ANRECHNUNG_GENEHMIGEN = 'lehre/anrechnung_genehmigen'; public function __construct() { // Set required permissions @@ -50,6 +51,12 @@ class approveAnrechnungUebersicht extends Auth_Controller { $studiensemester_kurzbz = $this->input->get('studiensemester'); + // Retrieve studiengaenge the user is entitled for + if (!$studiengang_kz_arr = $this->permissionlib->getSTG_isEntitledFor(self::BERECHTIGUNG_ANRECHNUNG_GENEHMIGEN)) + { + show_error(getError($studiengang_kz_arr)); + } + if (!is_string($studiensemester_kurzbz)) { $studiensemester = $this->StudiensemesterModel->getNearest(); // TODO check @@ -64,7 +71,8 @@ class approveAnrechnungUebersicht extends Auth_Controller } $viewData = array( - 'studiensemester_selected' => $studiensemester_kurzbz + 'studiensemester_selected' => $studiensemester_kurzbz, + 'studiengaenge_entitled' => $studiengang_kz_arr ); $this->load->view('lehre/anrechnung/approveAnrechnungUebersicht.php', $viewData); diff --git a/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php b/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php index b596d8f41..df7f84a12 100644 --- a/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php +++ b/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php @@ -1,5 +1,6 @@ Date: Tue, 19 Jan 2021 15:56:34 +0100 Subject: [PATCH 035/142] Adapted CSS: Red button for rejecting, blue for approving Signed-off-by: cris-technikum --- .../views/lehre/anrechnung/approveAnrechnungUebersicht.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php b/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php index c4c108665..fe6a5d0a9 100644 --- a/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php +++ b/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php @@ -114,8 +114,8 @@ $this->load->view(
    - - + +
    From 964bd40c143affb66eb368eb3d51b33b0dd64fd5 Mon Sep 17 00:00:00 2001 From: cris-technikum Date: Wed, 20 Jan 2021 11:02:15 +0100 Subject: [PATCH 036/142] Added logic & GUI adaptations for approving Anrechnungen . Added approve-methods in Controller and Library . Added row selection checks to avoid selecting approved and rejected Antraege Signed-off-by: cris-technikum --- .../ApproveAnrechnungUebersicht.php | 51 +++++++++++- application/libraries/AnrechnungLib.php | 56 +++++++++++++ .../approveAnrechnungUebersichtData.php | 8 +- .../anrechnung/approveAnrechnungUebersicht.js | 82 +++++++++++++++++++ 4 files changed, 195 insertions(+), 2 deletions(-) diff --git a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php index 140fec28f..4eea98369 100644 --- a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php +++ b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php @@ -5,18 +5,26 @@ class approveAnrechnungUebersicht extends Auth_Controller { const BERECHTIGUNG_ANRECHNUNG_GENEHMIGEN = 'lehre/anrechnung_genehmigen'; + + const ANRECHNUNGSTATUS_PROGRESSED_BY_STGL = 'inProgressDP'; + const ANRECHNUNGSTATUS_PROGRESSED_BY_KF = 'inProgressKF'; + const ANRECHNUNGSTATUS_APPROVED = 'approved'; + const ANRECHNUNGSTATUS_REJECTED = 'rejected'; + public function __construct() { // Set required permissions parent::__construct( array( 'index' => 'lehre/anrechnung_genehmigen:rw', - 'download' => 'lehre/anrechnung_genehmigen:rw' + 'download' => 'lehre/anrechnung_genehmigen:rw', + 'approve' => 'lehre/anrechnung_genehmigen:rw' ) ); // Load models $this->load->model('education/Anrechnung_model', 'AnrechnungModel'); + $this->load->model('education/Anrechnungstatus_model', 'AnrechnungstatusModel'); $this->load->model('content/DmsVersion_model', 'DmsVersionModel'); // Load libraries @@ -78,6 +86,47 @@ class approveAnrechnungUebersicht extends Auth_Controller $this->load->view('lehre/anrechnung/approveAnrechnungUebersicht.php', $viewData); } + /** + * Approve multiple Anrechnungen. + */ + public function approve() + { + $data = $this->input->post('data'); + + if(isEmptyArray($data)) + { + return $this->outputJsonError('Fehler beim Übertragen der Daten.'); + } + + // Get statusbezeichnung for 'approved' + $this->AnrechnungstatusModel->addSelect('bezeichnung_mehrsprachig'); + $approved = getData($this->AnrechnungstatusModel->load('approved'))[0]; + + foreach ($data as $item) + { + // Approve Anrechnung + if(getData($this->anrechnunglib->approveAnrechnung($item['anrechnung_id']))) + { + $json[]= array( + 'anrechnung_id' => $item['anrechnung_id'], + 'status_bezeichnung' => getUserLanguage() == 'German' + ? $approved->bezeichnung_mehrsprachig[0] + : $approved->bezeichnung_mehrsprachig[1] + ); + } + } + + // Output json to ajax + if (isset($json) && !isEmptyArray($json)) + { + return $this->outputJsonSuccess($json); + } + else + { + return $this->outputJsonError('Es wurden keine Anrechnungen genehmigt.'); + } + } + /** * Download and open uploaded document (Nachweisdokument). */ diff --git a/application/libraries/AnrechnungLib.php b/application/libraries/AnrechnungLib.php index 4a8f0f962..d2324c4e9 100644 --- a/application/libraries/AnrechnungLib.php +++ b/application/libraries/AnrechnungLib.php @@ -4,6 +4,11 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); class AnrechnungLib { + const ANRECHNUNGSTATUS_PROGRESSED_BY_STGL = 'inProgressDP'; + const ANRECHNUNGSTATUS_PROGRESSED_BY_KF = 'inProgressKF'; + const ANRECHNUNGSTATUS_APPROVED = 'approved'; + const ANRECHNUNGSTATUS_REJECTED = 'rejected'; + public function __construct() { $this->ci =& get_instance(); @@ -146,6 +151,57 @@ class AnrechnungLib return $status; } + /** + * Approve Anrechnung. + * Checks last status of Anrechnung and will only approve if last status is not approved or rejected. + * @param $anrechnung_id + * @return array + * @throws Exception + */ + public function approveAnrechnung($anrechnung_id) + { + // Check last Anrechnungstatus + if (!$result = getData($this->ci->AnrechnungModel->getLastAnrechnungstatus($anrechnung_id))[0]) + { + show_error(getError($result)); + } + + $status_kurzbz = $result->status_kurzbz; + + // Exit if already approved or rejected + if ($status_kurzbz == self::ANRECHNUNGSTATUS_APPROVED || $status_kurzbz == self::ANRECHNUNGSTATUS_REJECTED) // TODO: in js: bereits genehmigte nicht clickable! + { + return success(false); // has not been approved + } + + // Start DB transaction + $this->ci->db->trans_start(false); + + // Insert new status approved + $result = $this->ci->AnrechnungModel->saveAnrechnungstatus($anrechnung_id, self::ANRECHNUNGSTATUS_APPROVED); + + // Update genehmigt von + $result = $this->ci->AnrechnungModel->update( + $anrechnung_id, + array( + 'genehmigt_von' => getAuthUID(), + 'updateamum' => (new DateTime())->format('Y-m-d H:m:i'), + 'updatevon' => getAuthUID() + ) + ); + + // Transaction complete! + $this->ci->db->trans_complete(); + + if ($this->ci->db->trans_status() === false || isError($result)) + { + $this->ci->db->trans_rollback(); + show_error($result->msg, EXIT_ERROR); + } + + return success(true); // has been approved + } + private function _setAnrechnungDataObject($anrechnung) { $anrechnung_data = new StdClass(); diff --git a/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php b/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php index df7f84a12..4bb88653e 100644 --- a/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php +++ b/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php @@ -79,7 +79,13 @@ $filterWidgetArray = array( }, tableWidgetFooter: { selectButtons: true - } + }, + selectableCheck: function(row){ + return func_selectableCheck(row); + }, + rowUpdated:function(row){ + func_rowUpdated(row); + }, }', // tabulator properties 'datasetRepFieldsDefs' => '{ anrechnung_id: {visible: false}, diff --git a/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js b/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js index 527961d09..f62210aba 100644 --- a/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js +++ b/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js @@ -1,6 +1,11 @@ const BASE_URL = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router; const APPROVE_ANRECHNUNG_DETAIL_URI = "lehre/anrechnung/ApproveAnrechnungDetail"; +const ANRECHNUNGSTATUS_PROGRESSED_BY_STGL = 'inProgressDP'; +const ANRECHNUNGSTATUS_PROGRESSED_BY_KF = 'inProgressKF'; +const ANRECHNUNGSTATUS_APPROVED = 'approved'; +const ANRECHNUNGSTATUS_REJECTED = 'rejected'; + // TABULATOR FUNCTIONS // --------------------------------------------------------------------------------------------------------------------- // Returns relative height (depending on screen size) @@ -27,6 +32,30 @@ function func_tableBuilt(table) { ); } +// Formats row selectable/unselectable +function func_selectableCheck(row){ + let status_kurzbz = row.getData().status_kurzbz; + + return (status_kurzbz != ANRECHNUNGSTATUS_APPROVED && status_kurzbz != ANRECHNUNGSTATUS_REJECTED); +} + +// Performes after row was updated +function func_rowUpdated(row){ + // TODO: check better solution... + // status_kurzbz is not updated until page reload...therefor use the updated status_bezeichnung + let status_bezeichnung = row.getData().status_bezeichnung; + + // Deselect and disable new selection of updated rows, but not when + if (status_bezeichnung == 'genehmigt' || + status_bezeichnung == 'approved' || + status_bezeichnung == 'abgelehnt' || + status_bezeichnung == 'rejected') + { + row.deselect(); + row.getElement().style["pointerEvents"] = "none"; + } +} + // Formats null values to '-' var format_nullToMinus = function(cell, formatterParams){ return (cell.getValue() == null) ? '-' : cell.getValue(); @@ -35,4 +64,57 @@ var format_nullToMinus = function(cell, formatterParams){ $(function(){ + // Approve Anrechnungen + $("#approve-anrechnungen").click(function(){ + // Get selected rows data + let selected_data = $('#tableWidgetTabulator').tabulator('getSelectedData') + .map(function(data){ + // reduce to necessary fields + return { + 'anrechnung_id' : data.anrechnung_id, + } + }); + + // Alert and exit if no anrechnung is selected + if (selected_data.length == 0) + { + FHC_DialogLib.alertInfo('Bitte wählen Sie erst zumindest einen Antrag auf Anrechnung'); + return; + } + + + // Prepare data object for ajax call + let data = { + 'data': selected_data + }; + + FHC_AjaxClient.ajaxCallPost( + FHC_JS_DATA_STORAGE_OBJECT.called_path + "/approve", + data, + { + successCallback: function (data, textStatus, jqXHR) + { + if (data.error && data.retval != null) + { + // Print error message + FHC_DialogLib.alertWarning(data.retval); + } + + if (!data.error && data.retval != null) + { + // Update status 'genehmigt' + $('#tableWidgetTabulator').tabulator('updateData', data.retval); + + // Print success message + FHC_DialogLib.alertSuccess(data.retval.length + " Anrechnungsanträge wurden genehmigt."); + } + }, + errorCallback: function (jqXHR, textStatus, errorThrown) + { + FHC_DialogLib.alertError("Systemfehler
    Bitte kontaktieren Sie Ihren Administrator."); + } + } + ); + }); + }); \ No newline at end of file From 4ed786d65aa7edce478c5c61d0060f4a93cbdd14 Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 20 Jan 2021 11:03:47 +0100 Subject: [PATCH 037/142] Added promise check (browser compatibility) and redrawing table on resize Signed-off-by: cris-technikum --- .../anrechnung/approveAnrechnungUebersicht.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js b/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js index f62210aba..21acc3d10 100644 --- a/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js +++ b/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js @@ -63,6 +63,21 @@ var format_nullToMinus = function(cell, formatterParams){ $(function(){ + // Pruefen ob Promise unterstuetzt wird + // Tabulator funktioniert nicht mit IE + var canPromise = !! window.Promise; + if(!canPromise) + { + alert("Diese Seite kann mit ihrem Browser nicht angezeigt werden. Bitte verwenden Sie Firefox, Chrome oder Edge um die Seite anzuzeigen"); + window.location.href='about:blank'; + return; + } + + // Redraw table on resize to fit tabulators height to windows height + window.addEventListener('resize', function(){ + $('#tableWidgetTabulator').tabulator('setHeight', $(window).height() * 0.50); + $('#tableWidgetTabulator').tabulator('redraw', true); + }); // Approve Anrechnungen $("#approve-anrechnungen").click(function(){ From 046f8077886ac9bbab857c50c77386bbb0b82caa Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 20 Jan 2021 11:06:53 +0100 Subject: [PATCH 038/142] Added ECTS to tabledata Signed-off-by: cris-technikum --- .../views/lehre/anrechnung/approveAnrechnungUebersichtData.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php b/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php index 4bb88653e..f436927e9 100644 --- a/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php +++ b/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php @@ -15,6 +15,7 @@ $query = ' stg.studiengang_kz, stg.bezeichnung AS "stg_bezeichnung", lv.bezeichnung AS "lv_bezeichnung", + lv.ects, (person.nachname || \' \' || person.vorname) AS "student", begruendung.bezeichnung AS "begruendung", dmsversion.name AS "dokument_bezeichnung", @@ -58,6 +59,7 @@ $filterWidgetArray = array( 'studiengang_kz', ucfirst($this->p->t('lehre', 'studiengang')), ucfirst($this->p->t('lehre', 'lehrveranstaltung')), + 'ECTS', ucfirst($this->p->t('person', 'studentIn')), ucfirst($this->p->t('global', 'begruendung')), ucfirst($this->p->t('anrechnung', 'nachweisdokumente')), @@ -96,6 +98,7 @@ $filterWidgetArray = array( studiengang_kz: {visible: false}, stg_bezeichnung: {headerFilter:"input"}, lv_bezeichnung: {headerFilter:"input"}, + ects: {headerFilter:"input"}, student: {headerFilter:"input"}, begruendung: {headerFilter:"input"}, dokument_bezeichnung: {headerFilter:"input", formatter:"link", formatterParams:{ From f0ef091c5ff3f92c6d029d722a05b47a1eb9040e Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 20 Jan 2021 11:48:07 +0100 Subject: [PATCH 039/142] Added logic & GUI adaptations for rejecting Anrechnungen . Added rejecting-methods in Controller and Library Signed-off-by: cris-technikum --- .../ApproveAnrechnungUebersicht.php | 42 +++++++++++++- application/libraries/AnrechnungLib.php | 44 ++++++++++++++ .../anrechnung/approveAnrechnungUebersicht.js | 58 +++++++++++++++++++ 3 files changed, 143 insertions(+), 1 deletion(-) diff --git a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php index 4eea98369..48b8e2aa8 100644 --- a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php +++ b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php @@ -18,7 +18,8 @@ class approveAnrechnungUebersicht extends Auth_Controller array( 'index' => 'lehre/anrechnung_genehmigen:rw', 'download' => 'lehre/anrechnung_genehmigen:rw', - 'approve' => 'lehre/anrechnung_genehmigen:rw' + 'approve' => 'lehre/anrechnung_genehmigen:rw', + 'reject' => 'lehre/anrechnung_genehmigen:rw' ) ); @@ -127,6 +128,45 @@ class approveAnrechnungUebersicht extends Auth_Controller } } + public function reject() + { + $data = $this->input->post('data'); + + if(isEmptyArray($data)) + { + return $this->outputJsonError('Fehler beim Übertragen der Daten.'); + } + + // Get statusbezeichnung for 'approved' + $this->AnrechnungstatusModel->addSelect('bezeichnung_mehrsprachig'); + $rejected = getData($this->AnrechnungstatusModel->load('rejected'))[0]; + $rejected = getUserLanguage() == 'German' + ? $rejected->bezeichnung_mehrsprachig[0] + : $rejected->bezeichnung_mehrsprachig[1]; + + foreach ($data as $item) + { + // Approve Anrechnung + if(getData($this->anrechnunglib->rejectAnrechnung($item['anrechnung_id']))) + { + $json[]= array( + 'anrechnung_id' => $item['anrechnung_id'], + 'status_bezeichnung' => $rejected + ); + } + } + + // Output json to ajax + if (isset($json) && !isEmptyArray($json)) + { + return $this->outputJsonSuccess($json); + } + else + { + return $this->outputJsonError('Es wurden keine Anrechnungen genehmigt.'); + } + } + /** * Download and open uploaded document (Nachweisdokument). */ diff --git a/application/libraries/AnrechnungLib.php b/application/libraries/AnrechnungLib.php index d2324c4e9..8e8ef2eb7 100644 --- a/application/libraries/AnrechnungLib.php +++ b/application/libraries/AnrechnungLib.php @@ -202,6 +202,50 @@ class AnrechnungLib return success(true); // has been approved } + public function rejectAnrechnung($anrechnung_id) + { + // Check last Anrechnungstatus + if (!$result = getData($this->ci->AnrechnungModel->getLastAnrechnungstatus($anrechnung_id))[0]) + { + show_error(getError($result)); + } + + $status_kurzbz = $result->status_kurzbz; + + // Exit if already approved or rejected + if ($status_kurzbz == self::ANRECHNUNGSTATUS_APPROVED || $status_kurzbz == self::ANRECHNUNGSTATUS_REJECTED) // TODO: in js: bereits genehmigte nicht clickable! + { + return success(false); // dont reject + } + + // Start DB transaction + $this->ci->db->trans_start(false); + + // Insert new status approved + $result = $this->ci->AnrechnungModel->saveAnrechnungstatus($anrechnung_id, self::ANRECHNUNGSTATUS_REJECTED); + + // Update genehmigt von + $result = $this->ci->AnrechnungModel->update( + $anrechnung_id, + array( + 'genehmigt_von' => getAuthUID(), + 'updateamum' => (new DateTime())->format('Y-m-d H:m:i'), + 'updatevon' => getAuthUID() + ) + ); + + // Transaction complete! + $this->ci->db->trans_complete(); + + if ($this->ci->db->trans_status() === false || isError($result)) + { + $this->ci->db->trans_rollback(); + show_error($result->msg, EXIT_ERROR); + } + + return success(true); // rejected + } + private function _setAnrechnungDataObject($anrechnung) { $anrechnung_data = new StdClass(); diff --git a/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js b/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js index 21acc3d10..c746a835c 100644 --- a/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js +++ b/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js @@ -132,4 +132,62 @@ $(function(){ ); }); + // Reject Anrechnungen + $("#reject-anrechnungen").click(function(){ + // Get selected rows data + let selected_data = $('#tableWidgetTabulator').tabulator('getSelectedData') + .map(function(data){ + // reduce to necessary fields + return { + 'anrechnung_id' : data.anrechnung_id, + } + }); + + // Alert and exit if no anrechnung is selected + if (selected_data.length == 0) + { + FHC_DialogLib.alertInfo('Bitte wählen Sie erst zumindest einen Antrag auf Anrechnung'); + return; + } + + // Confirm before rejecting + if(!confirm('Wollen Sie wirklich die gewählten Anträge ablehnen?')) + { + return; + } + + // Prepare data object for ajax call + let data = { + 'data': selected_data + }; + + FHC_AjaxClient.ajaxCallPost( + FHC_JS_DATA_STORAGE_OBJECT.called_path + "/reject", + data, + { + successCallback: function (data, textStatus, jqXHR) + { + if (data.error && data.retval != null) + { + // Print error message + FHC_DialogLib.alertWarning(data.retval); + } + + if (!data.error && data.retval != null) + { + // Update status 'genehmigt' + $('#tableWidgetTabulator').tabulator('updateData', data.retval); + + // Print success message + FHC_DialogLib.alertSuccess(data.retval.length + " Anrechnungsanträge wurden abgelehnt."); + } + }, + errorCallback: function (jqXHR, textStatus, errorThrown) + { + FHC_DialogLib.alertError("Systemfehler
    Bitte kontaktieren Sie Ihren Administrator."); + } + } + ); + }); + }); \ No newline at end of file From 1bd66d0ee24ee3fef894f44e86e7cde8b520be91 Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 20 Jan 2021 13:15:28 +0100 Subject: [PATCH 040/142] Corrected: No genehmigt_von and update info when Anrechnung is rejected Signed-off-by: cris-technikum --- application/libraries/AnrechnungLib.php | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/application/libraries/AnrechnungLib.php b/application/libraries/AnrechnungLib.php index 8e8ef2eb7..129fe9292 100644 --- a/application/libraries/AnrechnungLib.php +++ b/application/libraries/AnrechnungLib.php @@ -218,29 +218,12 @@ class AnrechnungLib return success(false); // dont reject } - // Start DB transaction - $this->ci->db->trans_start(false); - - // Insert new status approved + // Insert new status rejected $result = $this->ci->AnrechnungModel->saveAnrechnungstatus($anrechnung_id, self::ANRECHNUNGSTATUS_REJECTED); - // Update genehmigt von - $result = $this->ci->AnrechnungModel->update( - $anrechnung_id, - array( - 'genehmigt_von' => getAuthUID(), - 'updateamum' => (new DateTime())->format('Y-m-d H:m:i'), - 'updatevon' => getAuthUID() - ) - ); - - // Transaction complete! - $this->ci->db->trans_complete(); - - if ($this->ci->db->trans_status() === false || isError($result)) + if (isError($result)) { - $this->ci->db->trans_rollback(); - show_error($result->msg, EXIT_ERROR); + show_error(getError($result)); } return success(true); // rejected From 114ac7a69e89b91b9442f4547b5210d71fe23b61 Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 20 Jan 2021 13:40:33 +0100 Subject: [PATCH 041/142] Corrected Personenkennzeichen: students matrikelnr instead of person bpk Signed-off-by: cris-technikum --- application/libraries/AnrechnungLib.php | 10 ++++++++-- .../views/lehre/anrechnung/requestAnrechnung.php | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/application/libraries/AnrechnungLib.php b/application/libraries/AnrechnungLib.php index 129fe9292..fbcbe817e 100644 --- a/application/libraries/AnrechnungLib.php +++ b/application/libraries/AnrechnungLib.php @@ -17,6 +17,7 @@ class AnrechnungLib $this->ci->load->model('person/Person_model', 'PersonModel'); $this->ci->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel'); $this->ci->load->model('organisation/Studiengang_model', 'StudiengangModel'); + $this->ci->load->model('crm/Student_model', 'StudentModel'); $this->ci->load->model('content/DmsVersion_model', 'DmsVersionModel'); } @@ -43,6 +44,12 @@ class AnrechnungLib show_error('Failed loading person data.'); } + // Get the internal personenkennzeichen + if (!$student = getData($this->ci->StudentModel->load(array('student_uid' => $uid)))[0]) + { + show_error(getError($student)); + } + // Get studiengang bezeichnung if (!$studiengang = getData($this->ci->StudiengangModel->load($lv->studiengang_kz))[0]) { @@ -63,8 +70,7 @@ class AnrechnungLib $antrag_data->studiensemester_kurzbz = $studiensemester_kurzbz; $antrag_data->vorname = $person->vorname; $antrag_data->nachname = $person->nachname; -// $antrag_data->bpk = $person->bpk; - $antrag_data->bpk = $person->matr_nr; + $antrag_data->matrikelnr = $student->matrikelnr; $antrag_data->stg_bezeichnung = $studiengang->bezeichnung; $antrag_data->lektoren = $lv_lektoren; diff --git a/application/views/lehre/anrechnung/requestAnrechnung.php b/application/views/lehre/anrechnung/requestAnrechnung.php index 7e37e9e52..0c59f73e2 100644 --- a/application/views/lehre/anrechnung/requestAnrechnung.php +++ b/application/views/lehre/anrechnung/requestAnrechnung.php @@ -76,7 +76,7 @@ $this->load->view( p->t('person', 'personenkennzeichen'); ?> - bpk ?> + matrikelnr ?> p->t('lehre', 'studiensemester'); ?> From a09abfd70ce5fdc5ce619be059648d6f28c0df36 Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 20 Jan 2021 15:14:31 +0100 Subject: [PATCH 042/142] Added Zeugnisnote = 6 (angerechnet) when Anrechnung is approved Signed-off-by: cris-technikum --- application/libraries/AnrechnungLib.php | 35 ++++++++++++++++++------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/application/libraries/AnrechnungLib.php b/application/libraries/AnrechnungLib.php index fbcbe817e..6a2f1ac78 100644 --- a/application/libraries/AnrechnungLib.php +++ b/application/libraries/AnrechnungLib.php @@ -19,6 +19,7 @@ class AnrechnungLib $this->ci->load->model('organisation/Studiengang_model', 'StudiengangModel'); $this->ci->load->model('crm/Student_model', 'StudentModel'); $this->ci->load->model('content/DmsVersion_model', 'DmsVersionModel'); + $this->ci->load->model('education/Zeugnisnote_model', 'ZeugnisnoteModel'); } /** @@ -177,35 +178,51 @@ class AnrechnungLib // Exit if already approved or rejected if ($status_kurzbz == self::ANRECHNUNGSTATUS_APPROVED || $status_kurzbz == self::ANRECHNUNGSTATUS_REJECTED) // TODO: in js: bereits genehmigte nicht clickable! { - return success(false); // has not been approved + return success(false); // dont approve } // Start DB transaction $this->ci->db->trans_start(false); + $stgl_uid = getAuthUID(); + // Insert new status approved - $result = $this->ci->AnrechnungModel->saveAnrechnungstatus($anrechnung_id, self::ANRECHNUNGSTATUS_APPROVED); + $this->ci->AnrechnungModel->saveAnrechnungstatus($anrechnung_id, self::ANRECHNUNGSTATUS_APPROVED); // Update genehmigt von - $result = $this->ci->AnrechnungModel->update( + $this->ci->AnrechnungModel->update( $anrechnung_id, array( - 'genehmigt_von' => getAuthUID(), + 'genehmigt_von' => $stgl_uid, 'updateamum' => (new DateTime())->format('Y-m-d H:m:i'), - 'updatevon' => getAuthUID() + 'updatevon' => $stgl_uid ) ); - // Transaction complete! + // Set zeugnisnote to angerechnet (= note 6) + $this->ci->AnrechnungModel->addSelect('lehrveranstaltung_id, student_uid, studiensemester_kurzbz'); + $this->ci->AnrechnungModel->addJoin('public.tbl_student', 'prestudent_id'); + $anrechnung = getData($this->ci->AnrechnungModel->load($anrechnung_id))[0]; + $result = $this->ci->ZeugnisnoteModel->insert(array( + 'lehrveranstaltung_id' => $anrechnung->lehrveranstaltung_id, + 'student_uid' => $anrechnung->student_uid, + 'studiensemester_kurzbz' => $anrechnung->studiensemester_kurzbz, + 'note' => 6, + 'insertvon' => $stgl_uid, + 'bemerkung' => 'Digitale Anrechnung' + ) + ); + + // Transaction complete $this->ci->db->trans_complete(); - if ($this->ci->db->trans_status() === false || isError($result)) + if ($this->ci->db->trans_status() === false) { $this->ci->db->trans_rollback(); - show_error($result->msg, EXIT_ERROR); + return error($result->msg, EXIT_ERROR); } - return success(true); // has been approved + return success(true); // approved } public function rejectAnrechnung($anrechnung_id) From 9a0ea02e0c332a64d64c06dbc2fdbdca93eae499 Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 20 Jan 2021 15:20:57 +0100 Subject: [PATCH 043/142] Minor code enhancement Signed-off-by: cris-technikum --- .../anrechnung/ApproveAnrechnungUebersicht.php | 16 ++++++++++------ application/libraries/AnrechnungLib.php | 5 +++++ .../anrechnung/approveAnrechnungUebersicht.js | 11 ----------- 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php index 48b8e2aa8..d8d34b981 100644 --- a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php +++ b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php @@ -88,7 +88,7 @@ class approveAnrechnungUebersicht extends Auth_Controller } /** - * Approve multiple Anrechnungen. + * Approve Anrechnungen. */ public function approve() { @@ -102,6 +102,9 @@ class approveAnrechnungUebersicht extends Auth_Controller // Get statusbezeichnung for 'approved' $this->AnrechnungstatusModel->addSelect('bezeichnung_mehrsprachig'); $approved = getData($this->AnrechnungstatusModel->load('approved'))[0]; + $approved = getUserLanguage() == 'German' + ? $approved->bezeichnung_mehrsprachig[0] + : $approved->bezeichnung_mehrsprachig[1]; foreach ($data as $item) { @@ -110,9 +113,7 @@ class approveAnrechnungUebersicht extends Auth_Controller { $json[]= array( 'anrechnung_id' => $item['anrechnung_id'], - 'status_bezeichnung' => getUserLanguage() == 'German' - ? $approved->bezeichnung_mehrsprachig[0] - : $approved->bezeichnung_mehrsprachig[1] + 'status_bezeichnung' => $approved ); } } @@ -128,6 +129,9 @@ class approveAnrechnungUebersicht extends Auth_Controller } } + /** + * Reject Anrechnungen. + */ public function reject() { $data = $this->input->post('data'); @@ -137,7 +141,7 @@ class approveAnrechnungUebersicht extends Auth_Controller return $this->outputJsonError('Fehler beim Übertragen der Daten.'); } - // Get statusbezeichnung for 'approved' + // Get statusbezeichnung for 'rejected' $this->AnrechnungstatusModel->addSelect('bezeichnung_mehrsprachig'); $rejected = getData($this->AnrechnungstatusModel->load('rejected'))[0]; $rejected = getUserLanguage() == 'German' @@ -146,7 +150,7 @@ class approveAnrechnungUebersicht extends Auth_Controller foreach ($data as $item) { - // Approve Anrechnung + // Reject Anrechnung if(getData($this->anrechnunglib->rejectAnrechnung($item['anrechnung_id']))) { $json[]= array( diff --git a/application/libraries/AnrechnungLib.php b/application/libraries/AnrechnungLib.php index 6a2f1ac78..5d4f48aa0 100644 --- a/application/libraries/AnrechnungLib.php +++ b/application/libraries/AnrechnungLib.php @@ -225,6 +225,11 @@ class AnrechnungLib return success(true); // approved } + /** + * Reject Anrechnung. + * @param $anrechnung_id + * @return array + */ public function rejectAnrechnung($anrechnung_id) { // Check last Anrechnungstatus diff --git a/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js b/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js index c746a835c..661946803 100644 --- a/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js +++ b/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js @@ -41,19 +41,8 @@ function func_selectableCheck(row){ // Performes after row was updated function func_rowUpdated(row){ - // TODO: check better solution... - // status_kurzbz is not updated until page reload...therefor use the updated status_bezeichnung - let status_bezeichnung = row.getData().status_bezeichnung; - - // Deselect and disable new selection of updated rows, but not when - if (status_bezeichnung == 'genehmigt' || - status_bezeichnung == 'approved' || - status_bezeichnung == 'abgelehnt' || - status_bezeichnung == 'rejected') - { row.deselect(); row.getElement().style["pointerEvents"] = "none"; - } } // Formats null values to '-' From 3a285c5672cd957283e76561fe7fe79383275867 Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 20 Jan 2021 19:05:56 +0100 Subject: [PATCH 044/142] Added status inProgressLektor Signed-off-by: cris-technikum --- system/dbupdate_3.3.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/system/dbupdate_3.3.php b/system/dbupdate_3.3.php index 7cd63494b..77e925ac3 100644 --- a/system/dbupdate_3.3.php +++ b/system/dbupdate_3.3.php @@ -4553,10 +4553,11 @@ if(!$result = @$db->db_query("SELECT 1 FROM lehre.tbl_anrechnungstatus LIMIT 1;" ALTER TABLE lehre.tbl_anrechnungstatus ADD CONSTRAINT pk_anrechnungstatus PRIMARY KEY (status_kurzbz); - INSERT INTO lehre.tbl_anrechnungstatus(status_kurzbz, bezeichnung_mehrsprachig) VALUES('inProgressDP', '{\'bearbeitet von STG-Leitung\',\'processed by STG-Director\'}'); - INSERT INTO lehre.tbl_anrechnungstatus(status_kurzbz, bezeichnung_mehrsprachig) VALUES('inProgressKF', '{\'bearbeitet von KF-Leitung\',\'processed by KF-Manager\'}'); - INSERT INTO lehre.tbl_anrechnungstatus(status_kurzbz, bezeichnung_mehrsprachig) VALUES('approved', '{\'genehmigt\',\'approved\'}'); - INSERT INTO lehre.tbl_anrechnungstatus(status_kurzbz, bezeichnung_mehrsprachig) VALUES('rejected', '{\'abgelehnt\',\'rejected\'}'); + INSERT INTO lehre.tbl_anrechnungstatus(status_kurzbz, bezeichnung_mehrsprachig) VALUES('inProgressDP', '{\"bearbeitet von STG-Leitung\",\"processed by STG-Director\"}'); + INSERT INTO lehre.tbl_anrechnungstatus(status_kurzbz, bezeichnung_mehrsprachig) VALUES('inProgressKF', '{\"bearbeitet von KF-Leitung\",\"processed by KF-Manager\"}'); + INSERT INTO lehre.tbl_anrechnungstatus(status_kurzbz, bezeichnung_mehrsprachig) VALUES('inProgressLektor', '{\"bearbeitet von LektorIn\",\"processed by lector\"}'); + INSERT INTO lehre.tbl_anrechnungstatus(status_kurzbz, bezeichnung_mehrsprachig) VALUES('approved', '{\"genehmigt\",\"approved\"}'); + INSERT INTO lehre.tbl_anrechnungstatus(status_kurzbz, bezeichnung_mehrsprachig) VALUES('rejected', '{\"abgelehnt\",\"rejected\"}'); GRANT SELECT ON lehre.tbl_anrechnungstatus TO web; GRANT SELECT, UPDATE, INSERT, DELETE ON lehre.tbl_anrechnungstatus TO vilesci; From 97d86cc702b01bca0f912c488cd7c1800f6b3209 Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 20 Jan 2021 19:07:33 +0100 Subject: [PATCH 045/142] Added logic & GUI adaptations for requesting recommendations . Added request recommendation-methods in Controller and Library Signed-off-by: cris-technikum --- .../ApproveAnrechnungUebersicht.php | 46 ++++++++++++++- application/libraries/AnrechnungLib.php | 35 +++++++++++ .../anrechnung/approveAnrechnungUebersicht.js | 59 ++++++++++++++++++- 3 files changed, 138 insertions(+), 2 deletions(-) diff --git a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php index d8d34b981..6fefa6d10 100644 --- a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php +++ b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php @@ -8,6 +8,7 @@ class approveAnrechnungUebersicht extends Auth_Controller const ANRECHNUNGSTATUS_PROGRESSED_BY_STGL = 'inProgressDP'; const ANRECHNUNGSTATUS_PROGRESSED_BY_KF = 'inProgressKF'; + const ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR = 'inProgressLektor'; const ANRECHNUNGSTATUS_APPROVED = 'approved'; const ANRECHNUNGSTATUS_REJECTED = 'rejected'; @@ -19,7 +20,8 @@ class approveAnrechnungUebersicht extends Auth_Controller 'index' => 'lehre/anrechnung_genehmigen:rw', 'download' => 'lehre/anrechnung_genehmigen:rw', 'approve' => 'lehre/anrechnung_genehmigen:rw', - 'reject' => 'lehre/anrechnung_genehmigen:rw' + 'reject' => 'lehre/anrechnung_genehmigen:rw', + 'requestRecommendation' => 'lehre/anrechnung_genehmigen:rw' ) ); @@ -171,6 +173,48 @@ class approveAnrechnungUebersicht extends Auth_Controller } } + /** + * Request recommendation for Anrechnungen. + */ + public function requestRecommendation() + { + $data = $this->input->post('data'); + + if(isEmptyArray($data)) + { + return $this->outputJsonError('Fehler beim Übertragen der Daten.'); + } + + // Get statusbezeichnung for 'inProgressLektor' + $this->AnrechnungstatusModel->addSelect('bezeichnung_mehrsprachig'); + $inProgressLektor = getData($this->AnrechnungstatusModel->load('inProgressLektor'))[0]; + $inProgressLektor = getUserLanguage() == 'German' + ? $inProgressLektor->bezeichnung_mehrsprachig[0] + : $inProgressLektor->bezeichnung_mehrsprachig[1]; + + foreach ($data as $item) + { + // Approve Anrechnung + if(getData($this->anrechnunglib->requestRecommendation($item['anrechnung_id']))) + { + $json[]= array( + 'anrechnung_id' => $item['anrechnung_id'], + 'status_bezeichnung' => $inProgressLektor + ); + } + } + + // Output json to ajax + if (isset($json) && !isEmptyArray($json)) + { + return $this->outputJsonSuccess($json); + } + else + { + return $this->outputJsonError('Es wurden keine Empfehlungen angefordert'); + } + } + /** * Download and open uploaded document (Nachweisdokument). */ diff --git a/application/libraries/AnrechnungLib.php b/application/libraries/AnrechnungLib.php index 5d4f48aa0..e751621a6 100644 --- a/application/libraries/AnrechnungLib.php +++ b/application/libraries/AnrechnungLib.php @@ -6,6 +6,7 @@ class AnrechnungLib { const ANRECHNUNGSTATUS_PROGRESSED_BY_STGL = 'inProgressDP'; const ANRECHNUNGSTATUS_PROGRESSED_BY_KF = 'inProgressKF'; + const ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR = 'inProgressLektor'; const ANRECHNUNGSTATUS_APPROVED = 'approved'; const ANRECHNUNGSTATUS_REJECTED = 'rejected'; @@ -257,6 +258,40 @@ class AnrechnungLib return success(true); // rejected } + /** + * Request recommendation. + * @param $anrechnung_id + * @return array + */ + public function requestRecommendation($anrechnung_id) + { + // Check last Anrechnungstatus + if (!$result = getData($this->ci->AnrechnungModel->getLastAnrechnungstatus($anrechnung_id))[0]) + { + show_error(getError($result)); + } + + $status_kurzbz = $result->status_kurzbz; + + // Exit if already approved or rejected or processed by lector + if ($status_kurzbz == self::ANRECHNUNGSTATUS_APPROVED + || $status_kurzbz == self::ANRECHNUNGSTATUS_REJECTED + || $status_kurzbz == self::ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR) + { + return success(false); // dont ask for recommendation + } + + // Insert new status inProgressLektor + $result = $this->ci->AnrechnungModel->saveAnrechnungstatus($anrechnung_id, self::ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR); + + if (isError($result)) + { + show_error(getError($result)); + } + + return success(true); // rejected + } + private function _setAnrechnungDataObject($anrechnung) { $anrechnung_data = new StdClass(); diff --git a/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js b/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js index 661946803..b706ed63e 100644 --- a/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js +++ b/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js @@ -3,6 +3,7 @@ const APPROVE_ANRECHNUNG_DETAIL_URI = "lehre/anrechnung/ApproveAnrechnungDetail" const ANRECHNUNGSTATUS_PROGRESSED_BY_STGL = 'inProgressDP'; const ANRECHNUNGSTATUS_PROGRESSED_BY_KF = 'inProgressKF'; +const ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR = 'inProgressLektor'; const ANRECHNUNGSTATUS_APPROVED = 'approved'; const ANRECHNUNGSTATUS_REJECTED = 'rejected'; @@ -36,7 +37,11 @@ function func_tableBuilt(table) { function func_selectableCheck(row){ let status_kurzbz = row.getData().status_kurzbz; - return (status_kurzbz != ANRECHNUNGSTATUS_APPROVED && status_kurzbz != ANRECHNUNGSTATUS_REJECTED); + return ( + status_kurzbz != ANRECHNUNGSTATUS_APPROVED && + status_kurzbz != ANRECHNUNGSTATUS_REJECTED && + status_kurzbz != ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR + ); } // Performes after row was updated @@ -179,4 +184,56 @@ $(function(){ ); }); + // Request Recommendation for Anrechnungen + $("#request-recommendation").click(function(){ + // Get selected rows data + let selected_data = $('#tableWidgetTabulator').tabulator('getSelectedData') + .map(function(data){ + // reduce to necessary fields + return { + 'anrechnung_id' : data.anrechnung_id, + } + }); + + // Alert and exit if no anrechnung is selected + if (selected_data.length == 0) + { + FHC_DialogLib.alertInfo('Bitte wählen Sie erst zumindest einen Antrag auf Anrechnung'); + return; + } + + // Prepare data object for ajax call + let data = { + 'data': selected_data + }; + + FHC_AjaxClient.ajaxCallPost( + FHC_JS_DATA_STORAGE_OBJECT.called_path + "/requestRecommendation", + data, + { + successCallback: function (data, textStatus, jqXHR) + { + if (data.error && data.retval != null) + { + // Print error message + FHC_DialogLib.alertWarning(data.retval); + } + + if (!data.error && data.retval != null) + { + // Update status 'genehmigt' + $('#tableWidgetTabulator').tabulator('updateData', data.retval); + + // Print success message + FHC_DialogLib.alertSuccess("Empfehlungen wurden angefordert."); + } + }, + errorCallback: function (jqXHR, textStatus, errorThrown) + { + FHC_DialogLib.alertError("Systemfehler
    Bitte kontaktieren Sie Ihren Administrator."); + } + } + ); + }); + }); \ No newline at end of file From 9e5b03b2dc9b7c14344a82c91f848b0544f0d67b Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 20 Jan 2021 19:16:17 +0100 Subject: [PATCH 046/142] Adapted Select-all-button to select only Anrechnungen progressed by STGL Signed-off-by: cris-technikum --- .../lehre/anrechnung/approveAnrechnungUebersicht.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js b/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js index b706ed63e..e4af9d5c0 100644 --- a/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js +++ b/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js @@ -55,6 +55,19 @@ var format_nullToMinus = function(cell, formatterParams){ return (cell.getValue() == null) ? '-' : cell.getValue(); } +/* + * Hook to overwrite TableWigdgets select-all-button behaviour + * Select all (filtered) rows that are progressed by stg leiter. + * (Ignore rows that are approved, rejected or in request for recommendation) + */ +function tableWidgetHook_selectAllButton(tableWidgetDiv){ + tableWidgetDiv.find("#tableWidgetTabulator").tabulator('getRows', true) + .filter(row => + row.getData().status_kurzbz == ANRECHNUNGSTATUS_PROGRESSED_BY_STGL + ) + .forEach((row => row.select())); +} + $(function(){ // Pruefen ob Promise unterstuetzt wird From 47c8432faf3fc6dfa6660c4cc575f7e8fdeb821f Mon Sep 17 00:00:00 2001 From: Cris Date: Thu, 21 Jan 2021 10:48:19 +0100 Subject: [PATCH 047/142] Added filter buttons to STGL Anrechnungen Signed-off-by: cris-technikum --- .../approveAnrechnungUebersicht.php | 30 +++++- .../anrechnung/approveAnrechnungUebersicht.js | 51 +++++++++ system/phrasesupdate.php | 100 ++++++++++++++++++ 3 files changed, 179 insertions(+), 2 deletions(-) diff --git a/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php b/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php index fe6a5d0a9..a850bca44 100644 --- a/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php +++ b/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php @@ -110,9 +110,35 @@ $this->load->view( load->view('lehre/anrechnung/approveAnrechnungUebersichtData.php'); ?>
    - +
    -
    + + +
    + +
    + + +
    diff --git a/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js b/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js index e4af9d5c0..9ba20a5ba 100644 --- a/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js +++ b/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js @@ -86,6 +86,57 @@ $(function(){ $('#tableWidgetTabulator').tabulator('redraw', true); }); + // Show only rows with empfohlene + noch nicht genehmigte/abgelehnte anrechnungen + $("#show-recommended").click(function(){ + $('#tableWidgetTabulator').tabulator('setFilter', + [ + {field: 'status_kurzbz', type: '=', value: ANRECHNUNGSTATUS_PROGRESSED_BY_STGL}, + {field: 'empfehlung_anrechnung', type: '=', value: 'true'} + ] + ); + }); + + // Show only rows with nicht empfohlene + noch nicht genehmigte/abgelehnte anrechnungen + $("#show-not-recommended").click(function(){ + $('#tableWidgetTabulator').tabulator('setFilter', [ + {field: 'status_kurzbz', type: '=', value: ANRECHNUNGSTATUS_PROGRESSED_BY_STGL}, + {field: 'empfehlung_anrechnung', type: '=', value: 'false'}, + ] + ); + }); + + // Show only rows with genehmigte anrechnungen + $("#show-approved").click(function(){ + $('#tableWidgetTabulator').tabulator('setFilter', + [ + {field: 'status_kurzbz', type: '=', value: ANRECHNUNGSTATUS_APPROVED} + ] + ); + }); + + // Show only rows with abgelehnte anrechnungen + $("#show-rejected").click(function(){ + $('#tableWidgetTabulator').tabulator('setFilter', + [ + {field: 'status_kurzbz', type: '=', value: ANRECHNUNGSTATUS_REJECTED} + ] + ); + }); + + /** + * Show all rows: clear filter and blur button + * Bootstrap button remains in activated style, even when clicking various times. + * This function "resets" button style and clear all tabulators filter. + * NOTE: MUST be after all other filters + */ + $(".btn-clearfilter").click(function(){ + if($(this).hasClass('active')) + { + $('#tableWidgetTabulator').tabulator('clearFilter'); + $(this).blur(); + } + }) + // Approve Anrechnungen $("#approve-anrechnungen").click(function(){ // Get selected rows data diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 9c8d5a329..d5a3fdb5c 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -8468,6 +8468,106 @@ Any unusual occurrences 'insertvon' => 'system' ) ) + ), + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'nurEmpfohleneAnzeigen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Nur empfohlene anzeigen (die noch genehmigt/abgelehnt werden müssen)', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Show only recommended ones (that need to be approved/rejected)', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'nurNichtEmpfohleneAnzeigen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Nur nicht empfohlene anzeigen (die noch genehmigt/abgelehnt werden müssen)', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Show only not recommended ones (that need to be approved/rejected)', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'nurGenehmigteAnzeigen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Nur genehmigte anzeigen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Show only approved ones', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'nurAbgelehnteAnzeigen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Nur abgelehnte anzeigen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Show only rejected ones', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'nurFehlendeEmpfehlungenAnzeigen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Nur jene anzeigen, wo eine Empfehlung noch ansteht', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Show only those ones that need your recommendation', + 'description' => '', + 'insertvon' => 'system' + ) + ) ) ); From 99db4ec3cefa94c7af46b62511691f638fe6268a Mon Sep 17 00:00:00 2001 From: Cris Date: Thu, 21 Jan 2021 11:08:57 +0100 Subject: [PATCH 048/142] Adapted empfehlung to be human readable ja/nein/- instead of boolean/null Signed-off-by: cris-technikum --- .../approveAnrechnungUebersicht.php | 2 + .../approveAnrechnungUebersichtData.php | 2 +- .../anrechnung/approveAnrechnungUebersicht.js | 10 +++-- system/phrasesupdate.php | 40 +++++++++++++++++++ 4 files changed, 50 insertions(+), 4 deletions(-) diff --git a/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php b/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php index a850bca44..f25a07c85 100644 --- a/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php +++ b/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php @@ -33,6 +33,8 @@ $this->load->view( 'tabelleneinstellungen', 'keineDatenVorhanden', 'spaltenEinstellen', + 'ja', + 'nein' ), 'person' => array( 'student', diff --git a/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php b/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php index f436927e9..f1836d77c 100644 --- a/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php +++ b/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php @@ -106,7 +106,7 @@ $filterWidgetArray = array( url:function(cell){return "'. current_url() .'/download?dms_id=" + cell.getData().dms_id}, target:"_blank" }}, - empfehlung_anrechnung: {headerFilter:"input", align:"center", formatter: format_nullToMinus}, + empfehlung_anrechnung: {headerFilter:"input", align:"center", formatter: format_empfehlung_anrechnung}, status_kurzbz: {visible: false}, status_bezeichnung: {headerFilter:"input"} }', // col properties diff --git a/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js b/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js index 9ba20a5ba..454ef9549 100644 --- a/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js +++ b/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js @@ -50,9 +50,13 @@ function func_rowUpdated(row){ row.getElement().style["pointerEvents"] = "none"; } -// Formats null values to '-' -var format_nullToMinus = function(cell, formatterParams){ - return (cell.getValue() == null) ? '-' : cell.getValue(); +// Formats empfehlung_anrechnung +var format_empfehlung_anrechnung = function(cell, formatterParams){ + return (cell.getValue() == null) + ? '-' + : (cell.getValue() == 'true') + ? FHC_PhrasesLib.t("ui", "ja") + : FHC_PhrasesLib.t("ui", "nein"); } /* diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index d5a3fdb5c..f8f7c9eaf 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -8568,6 +8568,46 @@ Any unusual occurrences 'insertvon' => 'system' ) ) + ), + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'ja', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'ja', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'yes', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'nein', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'nein', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'no', + 'description' => '', + 'insertvon' => 'system' + ) + ) ) ); From 8a03ccab5d04ed071d2589e59c5c554e94ee9cc0 Mon Sep 17 00:00:00 2001 From: Cris Date: Thu, 21 Jan 2021 11:19:11 +0100 Subject: [PATCH 049/142] Visibly greyed rows that are unselectable (at start and on update) Signed-off-by: cris-technikum --- .../approveAnrechnungUebersichtData.php | 3 +++ .../anrechnung/approveAnrechnungUebersicht.js | 22 +++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php b/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php index f1836d77c..33a9ee2d0 100644 --- a/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php +++ b/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php @@ -84,6 +84,9 @@ $filterWidgetArray = array( }, selectableCheck: function(row){ return func_selectableCheck(row); + }, + rowFormatter:function(row){ + func_rowFormatter(row); }, rowUpdated:function(row){ func_rowUpdated(row); diff --git a/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js b/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js index 454ef9549..f45f209f3 100644 --- a/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js +++ b/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js @@ -7,6 +7,8 @@ const ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR = 'inProgressLektor'; const ANRECHNUNGSTATUS_APPROVED = 'approved'; const ANRECHNUNGSTATUS_REJECTED = 'rejected'; +const COLOR_LIGHTGREY = "#f5f5f5"; + // TABULATOR FUNCTIONS // --------------------------------------------------------------------------------------------------------------------- // Returns relative height (depending on screen size) @@ -33,6 +35,18 @@ function func_tableBuilt(table) { ); } +// Formats the rows +function func_rowFormatter(row){ + let status_kurzbz = row.getData().status_kurzbz; + + row.getCells().forEach(function(cell){ + if (status_kurzbz != ANRECHNUNGSTATUS_PROGRESSED_BY_STGL) + { + row.getElement().style["background-color"] = COLOR_LIGHTGREY; // default + } + }); +} + // Formats row selectable/unselectable function func_selectableCheck(row){ let status_kurzbz = row.getData().status_kurzbz; @@ -46,8 +60,12 @@ function func_selectableCheck(row){ // Performes after row was updated function func_rowUpdated(row){ - row.deselect(); - row.getElement().style["pointerEvents"] = "none"; + // Refresh row formatters + row.reformat(); + + // Deselect and disable new selection of updated rows + row.deselect(); + row.getElement().style["pointerEvents"] = "none"; } // Formats empfehlung_anrechnung From fd5b68d3b8587fc43ef5a1d5bc5bb94c99858cd8 Mon Sep 17 00:00:00 2001 From: Cris Date: Thu, 21 Jan 2021 12:21:31 +0100 Subject: [PATCH 050/142] Set persistent layout and persistent sorting to STGL Anrechnungen Signed-off-by: cris-technikum --- .../views/lehre/anrechnung/approveAnrechnungUebersichtData.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php b/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php index 33a9ee2d0..9d0e42916 100644 --- a/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php +++ b/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php @@ -70,6 +70,8 @@ $filterWidgetArray = array( 'datasetRepOptions' => '{ height: func_height(this), layout: "fitColumns", // fit columns to width of table + persistentLayout:true, + persistentSort:true, autoResize: false, // prevent auto resizing of table (false to allow adapting table size when cols are (de-)activated headerFilterPlaceholder: " ", index: "anrechnung_id", // assign specific column as unique id (important for row indexing) From dc98b766c9ce5c27db14cb63df9f76178c9962ed Mon Sep 17 00:00:00 2001 From: Cris Date: Thu, 21 Jan 2021 12:50:07 +0100 Subject: [PATCH 051/142] Now filtering / formatting correctly the updated data ...by adding status_kurzbz to returning json object Signed-off-by: cris-technikum --- .../lehre/anrechnung/ApproveAnrechnungUebersicht.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php index 6fefa6d10..0f4354968 100644 --- a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php +++ b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php @@ -115,6 +115,7 @@ class approveAnrechnungUebersicht extends Auth_Controller { $json[]= array( 'anrechnung_id' => $item['anrechnung_id'], + 'status_kurzbz' => self::ANRECHNUNGSTATUS_APPROVED, 'status_bezeichnung' => $approved ); } @@ -157,6 +158,7 @@ class approveAnrechnungUebersicht extends Auth_Controller { $json[]= array( 'anrechnung_id' => $item['anrechnung_id'], + 'status_kurzbz' => self::ANRECHNUNGSTATUS_REJECTED, 'status_bezeichnung' => $rejected ); } @@ -199,6 +201,7 @@ class approveAnrechnungUebersicht extends Auth_Controller { $json[]= array( 'anrechnung_id' => $item['anrechnung_id'], + 'status_kurzbz' => self::ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR, 'status_bezeichnung' => $inProgressLektor ); } From 0528ae3eb9da6b9c8363abf0e78c1b93fb135518 Mon Sep 17 00:00:00 2001 From: Cris Date: Thu, 21 Jan 2021 13:39:31 +0100 Subject: [PATCH 052/142] Added uebernahmedatum and benotungsdatum to zeugnisnote Signed-off-by: cris-technikum --- application/libraries/AnrechnungLib.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/application/libraries/AnrechnungLib.php b/application/libraries/AnrechnungLib.php index e751621a6..d9510f354 100644 --- a/application/libraries/AnrechnungLib.php +++ b/application/libraries/AnrechnungLib.php @@ -208,6 +208,8 @@ class AnrechnungLib 'lehrveranstaltung_id' => $anrechnung->lehrveranstaltung_id, 'student_uid' => $anrechnung->student_uid, 'studiensemester_kurzbz' => $anrechnung->studiensemester_kurzbz, + 'uebernahmedatum' => (new DateTime())->format('Y-m-d H:m:i'), + 'benotungsdatum' => (new DateTime())->format('Y-m-d H:m:i'), 'note' => 6, 'insertvon' => $stgl_uid, 'bemerkung' => 'Digitale Anrechnung' From 0da2c6a74c7c7c3676424a2468f93d6dfc0d3527 Mon Sep 17 00:00:00 2001 From: Cris Date: Thu, 21 Jan 2021 14:41:46 +0100 Subject: [PATCH 053/142] Changed tabulator requiredPermissions for STGL Anrechnungen Signed-off-by: cris-technikum --- .../views/lehre/anrechnung/approveAnrechnungUebersichtData.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php b/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php index 9d0e42916..7fe5a62ee 100644 --- a/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php +++ b/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php @@ -48,7 +48,7 @@ $query = ' $filterWidgetArray = array( 'query' => $query, 'tableUniqueId' => 'approveAnrechnungUebersicht', - 'requiredPermissions' => 'admin', + 'requiredPermissions' => 'lehre/anrechnung_genehmigen', 'datasetRepresentation' => 'tabulator', 'columnsAliases' => array( 'anrechnung_id', From 1b00ae78b4e25c503b5b4046d4e5cde130be0ade Mon Sep 17 00:00:00 2001 From: Cris Date: Mon, 25 Jan 2021 15:32:51 +0100 Subject: [PATCH 054/142] Created Anrechnungen LektorInen: GUI, Controller, Tabledata, Phrases Signed-off-by: cris-technikum --- .../anrechnung/ReviewAnrechnungUebersicht.php | 198 +++++++++++++ application/libraries/AnrechnungLib.php | 107 ++++++- .../anrechnung/reviewAnrechnungUebersicht.php | 159 ++++++++++ .../reviewAnrechnungUebersichtData.php | 126 ++++++++ .../anrechnung/reviewAnrechnungUebersicht.js | 280 ++++++++++++++++++ system/phrasesupdate.php | 62 +++- 6 files changed, 930 insertions(+), 2 deletions(-) create mode 100644 application/controllers/lehre/anrechnung/ReviewAnrechnungUebersicht.php create mode 100644 application/views/lehre/anrechnung/reviewAnrechnungUebersicht.php create mode 100644 application/views/lehre/anrechnung/reviewAnrechnungUebersichtData.php create mode 100644 public/js/lehre/anrechnung/reviewAnrechnungUebersicht.js diff --git a/application/controllers/lehre/anrechnung/ReviewAnrechnungUebersicht.php b/application/controllers/lehre/anrechnung/ReviewAnrechnungUebersicht.php new file mode 100644 index 000000000..a5646d31e --- /dev/null +++ b/application/controllers/lehre/anrechnung/ReviewAnrechnungUebersicht.php @@ -0,0 +1,198 @@ + 'lehre/anrechnung_empfehlen:rw', + 'download' => 'lehre/anrechnung_empfehlen:rw', + 'recommend' => 'lehre/anrechnung_empfehlen:rw', + 'dontRecommend' => 'lehre/anrechnung_empfehlen:rw' + ) + ); + + // Load models + $this->load->model('education/Anrechnung_model', 'AnrechnungModel'); + $this->load->model('education/Anrechnungstatus_model', 'AnrechnungstatusModel'); + $this->load->model('content/DmsVersion_model', 'DmsVersionModel'); + $this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel'); + + // Load libraries + $this->load->library('WidgetLib'); + $this->load->library('PermissionLib'); + $this->load->library('AnrechnungLib'); + $this->load->library('DmsLib'); + + // Load helpers + $this->load->helper('form'); + $this->load->helper('url'); + $this->load->helper('hlp_sancho_helper'); + + // Load language phrases + $this->loadPhrases( + array( + 'global', + 'ui', + 'anrechnung', + 'person', + 'lehre', + 'table' + ) + ); + + $this->_setAuthUID(); + + $this->setControllerId(); + } + + public function index() + { + $studiensemester_kurzbz = $this->input->get('studiensemester'); + + if (!is_string($studiensemester_kurzbz)) + { + $studiensemester = $this->StudiensemesterModel->getNearest(); + if (hasData($studiensemester)) + { + $studiensemester_kurzbz = $studiensemester->retval[0]->studiensemester_kurzbz; + } + elseif (isError($studiensemester)) + { + show_error(getError($studiensemester)); + } + } + + $viewData = array( + 'studiensemester_selected' => $studiensemester_kurzbz + ); + + $this->load->view('lehre/anrechnung/reviewAnrechnungUebersicht.php', $viewData); + } + + /** + * Recommend Anrechnungen. + */ + public function recommend() + { + $data = $this->input->post('data'); + + if(isEmptyArray($data)) + { + return $this->outputJsonError('Fehler beim Übertragen der Daten.'); + } + + // Get statusbezeichnung for 'inProgressDP' + $this->AnrechnungstatusModel->addSelect('bezeichnung_mehrsprachig'); + $inProgressDP = getData($this->AnrechnungstatusModel->load('inProgressDP'))[0]; + $inProgressDP = getUserLanguage() == 'German' + ? $inProgressDP->bezeichnung_mehrsprachig[0] + : $inProgressDP->bezeichnung_mehrsprachig[1]; + + foreach ($data as $item) + { + // Approve Anrechnung + if(getData($this->anrechnunglib->recommendAnrechnung($item['anrechnung_id']))) + { + $json[]= array( + 'anrechnung_id' => $item['anrechnung_id'], + 'empfehlung_anrechnung' => 'true', + 'status_kurzbz' => self::ANRECHNUNGSTATUS_PROGRESSED_BY_STGL, + 'status_bezeichnung' => $inProgressDP + ); + } + } + + // Output json to ajax + if (isset($json) && !isEmptyArray($json)) + { + return $this->outputJsonSuccess($json); + } + else + { + return $this->outputJsonError('Empfehlungen wurden nicht durchgeführt'); + } + } + + /** + * Dont recommend Anrechnungen. + */ + public function dontRecommend() + { + $data = $this->input->post('data'); + + if(isEmptyArray($data)) + { + return $this->outputJsonError('Fehler beim Übertragen der Daten.'); + } + + // Get statusbezeichnung for 'inProgressDP' + $this->AnrechnungstatusModel->addSelect('bezeichnung_mehrsprachig'); + $inProgressDP = getData($this->AnrechnungstatusModel->load('inProgressDP'))[0]; + $inProgressDP = getUserLanguage() == 'German' + ? $inProgressDP->bezeichnung_mehrsprachig[0] + : $inProgressDP->bezeichnung_mehrsprachig[1]; + + foreach ($data as $item) + { + // Approve Anrechnung + if(getData($this->anrechnunglib->dontRecommendAnrechnung($item['anrechnung_id']))) + { + $json[]= array( + 'anrechnung_id' => $item['anrechnung_id'], + 'empfehlung_anrechnung' => 'false', + 'status_kurzbz' => self::ANRECHNUNGSTATUS_PROGRESSED_BY_STGL, + 'status_bezeichnung' => $inProgressDP + ); + } + } + + // Output json to ajax + if (isset($json) && !isEmptyArray($json)) + { + return $this->outputJsonSuccess($json); + } + else + { + return $this->outputJsonError('Empfehlungen wurden nicht durchgeführt'); + } + } + + /** + * Download and open uploaded document (Nachweisdokument). + */ + public function download() + { + $dms_id = $this->input->get('dms_id'); + + if (!is_numeric($dms_id)) + { + show_error('Wrong parameter'); + } + + $this->dmslib->download($dms_id); + } + + + /** + * Retrieve the UID of the logged user and checks if it is valid + */ + private function _setAuthUID() + { + $this->_uid = getAuthUID(); + + if (!$this->_uid) show_error('User authentification failed'); + } +} \ No newline at end of file diff --git a/application/libraries/AnrechnungLib.php b/application/libraries/AnrechnungLib.php index d9510f354..907116563 100644 --- a/application/libraries/AnrechnungLib.php +++ b/application/libraries/AnrechnungLib.php @@ -146,6 +146,7 @@ class AnrechnungLib } /** + * Get last Anrechnungstatusbezeichnung in users language. * @param $anrechnung_id * @return mixed */ @@ -244,7 +245,7 @@ class AnrechnungLib $status_kurzbz = $result->status_kurzbz; // Exit if already approved or rejected - if ($status_kurzbz == self::ANRECHNUNGSTATUS_APPROVED || $status_kurzbz == self::ANRECHNUNGSTATUS_REJECTED) // TODO: in js: bereits genehmigte nicht clickable! + if ($status_kurzbz == self::ANRECHNUNGSTATUS_APPROVED || $status_kurzbz == self::ANRECHNUNGSTATUS_REJECTED) { return success(false); // dont reject } @@ -294,6 +295,110 @@ class AnrechnungLib return success(true); // rejected } + /** + * Recommend Anrechnung. + * @param $anrechnung_id + * @return array + * @throws Exception + */ + public function recommendAnrechnung($anrechnung_id) + { + // Check last Anrechnungstatus + if (!$result = getData($this->ci->AnrechnungModel->getLastAnrechnungstatus($anrechnung_id))[0]) + { + show_error(getError($result)); + } + + $status_kurzbz = $result->status_kurzbz; + + // Exit if already approved or rejected + if ($status_kurzbz == self::ANRECHNUNGSTATUS_APPROVED || $status_kurzbz == self::ANRECHNUNGSTATUS_REJECTED) + { + return success(false); // dont approve + } + + // Start DB transaction + $this->ci->db->trans_start(false); + + $lektor_uid = getAuthUID(); + + // Insert new status progessed by stgl + $this->ci->AnrechnungModel->saveAnrechnungstatus($anrechnung_id, self::ANRECHNUNGSTATUS_PROGRESSED_BY_STGL); + + // Update empfehlung_anrechnung + $this->ci->AnrechnungModel->update( + $anrechnung_id, + array( + 'empfehlung_anrechnung' => true, + 'updateamum' => (new DateTime())->format('Y-m-d H:m:i'), + 'updatevon' => $lektor_uid + ) + ); + + // Transaction complete + $this->ci->db->trans_complete(); + + if ($this->ci->db->trans_status() === false) + { + $this->ci->db->trans_rollback(); + return error($result->msg, EXIT_ERROR); + } + + return success(true); // recommended + } + + /** + * Do not recommend Anrechnung. + * @param $anrechnung_id + * @return array + * @throws Exception + */ + public function dontRecommendAnrechnung($anrechnung_id) + { + // Check last Anrechnungstatus + if (!$result = getData($this->ci->AnrechnungModel->getLastAnrechnungstatus($anrechnung_id))[0]) + { + show_error(getError($result)); + } + + $status_kurzbz = $result->status_kurzbz; + + // Exit if already approved or rejected + if ($status_kurzbz == self::ANRECHNUNGSTATUS_APPROVED || $status_kurzbz == self::ANRECHNUNGSTATUS_REJECTED) + { + return success(false); // dont approve + } + + // Start DB transaction + $this->ci->db->trans_start(false); + + $lektor_uid = getAuthUID(); + + // Insert new status progessed by stgl + $this->ci->AnrechnungModel->saveAnrechnungstatus($anrechnung_id, self::ANRECHNUNGSTATUS_PROGRESSED_BY_STGL); + + // Update empfehlung_anrechnung + $this->ci->AnrechnungModel->update( + $anrechnung_id, + array( + 'empfehlung_anrechnung' => false, + 'updateamum' => (new DateTime())->format('Y-m-d H:m:i'), + 'updatevon' => $lektor_uid + ) + ); + + // Transaction complete + $this->ci->db->trans_complete(); + + if ($this->ci->db->trans_status() === false) + { + $this->ci->db->trans_rollback(); + return error($result->msg, EXIT_ERROR); + } + + return success(true); // recommended + } + private function _setAnrechnungDataObject($anrechnung) { $anrechnung_data = new StdClass(); diff --git a/application/views/lehre/anrechnung/reviewAnrechnungUebersicht.php b/application/views/lehre/anrechnung/reviewAnrechnungUebersicht.php new file mode 100644 index 000000000..b9552c991 --- /dev/null +++ b/application/views/lehre/anrechnung/reviewAnrechnungUebersicht.php @@ -0,0 +1,159 @@ +load->view( + 'templates/FHC-Header', + array( + 'title' => $this->p->t('anrechnung', 'anrechnungenPruefen'), + 'jquery' => true, + 'jqueryui' => true, + 'bootstrap' => true, + 'fontawesome' => true, + 'tabulator' => true, + 'ajaxlib' => true, + 'dialoglib' => true, + 'tablewidget' => true, + 'phrases' => array( + 'global' => array( + 'begruendung' + ), + 'anrechnung' => array( + 'nachweisdokumente', + 'empfehlung' + ), + 'ui' => array( + 'anzeigen', + 'alleAnzeigen', + 'hilfeZuDieserSeite', + 'hochladen', + 'spaltenEinstellen', + 'hilfeZuDieserSeite', + 'alleAuswaehlen', + 'alleAbwaehlen', + 'ausgewaehlteZeilen', + 'hilfe', + 'tabelleneinstellungen', + 'keineDatenVorhanden', + 'spaltenEinstellen', + 'ja', + 'nein' + ), + 'person' => array( + 'student', + 'personenkennzeichen', + 'vorname', + 'nachname' + ), + 'lehre' => array( + 'studiensemester', + 'studiengang', + 'lehrveranstaltung', + 'ects', + 'lektor', + ), + 'table' => array( + 'spaltenEinAusblenden', + 'spaltenEinAusblendenMitKlickOeffnen', + 'spaltenEinAusblendenAufEinstellungenKlicken', + 'spaltenEinAusblendenMitKlickAktivieren', + 'spaltenEinAusblendenMitKlickSchliessen', + 'spaltenbreiteVeraendern', + 'spaltenbreiteVeraendernText', + 'spaltenbreiteVeraendernInfotext', + 'zeilenAuswaehlen', + 'zeilenAuswaehlenEinzeln', + 'zeilenAuswaehlenBereich', + 'zeilenAuswaehlenAlle' + ) + ), + 'customJSs' => array( + 'public/js/bootstrapper.js', + 'public/js/lehre/anrechnung/reviewAnrechnungUebersicht.js' + ) + ) +); +?> + + +
    +
    + +
    + +
    + +
    +
    +
    +
    + widgetlib->widget( + 'Studiensemester_widget', + array( + DropdownWidget::SELECTED_ELEMENT => $studiensemester_selected + ), + array( + 'name' => 'studiensemester', + 'id' => 'studiensemester' + ) + ); + ?> +
    + +
    +
    +
    + +
    +
    + load->view('lehre/anrechnung/reviewAnrechnungUebersichtData.php'); ?> +
    +
    + +
    + + +
    + +
    + + +
    +
    + + +
    +
    +
    +
    +
    + + +load->view('templates/FHC-Footer'); ?> + diff --git a/application/views/lehre/anrechnung/reviewAnrechnungUebersichtData.php b/application/views/lehre/anrechnung/reviewAnrechnungUebersichtData.php new file mode 100644 index 000000000..39f3e4561 --- /dev/null +++ b/application/views/lehre/anrechnung/reviewAnrechnungUebersichtData.php @@ -0,0 +1,126 @@ +>' . $LANGUAGE_INDEX . ' AS "status_bezeichnung" + FROM anrechnungen + JOIN lehre.tbl_anrechnungstatus as anrechnungstatus ON (anrechnungstatus.status_kurzbz = anrechnungen.status_kurzbz) + JOIN lehre.tbl_lehreinheit le USING (lehrveranstaltung_id) + JOIN lehre.tbl_lehreinheitmitarbeiter lema USING (lehreinheit_id) + WHERE anrechnungen.studiensemester_kurzbz = \'' . $STUDIENSEMESTER . '\' + AND le.studiensemester_kurzbz = anrechnungen.studiensemester_kurzbz + AND lema.mitarbeiter_uid = \'' . $LEKTOR_UID . '\' + AND le.lehre = TRUE +'; + +$filterWidgetArray = array( + 'query' => $query, + 'tableUniqueId' => 'approveAnrechnungUebersicht', + 'requiredPermissions' => 'lehre/anrechnung_empfehlen', + 'datasetRepresentation' => 'tabulator', + 'columnsAliases' => array( + 'anrechnung_id', + 'lehrveranstaltung_id', + 'begruendung_id', + 'dms_id', + 'studiensemester_kurzbz', + 'studiengang_kz', + ucfirst($this->p->t('lehre', 'studiengang')), + ucfirst($this->p->t('lehre', 'lehrveranstaltung')), + 'ECTS', + ucfirst($this->p->t('person', 'studentIn')), + ucfirst($this->p->t('global', 'begruendung')), + ucfirst($this->p->t('anrechnung', 'nachweisdokumente')), + ucfirst($this->p->t('anrechnung', 'empfehlung')), + 'status_kurzbz', + 'Status' + ), + 'datasetRepOptions' => '{ + height: func_height(this), + layout: "fitColumns", // fit columns to width of table + persistentLayout:true, + persistentSort:true, + autoResize: false, // prevent auto resizing of table (false to allow adapting table size when cols are (de-)activated + headerFilterPlaceholder: " ", + index: "anrechnung_id", // assign specific column as unique id (important for row indexing) + selectable: true, // allow row selection + selectableRangeMode: "click", // allow range selection using shift end click on end of range + selectablePersistence:false, // deselect previously selected rows when table is filtered, sorted or paginated + tableBuilt: function(){ + func_tableBuilt(this); + }, + tableWidgetFooter: { + selectButtons: true + }, + selectableCheck: function(row){ + return func_selectableCheck(row); + }, + rowFormatter:function(row){ + func_rowFormatter(row); + }, + rowUpdated:function(row){ + func_rowUpdated(row); + } + }', // tabulator properties + 'datasetRepFieldsDefs' => '{ + anrechnung_id: {visible: false}, + lehrveranstaltung_id: {visible: false}, + begruendung_id: {visible: false}, + dms_id: {visible: false}, + studiensemester_kurzbz: {visible: false}, + studiengang_kz: {visible: false}, + stg_bezeichnung: {headerFilter:"input"}, + lv_bezeichnung: {headerFilter:"input"}, + ects: {headerFilter:"input"}, + student: {headerFilter:"input"}, + begruendung: {headerFilter:"input"}, + dokument_bezeichnung: {headerFilter:"input", formatter:"link", formatterParams:{ + labelField:"dokument_bezeichnung", + url:function(cell){return "'. current_url() .'/download?dms_id=" + cell.getData().dms_id}, + target:"_blank" + }}, + empfehlung_anrechnung: {headerFilter:"input", align:"center", formatter: format_empfehlung_anrechnung}, + status_kurzbz: {visible: false}, + status_bezeichnung: {headerFilter:"input"} + }', // col properties +); + +echo $this->widgetlib->widget('TableWidget', $filterWidgetArray); + +?> \ No newline at end of file diff --git a/public/js/lehre/anrechnung/reviewAnrechnungUebersicht.js b/public/js/lehre/anrechnung/reviewAnrechnungUebersicht.js new file mode 100644 index 000000000..8d038e557 --- /dev/null +++ b/public/js/lehre/anrechnung/reviewAnrechnungUebersicht.js @@ -0,0 +1,280 @@ +const BASE_URL = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router; +const APPROVE_ANRECHNUNG_DETAIL_URI = "lehre/anrechnung/ReviewAnrechnungDetail"; + +const ANRECHNUNGSTATUS_PROGRESSED_BY_STGL = 'inProgressDP'; +const ANRECHNUNGSTATUS_PROGRESSED_BY_KF = 'inProgressKF'; +const ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR = 'inProgressLektor'; +const ANRECHNUNGSTATUS_APPROVED = 'approved'; +const ANRECHNUNGSTATUS_REJECTED = 'rejected'; + +const COLOR_LIGHTGREY = "#f5f5f5"; + +// TABULATOR FUNCTIONS +// --------------------------------------------------------------------------------------------------------------------- +// Returns relative height (depending on screen size) +function func_height(table){ + return $(window).height() * 0.50; +} + +// Adds column details +function func_tableBuilt(table) { + table.addColumn( + { + title: "Details", + align: "center", + width: 100, + formatter: "link", + formatterParams:{ + label:"Details", + url:function(cell){ + return BASE_URL + "/" + APPROVE_ANRECHNUNG_DETAIL_URI + "?anrechnung_id=" + cell.getData().anrechnung_id + }, + target:"_blank" + } + }, false, "status" // place column after status + ); +} + +// Formats the rows +function func_rowFormatter(row){ + let status_kurzbz = row.getData().status_kurzbz; + + row.getCells().forEach(function(cell){ + if (status_kurzbz != ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR) + { + row.getElement().style["background-color"] = COLOR_LIGHTGREY; // default + } + }); +} + +// Formats row selectable/unselectable +function func_selectableCheck(row){ + let status_kurzbz = row.getData().status_kurzbz; + + return ( + status_kurzbz == ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR + ); +} + +// Performes after row was updated +function func_rowUpdated(row){ + // Refresh row formatters + row.reformat(); + + // Deselect and disable new selection of updated rows + row.deselect(); + row.getElement().style["pointerEvents"] = "none"; +} + +// Formats empfehlung_anrechnung +var format_empfehlung_anrechnung = function(cell, formatterParams){ + return (cell.getValue() == null) + ? '-' + : (cell.getValue() == 'true') + ? FHC_PhrasesLib.t("ui", "ja") + : FHC_PhrasesLib.t("ui", "nein"); +} + +/* + * Hook to overwrite TableWigdgets select-all-button behaviour + * Select all (filtered) rows that are progressed by stg leiter. + * (Ignore rows that are approved, rejected or in request for recommendation) + */ +function tableWidgetHook_selectAllButton(tableWidgetDiv){ + tableWidgetDiv.find("#tableWidgetTabulator").tabulator('getRows', true) + .filter(row => + row.getData().status_kurzbz == ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR + ) + .forEach((row => row.select())); +} + + +$(function(){ + // Pruefen ob Promise unterstuetzt wird + // Tabulator funktioniert nicht mit IE + var canPromise = !! window.Promise; + if(!canPromise) + { + alert("Diese Seite kann mit ihrem Browser nicht angezeigt werden. Bitte verwenden Sie Firefox, Chrome oder Edge um die Seite anzuzeigen"); + window.location.href='about:blank'; + return; + } + + // Redraw table on resize to fit tabulators height to windows height + window.addEventListener('resize', function(){ + $('#tableWidgetTabulator').tabulator('setHeight', $(window).height() * 0.50); + $('#tableWidgetTabulator').tabulator('redraw', true); + }); + + // Show only rows with anrechnungen ohne Empfehlung + $("#show-need-recommendation").click(function(){ + $('#tableWidgetTabulator').tabulator('setFilter', + [ + {field: 'status_kurzbz', type: '=', value: ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR} + ] + ); + }); + + // Show only rows with empfohlene + noch nicht genehmigte/abgelehnte anrechnungen + $("#show-recommended").click(function(){ + $('#tableWidgetTabulator').tabulator('setFilter', + [ + {field: 'status_kurzbz', type: '=', value: ANRECHNUNGSTATUS_PROGRESSED_BY_STGL}, + {field: 'empfehlung_anrechnung', type: '=', value: 'true'} + ] + ); + }); + + // Show only rows with nicht empfohlene + noch nicht genehmigte/abgelehnte anrechnungen + $("#show-not-recommended").click(function(){ + $('#tableWidgetTabulator').tabulator('setFilter', [ + {field: 'status_kurzbz', type: '=', value: ANRECHNUNGSTATUS_PROGRESSED_BY_STGL}, + {field: 'empfehlung_anrechnung', type: '=', value: 'false'}, + ] + ); + }); + + // Show only rows with genehmigte anrechnungen + $("#show-approved").click(function(){ + $('#tableWidgetTabulator').tabulator('setFilter', + [ + {field: 'status_kurzbz', type: '=', value: ANRECHNUNGSTATUS_APPROVED} + ] + ); + }); + + // Show only rows with abgelehnte anrechnungen + $("#show-rejected").click(function(){ + $('#tableWidgetTabulator').tabulator('setFilter', + [ + {field: 'status_kurzbz', type: '=', value: ANRECHNUNGSTATUS_REJECTED} + ] + ); + }); + + /** + * Show all rows: clear filter and blur button + * Bootstrap button remains in activated style, even when clicking various times. + * This function "resets" button style and clear all tabulators filter. + * NOTE: MUST be after all other filters + */ + $(".btn-clearfilter").click(function(){ + if($(this).hasClass('active')) + { + $('#tableWidgetTabulator').tabulator('clearFilter'); + $(this).blur(); + } + }) + + // Recommend Anrechnungen + $("#recommend-anrechnungen").click(function(){ + // Get selected rows data + let selected_data = $('#tableWidgetTabulator').tabulator('getSelectedData') + .map(function(data){ + // reduce to necessary fields + return { + 'anrechnung_id' : data.anrechnung_id, + } + }); + + // Alert and exit if no anrechnung is selected + if (selected_data.length == 0) + { + FHC_DialogLib.alertInfo('Bitte wählen Sie erst zumindest einen Antrag auf Anrechnung'); + return; + } + + + // Prepare data object for ajax call + let data = { + 'data': selected_data + }; + + FHC_AjaxClient.ajaxCallPost( + FHC_JS_DATA_STORAGE_OBJECT.called_path + "/recommend", + data, + { + successCallback: function (data, textStatus, jqXHR) + { + if (data.error && data.retval != null) + { + // Print error message + FHC_DialogLib.alertWarning(data.retval); + } + + if (!data.error && data.retval != null) + { + // Update status 'genehmigt' + $('#tableWidgetTabulator').tabulator('updateData', data.retval); + + // Print success message + FHC_DialogLib.alertSuccess(data.retval.length + " Anrechnungsanträge wurden empfohlen."); + } + }, + errorCallback: function (jqXHR, textStatus, errorThrown) + { + FHC_DialogLib.alertError("Systemfehler
    Bitte kontaktieren Sie Ihren Administrator."); + } + } + ); + }); + + // Dont recommend Anrechnungen + $("#dont-recommend-anrechnungen").click(function(){ + // Get selected rows data + let selected_data = $('#tableWidgetTabulator').tabulator('getSelectedData') + .map(function(data){ + // reduce to necessary fields + return { + 'anrechnung_id' : data.anrechnung_id, + } + }); + + // Alert and exit if no anrechnung is selected + if (selected_data.length == 0) + { + FHC_DialogLib.alertInfo('Bitte wählen Sie erst zumindest einen Antrag auf Anrechnung'); + return; + } + + // Confirm before rejecting + if(!confirm('Wollen Sie wirklich für die gewählten Anträge keine Empfehlung abgeben?')) + { + return; + } + + // Prepare data object for ajax call + let data = { + 'data': selected_data + }; + + FHC_AjaxClient.ajaxCallPost( + FHC_JS_DATA_STORAGE_OBJECT.called_path + "/dontRecommend", + data, + { + successCallback: function (data, textStatus, jqXHR) + { + if (data.error && data.retval != null) + { + // Print error message + FHC_DialogLib.alertWarning(data.retval); + } + + if (!data.error && data.retval != null) + { + // Update status 'genehmigt' + $('#tableWidgetTabulator').tabulator('updateData', data.retval); + + // Print success message + FHC_DialogLib.alertSuccess(data.retval.length + " Anrechnungsanträge wurden nicht empfohlen."); + } + }, + errorCallback: function (jqXHR, textStatus, errorThrown) + { + FHC_DialogLib.alertError("Systemfehler
    Bitte kontaktieren Sie Ihren Administrator."); + } + } + ); + }); + +}); \ No newline at end of file diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index f8f7c9eaf..229d23965 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -8557,7 +8557,7 @@ Any unusual occurrences 'phrases' => array( array( 'sprache' => 'German', - 'text' => 'Nur jene anzeigen, wo eine Empfehlung noch ansteht', + 'text' => 'Nur jene anzeigen, wo eine Empfehlung noch fehlt', 'description' => '', 'insertvon' => 'system' ), @@ -8608,6 +8608,66 @@ Any unusual occurrences 'insertvon' => 'system' ) ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'anrechnungenPruefen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Anrechnungen prüfen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Review applications', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'empfehlen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Empfehlen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Recommend', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'nichtEmpfehlen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Nicht empfehlen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Do not recommend', + 'description' => '', + 'insertvon' => 'system' + ) + ) ) ); From aefd0842db699d9351716decd80aca9e30a5b9d9 Mon Sep 17 00:00:00 2001 From: Cris Date: Mon, 25 Jan 2021 18:18:13 +0100 Subject: [PATCH 055/142] Added tooltip for unselectable Anrechnungen Signed-off-by: cris-technikum --- .../approveAnrechnungUebersicht.php | 3 ++- .../approveAnrechnungUebersichtData.php | 3 +++ .../anrechnung/reviewAnrechnungUebersicht.php | 3 ++- .../reviewAnrechnungUebersichtData.php | 3 +++ .../anrechnung/approveAnrechnungUebersicht.js | 8 ++++++++ .../anrechnung/reviewAnrechnungUebersicht.js | 8 ++++++++ system/phrasesupdate.php | 20 +++++++++++++++++++ 7 files changed, 46 insertions(+), 2 deletions(-) diff --git a/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php b/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php index f25a07c85..5771ff7dd 100644 --- a/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php +++ b/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php @@ -34,7 +34,8 @@ $this->load->view( 'keineDatenVorhanden', 'spaltenEinstellen', 'ja', - 'nein' + 'nein', + 'nichtSelektierbarAufgrundVon' ), 'person' => array( 'student', diff --git a/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php b/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php index 7fe5a62ee..86e946d0b 100644 --- a/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php +++ b/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php @@ -93,6 +93,9 @@ $filterWidgetArray = array( rowUpdated:function(row){ func_rowUpdated(row); }, + tooltips: function(cell){ + return func_tooltips(cell); + } }', // tabulator properties 'datasetRepFieldsDefs' => '{ anrechnung_id: {visible: false}, diff --git a/application/views/lehre/anrechnung/reviewAnrechnungUebersicht.php b/application/views/lehre/anrechnung/reviewAnrechnungUebersicht.php index b9552c991..90ae426e9 100644 --- a/application/views/lehre/anrechnung/reviewAnrechnungUebersicht.php +++ b/application/views/lehre/anrechnung/reviewAnrechnungUebersicht.php @@ -34,7 +34,8 @@ $this->load->view( 'keineDatenVorhanden', 'spaltenEinstellen', 'ja', - 'nein' + 'nein', + 'nichtSelektierbarAufgrundVon' ), 'person' => array( 'student', diff --git a/application/views/lehre/anrechnung/reviewAnrechnungUebersichtData.php b/application/views/lehre/anrechnung/reviewAnrechnungUebersichtData.php index 39f3e4561..2627bebaf 100644 --- a/application/views/lehre/anrechnung/reviewAnrechnungUebersichtData.php +++ b/application/views/lehre/anrechnung/reviewAnrechnungUebersichtData.php @@ -96,6 +96,9 @@ $filterWidgetArray = array( }, rowUpdated:function(row){ func_rowUpdated(row); + }, + tooltips: function(cell){ + return func_tooltips(cell); } }', // tabulator properties 'datasetRepFieldsDefs' => '{ diff --git a/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js b/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js index f45f209f3..861704b75 100644 --- a/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js +++ b/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js @@ -68,6 +68,14 @@ function func_rowUpdated(row){ row.getElement().style["pointerEvents"] = "none"; } +// Returns tooltip +function func_tooltips(cell) { + // Return tooltip if row is unselectable + if (!func_selectableCheck(cell.getRow())){ + return FHC_PhrasesLib.t("ui", "nichtSelektierbarAufgrundVon") + 'Status'; + } +} + // Formats empfehlung_anrechnung var format_empfehlung_anrechnung = function(cell, formatterParams){ return (cell.getValue() == null) diff --git a/public/js/lehre/anrechnung/reviewAnrechnungUebersicht.js b/public/js/lehre/anrechnung/reviewAnrechnungUebersicht.js index 8d038e557..fb2c45ac0 100644 --- a/public/js/lehre/anrechnung/reviewAnrechnungUebersicht.js +++ b/public/js/lehre/anrechnung/reviewAnrechnungUebersicht.js @@ -66,6 +66,14 @@ function func_rowUpdated(row){ row.getElement().style["pointerEvents"] = "none"; } +// Returns tooltip +function func_tooltips(cell) { + // Return tooltip if row is unselectable + if (!func_selectableCheck(cell.getRow())){ + return FHC_PhrasesLib.t("ui", "nichtSelektierbarAufgrundVon") + 'Status'; + } +} + // Formats empfehlung_anrechnung var format_empfehlung_anrechnung = function(cell, formatterParams){ return (cell.getValue() == null) diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 229d23965..9b9effd95 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -8668,6 +8668,26 @@ Any unusual occurrences 'insertvon' => 'system' ) ) + ), + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'nichtSelektierbarAufgrundVon', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Nicht selektierbar aufgrund von: ', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Not selectable because of: ', + 'description' => '', + 'insertvon' => 'system' + ) + ) ) ); From 5b77a5d08f4953010752c8b00e2d823499b0b5f0 Mon Sep 17 00:00:00 2001 From: Cris Date: Mon, 25 Jan 2021 18:23:59 +0100 Subject: [PATCH 056/142] Restricted to upload only pdf files Signed-off-by: cris-technikum --- application/controllers/lehre/anrechnung/RequestAnrechnung.php | 2 +- application/views/lehre/anrechnung/requestAnrechnung.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/application/controllers/lehre/anrechnung/RequestAnrechnung.php b/application/controllers/lehre/anrechnung/RequestAnrechnung.php index ed09b131a..6656c94f6 100644 --- a/application/controllers/lehre/anrechnung/RequestAnrechnung.php +++ b/application/controllers/lehre/anrechnung/RequestAnrechnung.php @@ -129,7 +129,7 @@ class requestAnrechnung extends Auth_Controller 'insertvon' => $this->_uid ); - if(isError($uploaddata = $this->dmslib->upload($dms, array('jpg', 'pdf')))) + if(isError($uploaddata = $this->dmslib->upload($dms, array('pdf')))) { show_error(getError($uploaddata)); } diff --git a/application/views/lehre/anrechnung/requestAnrechnung.php b/application/views/lehre/anrechnung/requestAnrechnung.php index 0c59f73e2..364fdaafd 100644 --- a/application/views/lehre/anrechnung/requestAnrechnung.php +++ b/application/views/lehre/anrechnung/requestAnrechnung.php @@ -142,7 +142,7 @@ $this->load->view(
    - > + >
    dms_id)): ?> dokumentname ?> From 7d0ff4fceedcb66311a60258628f79bff440ee9d Mon Sep 17 00:00:00 2001 From: Cris Date: Tue, 26 Jan 2021 10:58:26 +0100 Subject: [PATCH 057/142] Added check, when STGL tries to request recommendation for already recommended Antraege Signed-off-by: cris-technikum --- .../ApproveAnrechnungUebersicht.php | 3 ++- application/libraries/AnrechnungLib.php | 27 ++++++++++++++++--- .../approveAnrechnungUebersicht.php | 3 ++- .../anrechnung/approveAnrechnungUebersicht.js | 25 ++++++++++++----- system/phrasesupdate.php | 20 ++++++++++++++ 5 files changed, 66 insertions(+), 12 deletions(-) diff --git a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php index 0f4354968..c7116baf8 100644 --- a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php +++ b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php @@ -202,7 +202,8 @@ class approveAnrechnungUebersicht extends Auth_Controller $json[]= array( 'anrechnung_id' => $item['anrechnung_id'], 'status_kurzbz' => self::ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR, - 'status_bezeichnung' => $inProgressLektor + 'status_bezeichnung' => $inProgressLektor, + 'empfehlung_anrechnung' => null ); } } diff --git a/application/libraries/AnrechnungLib.php b/application/libraries/AnrechnungLib.php index 907116563..c77d49c93 100644 --- a/application/libraries/AnrechnungLib.php +++ b/application/libraries/AnrechnungLib.php @@ -284,15 +284,36 @@ class AnrechnungLib return success(false); // dont ask for recommendation } + // Start DB transaction + $this->ci->db->trans_start(false); + // Insert new status inProgressLektor $result = $this->ci->AnrechnungModel->saveAnrechnungstatus($anrechnung_id, self::ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR); - if (isError($result)) + /** + * Anyway update empfehlung_anrechnung to be null + * Regardless of what empfehlung_anrechnung was already set (true/false/null), it should be (reset to ) null by + * requesting a (new) recommendation. + * **/ + $this->ci->AnrechnungModel->update( + $anrechnung_id, + array( + 'empfehlung_anrechnung' => null, + 'updateamum' => (new DateTime())->format('Y-m-d H:m:i'), + 'updatevon' => getAuthUID() + ) + ); + + // Transaction complete + $this->ci->db->trans_complete(); + + if ($this->ci->db->trans_status() === false) { - show_error(getError($result)); + $this->ci->db->trans_rollback(); + return error($result->msg, EXIT_ERROR); } - return success(true); // rejected + return success(true); // recommended } /** diff --git a/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php b/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php index 5771ff7dd..26a9291a6 100644 --- a/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php +++ b/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php @@ -17,7 +17,8 @@ $this->load->view( ), 'anrechnung' => array( 'nachweisdokumente', - 'empfehlung' + 'empfehlung', + 'confirmTextAntragHatBereitsEmpfehlung' ), 'ui' => array( 'anzeigen', diff --git a/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js b/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js index 861704b75..d8d73b0e4 100644 --- a/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js +++ b/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js @@ -281,13 +281,24 @@ $(function(){ // Request Recommendation for Anrechnungen $("#request-recommendation").click(function(){ // Get selected rows data - let selected_data = $('#tableWidgetTabulator').tabulator('getSelectedData') - .map(function(data){ - // reduce to necessary fields - return { - 'anrechnung_id' : data.anrechnung_id, - } - }); + let selected_data = $('#tableWidgetTabulator').tabulator('getSelectedData'); + + // If some of selected anrechnungen has already been recommended... + if (selected_data.some((data) => data.empfehlung_anrechnung !== null)) + { + // ...confirm before requesting recommendation + if(!confirm(FHC_PhrasesLib.t("anrechnung", "confirmTextAntragHatBereitsEmpfehlung"))) + { + return; + } + } + + selected_data.map(function(data){ + // reduce to necessary fields + return { + 'anrechnung_id' : data.anrechnung_id, + } + }); // Alert and exit if no anrechnung is selected if (selected_data.length == 0) diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 9b9effd95..57306ef62 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -8688,6 +8688,26 @@ Any unusual occurrences 'insertvon' => 'system' ) ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'confirmTextAntragHatBereitsEmpfehlung', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Mindestens 1 Antrag enthält bereits eine Empfehlung.\nWollen Sie wirklich für Ihre Auswahl eine Empfehlung anfordern und bereits vorhandene Empfehlungen dabei zurücksetzen?", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "At least one application was already recommended.\nDo you really want to request for recommendation for your selection?", + 'description' => '', + 'insertvon' => 'system' + ) + ) ) ); From 3f3d7aa7d71e3e18defb830fd55d509547a14169 Mon Sep 17 00:00:00 2001 From: Cris Date: Tue, 26 Jan 2021 13:57:57 +0100 Subject: [PATCH 058/142] Changed lektors status text to 'Empfehlung angefordert' ...to make status in process more understandable. Signed-off-by: cris-technikum --- system/dbupdate_3.3.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/dbupdate_3.3.php b/system/dbupdate_3.3.php index 77e925ac3..d5f487ed1 100644 --- a/system/dbupdate_3.3.php +++ b/system/dbupdate_3.3.php @@ -4555,7 +4555,7 @@ if(!$result = @$db->db_query("SELECT 1 FROM lehre.tbl_anrechnungstatus LIMIT 1;" INSERT INTO lehre.tbl_anrechnungstatus(status_kurzbz, bezeichnung_mehrsprachig) VALUES('inProgressDP', '{\"bearbeitet von STG-Leitung\",\"processed by STG-Director\"}'); INSERT INTO lehre.tbl_anrechnungstatus(status_kurzbz, bezeichnung_mehrsprachig) VALUES('inProgressKF', '{\"bearbeitet von KF-Leitung\",\"processed by KF-Manager\"}'); - INSERT INTO lehre.tbl_anrechnungstatus(status_kurzbz, bezeichnung_mehrsprachig) VALUES('inProgressLektor', '{\"bearbeitet von LektorIn\",\"processed by lector\"}'); + INSERT INTO lehre.tbl_anrechnungstatus(status_kurzbz, bezeichnung_mehrsprachig) VALUES('inProgressLektor', '{\"Empfehlung angefordert\",\"recommendation requested\"}'); INSERT INTO lehre.tbl_anrechnungstatus(status_kurzbz, bezeichnung_mehrsprachig) VALUES('approved', '{\"genehmigt\",\"approved\"}'); INSERT INTO lehre.tbl_anrechnungstatus(status_kurzbz, bezeichnung_mehrsprachig) VALUES('rejected', '{\"abgelehnt\",\"rejected\"}'); From e06a6768a45e535b14ed0b3123678df46bd34ff2 Mon Sep 17 00:00:00 2001 From: Cris Date: Tue, 26 Jan 2021 15:26:16 +0100 Subject: [PATCH 059/142] Changed text as required in Students Anrechnung' View Signed-off-by: cris-technikum --- .../lehre/anrechnung/requestAnrechnung.php | 2 +- system/phrasesupdate.php | 24 +++++++++++++++++-- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/application/views/lehre/anrechnung/requestAnrechnung.php b/application/views/lehre/anrechnung/requestAnrechnung.php index 364fdaafd..bdf0775ac 100644 --- a/application/views/lehre/anrechnung/requestAnrechnung.php +++ b/application/views/lehre/anrechnung/requestAnrechnung.php @@ -158,7 +158,7 @@ $this->load->view(
    - p->t('anrechnung', 'weitereInformationen'); ?> + p->t('anrechnung', 'herkunftDerKenntnisse'); ?>
    diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 57306ef62..e285666a2 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -8177,7 +8177,7 @@ Any unusual occurrences 'phrases' => array( array( 'sprache' => 'German', - 'text' => 'eines Zeugnisses (vgl. § 4 Abs. 4, Satzungsteil 5 der FHTW)', + 'text' => 'eines Zeugnisses (vgl. § 4 Abs. 5 Satzung „Studienrechtliche Bestimmungen / Prüfungsordnung)', 'description' => '', 'insertvon' => 'system' ), @@ -8197,7 +8197,7 @@ Any unusual occurrences 'phrases' => array( array( 'sprache' => 'German', - 'text' => 'der nachgewiesenen beruflichen Praxis (vgl. § 4 Abs. 5, Satzungsteil 5 der FHTW)', + 'text' => 'der nachgewiesenen beruflichen Praxis ((vgl. § 4 Abs. 6 Satzung „Studienrechtliche Bestimmungen / Prüfungsordnung)', 'description' => '', 'insertvon' => 'system' ), @@ -8708,6 +8708,26 @@ Any unusual occurrences 'insertvon' => 'system' ) ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'herkunftDerKenntnisse', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Herkunft der Kenntnisse', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Origins of knowledge', + 'description' => '', + 'insertvon' => 'system' + ) + ) ) ); From 82780e96266f1f3f903a946c6f68294eab4c204e Mon Sep 17 00:00:00 2001 From: Cris Date: Tue, 26 Jan 2021 15:39:18 +0100 Subject: [PATCH 060/142] Added column "Herkunft (der Kenntnisse)" to STGL and lectors VIEW Signed-off-by: cris-technikum --- .../approveAnrechnungUebersicht.php | 3 ++- .../approveAnrechnungUebersichtData.php | 3 +++ .../anrechnung/reviewAnrechnungUebersicht.php | 3 ++- .../reviewAnrechnungUebersichtData.php | 3 +++ system/phrasesupdate.php | 20 +++++++++++++++++++ 5 files changed, 30 insertions(+), 2 deletions(-) diff --git a/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php b/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php index 26a9291a6..a19b13d57 100644 --- a/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php +++ b/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php @@ -18,7 +18,8 @@ $this->load->view( 'anrechnung' => array( 'nachweisdokumente', 'empfehlung', - 'confirmTextAntragHatBereitsEmpfehlung' + 'confirmTextAntragHatBereitsEmpfehlung', + 'herkunft' ), 'ui' => array( 'anzeigen', diff --git a/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php b/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php index 86e946d0b..d47a243c3 100644 --- a/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php +++ b/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php @@ -19,6 +19,7 @@ $query = ' (person.nachname || \' \' || person.vorname) AS "student", begruendung.bezeichnung AS "begruendung", dmsversion.name AS "dokument_bezeichnung", + anrechnung.anmerkung_student, empfehlung_anrechnung, (SELECT status_kurzbz FROM lehre.tbl_anrechnungstatus @@ -63,6 +64,7 @@ $filterWidgetArray = array( ucfirst($this->p->t('person', 'studentIn')), ucfirst($this->p->t('global', 'begruendung')), ucfirst($this->p->t('anrechnung', 'nachweisdokumente')), + ucfirst($this->p->t('anrechnung', 'herkunft')), ucfirst($this->p->t('anrechnung', 'empfehlung')), 'status_kurzbz', 'Status' @@ -114,6 +116,7 @@ $filterWidgetArray = array( url:function(cell){return "'. current_url() .'/download?dms_id=" + cell.getData().dms_id}, target:"_blank" }}, + anmerkung_student: {headerFilter:"input"}, empfehlung_anrechnung: {headerFilter:"input", align:"center", formatter: format_empfehlung_anrechnung}, status_kurzbz: {visible: false}, status_bezeichnung: {headerFilter:"input"} diff --git a/application/views/lehre/anrechnung/reviewAnrechnungUebersicht.php b/application/views/lehre/anrechnung/reviewAnrechnungUebersicht.php index 90ae426e9..6ad6d9553 100644 --- a/application/views/lehre/anrechnung/reviewAnrechnungUebersicht.php +++ b/application/views/lehre/anrechnung/reviewAnrechnungUebersicht.php @@ -17,7 +17,8 @@ $this->load->view( ), 'anrechnung' => array( 'nachweisdokumente', - 'empfehlung' + 'empfehlung', + 'herkunft' ), 'ui' => array( 'anzeigen', diff --git a/application/views/lehre/anrechnung/reviewAnrechnungUebersichtData.php b/application/views/lehre/anrechnung/reviewAnrechnungUebersichtData.php index 2627bebaf..0f87a60aa 100644 --- a/application/views/lehre/anrechnung/reviewAnrechnungUebersichtData.php +++ b/application/views/lehre/anrechnung/reviewAnrechnungUebersichtData.php @@ -19,6 +19,7 @@ $query = ' (person.nachname || \' \' || person.vorname) AS "student", begruendung.bezeichnung AS "begruendung", dmsversion.name AS "dokument_bezeichnung", + anrechnung.anmerkung_student, empfehlung_anrechnung, (SELECT status_kurzbz FROM lehre.tbl_anrechnungstatus @@ -67,6 +68,7 @@ $filterWidgetArray = array( ucfirst($this->p->t('person', 'studentIn')), ucfirst($this->p->t('global', 'begruendung')), ucfirst($this->p->t('anrechnung', 'nachweisdokumente')), + ucfirst($this->p->t('anrechnung', 'herkunft')), ucfirst($this->p->t('anrechnung', 'empfehlung')), 'status_kurzbz', 'Status' @@ -118,6 +120,7 @@ $filterWidgetArray = array( url:function(cell){return "'. current_url() .'/download?dms_id=" + cell.getData().dms_id}, target:"_blank" }}, + anmerkung_student: {headerFilter:"input"}, empfehlung_anrechnung: {headerFilter:"input", align:"center", formatter: format_empfehlung_anrechnung}, status_kurzbz: {visible: false}, status_bezeichnung: {headerFilter:"input"} diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index e285666a2..7b9d6e799 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -8728,6 +8728,26 @@ Any unusual occurrences 'insertvon' => 'system' ) ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'herkunft', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Herkunft', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Origins', + 'description' => '', + 'insertvon' => 'system' + ) + ) ) ); From db10f785052b5f887b8de172345e3a360c81cfaa Mon Sep 17 00:00:00 2001 From: Cris Date: Tue, 26 Jan 2021 18:49:55 +0100 Subject: [PATCH 061/142] Added method getLeitung() to Studiengang_model to retrieve STGL by studiengang_kz Signed-off-by: cris-technikum --- .../models/organisation/Studiengang_model.php | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/application/models/organisation/Studiengang_model.php b/application/models/organisation/Studiengang_model.php index 1c9c6e944..0977bceb2 100644 --- a/application/models/organisation/Studiengang_model.php +++ b/application/models/organisation/Studiengang_model.php @@ -448,4 +448,35 @@ class Studiengang_model extends DB_Model return $this->execQuery($query, array($typ)); } + + /** + * Get Studiengangsleitung + * @param null $studiengang_kz + * @return array + */ + public function getLeitung($studiengang_kz = null) + { + $this->addSelect('uid, studiengang_kz, oe_kurzbz, email'); + $this->addJoin('public.tbl_benutzerfunktion', 'oe_kurzbz'); + + if (is_null($studiengang_kz)) + { + $condition = ' + funktion_kurzbz = \'Leitung\' + AND ( datum_von <= NOW() OR datum_von IS NULL ) + AND ( datum_bis >= NOW() OR datum_bis IS NULL ) + '; + } + elseif (is_numeric($studiengang_kz)) + { + $condition = ' + funktion_kurzbz = \'Leitung\' + AND ( datum_von <= NOW() OR datum_von IS NULL ) + AND ( datum_bis >= NOW() OR datum_bis IS NULL ) + AND studiengang_kz = ' . $this->db->escape($studiengang_kz, FHC_INTEGER) + ; + } + + return $this->loadWhere($condition); + } } From 8a75bc9fdd5ae7882abd2064eafc581191968dab Mon Sep 17 00:00:00 2001 From: Cris Date: Tue, 26 Jan 2021 18:54:42 +0100 Subject: [PATCH 062/142] Added method getFullName() to Person_model Signed-off-by: cris-technikum --- application/models/person/Person_model.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/application/models/person/Person_model.php b/application/models/person/Person_model.php index 128af7860..e005e243c 100644 --- a/application/models/person/Person_model.php +++ b/application/models/person/Person_model.php @@ -248,4 +248,19 @@ class Person_model extends DB_Model return $this->execQuery($qry, $parametersArray); } + + /** + * Get full name of given uid. (Vorname Nachname) + * @param $uid + * @return array + */ + public function getFullName($uid) + { + if (!$result = getData($this->getByUid($uid))[0]) + { + show_error('Failed loading person'); + } + + return success($result->vorname. ' '. $result->nachname); + } } From 3fb2c3d387e9054f937ec710a7b3052d7983f684 Mon Sep 17 00:00:00 2001 From: Cris Date: Tue, 26 Jan 2021 18:56:15 +0100 Subject: [PATCH 063/142] Added Sanchomail sent when Anrechnung is applied by student Mail goes to STGL. If not present, it will be sent to STGL assistance. Signed-off-by: cris-technikum --- .../lehre/anrechnung/RequestAnrechnung.php | 104 +++++++++++++++--- .../models/organisation/Studiengang_model.php | 4 +- 2 files changed, 91 insertions(+), 17 deletions(-) diff --git a/application/controllers/lehre/anrechnung/RequestAnrechnung.php b/application/controllers/lehre/anrechnung/RequestAnrechnung.php index 6656c94f6..5bd140b07 100644 --- a/application/controllers/lehre/anrechnung/RequestAnrechnung.php +++ b/application/controllers/lehre/anrechnung/RequestAnrechnung.php @@ -5,6 +5,7 @@ class requestAnrechnung extends Auth_Controller { const REQUEST_ANRECHNUNG_URI = '/lehre/anrechnung/RequestAnrechnung'; + const APPROVE_ANRECHNUNG_URI = '/lehre/anrechnung/ApproveAnrechnungUebersicht'; const ANRECHNUNGSTATUS_PROGRESSED_BY_STGL = 'inProgressDP'; const ANRECHNUNGSTATUS_PROGRESSED_BY_KF = 'inProgressKF'; @@ -142,7 +143,7 @@ class requestAnrechnung extends Auth_Controller show_error('Failed retrieving prestudent'); } - // Save Anrechnung with Status 'inProgressSTGL' + // Save Anrechnung $result = $this->AnrechnungModel->insert(array( 'prestudent_id' => $prestudent->prestudent_id, 'lehrveranstaltung_id' => $lehrveranstaltung_id, @@ -151,22 +152,23 @@ class requestAnrechnung extends Auth_Controller 'studiensemester_kurzbz' => $studiensemester_kurzbz, 'anmerkung_student' => $anmerkung )); - + if (isError($result)) { show_error('Failed inserting Anrechnung'); } - + + // Save Anrechnungstatus 'inProgressSTGL' $result = $this->AnrechnungModel->saveAnrechnungstatus($result->retval, self::ANRECHNUNGSTATUS_PROGRESSED_BY_STGL); - + if (isError($result)) { show_error('Failed saving Anrechnungstatus'); } - + // Transaction complete! $this->db->trans_complete(); - + if ($this->db->trans_status() === false || isError($result)) { $this->db->trans_rollback(); @@ -174,18 +176,15 @@ class requestAnrechnung extends Auth_Controller } // Send mail to STGL - $this->load->model('organisation/Studiengang_model', 'StudiengangModel'); - $studiengang = $this->StudiengangModel->load($prestudent->studiengang_kz); + $mail_params = array( + 'studiensemester_kurzbz' => $studiensemester_kurzbz, + 'studiengang_kz' => $prestudent->studiengang_kz, + 'lehrveranstaltung_id' => $lehrveranstaltung_id + ); - // Send mail - $this->load->library('MailLib'); - if(!$this->maillib->send( - "noreply@". DOMAIN, - $studiengang->retval[0]->email, - 'Neuer LV-Anrechnungsantrag', - 'Eine neuer LV Anrechnungsantrag steht zur Prüfung bereit.')) + if(!$this->_sendSanchoMail($mail_params)) { - show_error('Failed sending email to STGL'); + show_error('Failed sending mail'); } else { @@ -299,4 +298,77 @@ class requestAnrechnung extends Auth_Controller return getUserLanguage() == 'German' ? $status_mehrsprachig[0] : $status_mehrsprachig[1]; } } + + /** + * Send mail to STGL (if not available, send to STGL assistance) + * @param $mail_params + */ + private function _sendSanchoMail($mail_params) + { + // Get STGL mail address, if available, otherwise get assistance mail address + list ($to, $vorname) = $this->_getSTGLMailAddress($mail_params['studiengang_kz']); + + // Get full name of student + $this->load->model('person/Person_model', 'PersonModel'); + if (!$student_name = getData($this->PersonModel->getFullName($this->_uid))) + { + show_error ('Failed retrieving person'); + } + + // Get lehrveranstaltung bezeichnung + $this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel'); + if (!$lehrveranstaltung = getData($this->LehrveranstaltungModel->load($mail_params['lehrveranstaltung_id']))[0]) + { + show_error ('Failed retrieving person'); + } + + // Link to Antrag genehmigen + $url = site_url(self::APPROVE_ANRECHNUNG_URI).'?studiensemester='. $mail_params['studiensemester_kurzbz']; + + // Prepare mail content + $body_fields = array( + 'vorname' => $vorname, + 'student_name' => $student_name, + 'lehrveranstaltung_bezeichnung' => $lehrveranstaltung->bezeichnung, + 'link' => anchor($url, 'Anrechnungsanträge Übersicht') + ); + + sendSanchoMail( + 'AnrechnungAntragStellen', + $body_fields, + $to, + 'Neuer LV-Anrechnungsantrag' + ); + + return true; + } + + // Get STGL mail address, if available, otherwise get assistance mail address + private function _getSTGLMailAddress($stg_kz) + { + $this->load->model('organisation/Studiengang_model', 'StudiengangModel'); + $result = $this->StudiengangModel->getLeitung($stg_kz); + + // Get STGL mail address, if available + if (hasData($result)) + { + return array( + $result->retval[0]->uid. '@'. DOMAIN, + $result->retval[0]->vorname + ); + } + // ...otherwise get assistance mail address + else + { + $result = $this->StudiengangModel->load($stg_kz); + + if (hasData($result)) + { + return array( + $result->retval[0]->email, + '' + ); + } + } + } } \ No newline at end of file diff --git a/application/models/organisation/Studiengang_model.php b/application/models/organisation/Studiengang_model.php index 0977bceb2..8b8be0366 100644 --- a/application/models/organisation/Studiengang_model.php +++ b/application/models/organisation/Studiengang_model.php @@ -456,8 +456,10 @@ class Studiengang_model extends DB_Model */ public function getLeitung($studiengang_kz = null) { - $this->addSelect('uid, studiengang_kz, oe_kurzbz, email'); + $this->addSelect('uid, studiengang_kz, oe_kurzbz, vorname, nachname, email'); $this->addJoin('public.tbl_benutzerfunktion', 'oe_kurzbz'); + $this->addJoin('public.tbl_benutzer', 'uid'); + $this->addJoin('public.tbl_person', 'person_id'); if (is_null($studiengang_kz)) { From 697e5057cfc7dc3c0a32e70bb3b380a5c7eb9cc4 Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 27 Jan 2021 10:59:00 +0100 Subject: [PATCH 064/142] Added sending Sanchomail when Anrechnung is (not) recommended by lector Mail goes to STGL. If not present, it will be sent to STGL assistance. Signed-off-by: cris-technikum --- .../lehre/anrechnung/RequestAnrechnung.php | 2 +- .../anrechnung/ReviewAnrechnungUebersicht.php | 94 +++++++++++++++++++ 2 files changed, 95 insertions(+), 1 deletion(-) diff --git a/application/controllers/lehre/anrechnung/RequestAnrechnung.php b/application/controllers/lehre/anrechnung/RequestAnrechnung.php index 5bd140b07..77a1b73ef 100644 --- a/application/controllers/lehre/anrechnung/RequestAnrechnung.php +++ b/application/controllers/lehre/anrechnung/RequestAnrechnung.php @@ -323,7 +323,7 @@ class requestAnrechnung extends Auth_Controller } // Link to Antrag genehmigen - $url = site_url(self::APPROVE_ANRECHNUNG_URI).'?studiensemester='. $mail_params['studiensemester_kurzbz']; + $url = site_url(self::APPROVE_ANRECHNUNG_URI); // Prepare mail content $body_fields = array( diff --git a/application/controllers/lehre/anrechnung/ReviewAnrechnungUebersicht.php b/application/controllers/lehre/anrechnung/ReviewAnrechnungUebersicht.php index a5646d31e..ed2979420 100644 --- a/application/controllers/lehre/anrechnung/ReviewAnrechnungUebersicht.php +++ b/application/controllers/lehre/anrechnung/ReviewAnrechnungUebersicht.php @@ -6,6 +6,8 @@ class reviewAnrechnungUebersicht extends Auth_Controller { const BERECHTIGUNG_ANRECHNUNG_EMPFEHLEN = 'lehre/anrechnung_empfehlen'; + const APPROVE_ANRECHNUNG_URI = '/lehre/anrechnung/ApproveAnrechnungUebersicht'; + const ANRECHNUNGSTATUS_PROGRESSED_BY_STGL = 'inProgressDP'; const ANRECHNUNGSTATUS_PROGRESSED_BY_KF = 'inProgressKF'; const ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR = 'inProgressLektor'; @@ -118,6 +120,12 @@ class reviewAnrechnungUebersicht extends Auth_Controller // Output json to ajax if (isset($json) && !isEmptyArray($json)) { + // Send mails to STGL (if not present STGL, send to STGL assistance) + if (!$this->_sendSanchoMails($json, true)) + { + show_error('Failed sending emails'); + } + return $this->outputJsonSuccess($json); } else @@ -162,6 +170,12 @@ class reviewAnrechnungUebersicht extends Auth_Controller // Output json to ajax if (isset($json) && !isEmptyArray($json)) { + // Send mails to STGL (if not present STGL, send to STGL assistance) + if (!$this->_sendSanchoMails($json, false)) + { + show_error('Failed sending emails'); + } + return $this->outputJsonSuccess($json); } else @@ -195,4 +209,84 @@ class reviewAnrechnungUebersicht extends Auth_Controller if (!$this->_uid) show_error('User authentification failed'); } + + private function _sendSanchoMails($mail_params, $empfehlung) + { + // Get studiengaenge + $studiengang_kz_arr = array(); + + foreach ($mail_params as $item) + { + $this->AnrechnungModel->addSelect('studiengang_kz'); + $this->AnrechnungModel->addJoin('public.tbl_prestudent', 'prestudent_id'); + + $studiengang_kz_arr[]= $this->AnrechnungModel->load($item['anrechnung_id'])->retval[0]->studiengang_kz; + } + + $studiengang_kz_arr = array_unique($studiengang_kz_arr); + + // Send mail to STGL of each studiengang + foreach ($studiengang_kz_arr as $studiengang_kz) + { + // Get STGL mail address, if available, otherwise get assistance mail address + list ($to, $vorname) = $this->_getSTGLMailAddress($studiengang_kz); + + // Get full name of lector + $this->load->model('person/Person_model', 'PersonModel'); + if (!$lector_name = getData($this->PersonModel->getFullName($this->_uid))) + { + show_error ('Failed retrieving person'); + } + + // Link to Antrag genehmigen + $url = site_url(self::APPROVE_ANRECHNUNG_URI); + + // Prepare mail content + $body_fields = array( + 'vorname' => $vorname, + 'lektor_name' => $lector_name, + 'empfehlung' => $empfehlung ? 'positive' : 'negative', + 'link' => anchor($url, 'Anrechnungsanträge Übersicht') + ); + + sendSanchoMail( + 'AnrechnungEmpfehlungAbgeben', + $body_fields, + $to, + 'Neue '. ($empfehlung ? 'positive' : 'negative'). ' Empfehlungen für LV-Anrechnungsanträge' + ); + } + + return true; + } + + // Get STGL mail address, if available, otherwise get assistance mail address + private function _getSTGLMailAddress($stg_kz) + { + $this->load->model('organisation/Studiengang_model', 'StudiengangModel'); + $result = $this->StudiengangModel->getLeitung($stg_kz); + + // Get STGL mail address, if available + if (hasData($result)) + { + return array( + $result->retval[0]->uid. '@'. DOMAIN, + $result->retval[0]->vorname + ); + } + // ...otherwise get assistance mail address + else + { + $result = $this->StudiengangModel->load($stg_kz); + + if (hasData($result)) + { + return array( + $result->retval[0]->email, + '' + ); + } + } + } + } \ No newline at end of file From 35009097f13b877a2c00afbf0db199a5cf96fb5c Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 27 Jan 2021 14:46:02 +0100 Subject: [PATCH 065/142] Added sending Sanchomail to student when Anrechnung was approved/rejected Signed-off-by: cris-technikum --- .../ApproveAnrechnungUebersicht.php | 39 +++++++++++++++++++ .../lehre/anrechnung/RequestAnrechnung.php | 1 - .../anrechnung/ReviewAnrechnungUebersicht.php | 5 ++- application/libraries/AnrechnungLib.php | 28 +++++++++++++ 4 files changed, 71 insertions(+), 2 deletions(-) diff --git a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php index c7116baf8..207c4de9b 100644 --- a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php +++ b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php @@ -118,6 +118,11 @@ class approveAnrechnungUebersicht extends Auth_Controller 'status_kurzbz' => self::ANRECHNUNGSTATUS_APPROVED, 'status_bezeichnung' => $approved ); + + if(!$this->_sendSanchoMailToStudent($item['anrechnung_id'], $approved)) + { + show_error('Failed sending mail'); + } } } @@ -161,6 +166,11 @@ class approveAnrechnungUebersicht extends Auth_Controller 'status_kurzbz' => self::ANRECHNUNGSTATUS_REJECTED, 'status_bezeichnung' => $rejected ); + + if(!$this->_sendSanchoMailToStudent($item['anrechnung_id'], $rejected)) + { + show_error('Failed sending mail'); + } } } @@ -244,4 +254,33 @@ class approveAnrechnungUebersicht extends Auth_Controller if (!$this->_uid) show_error('User authentification failed'); } + + /** + * Send mail to student to inform if Anrechnung was approved or rejected + * @param $mail_params + */ + private function _sendSanchoMailToStudent($anrechnung_id, $status_bezeichnung) + { + $result = getData($this->anrechnunglib->getStudentData($anrechnung_id))[0]; + + // Get student name and mail address + $to = $result->uid. '@'. DOMAIN; + + + // Prepare mail content + $body_fields = array( + 'vorname' => $result->vorname, + 'lehrveranstaltung_bezeichnung' => $result->lv_bezeichnung, + 'status' => $status_bezeichnung + ); + + sendSanchoMail( + 'AnrechnungGenehmigen', + $body_fields, + $to, + 'Dein Anrechnungsantrag zur LV '. $result->lv_bezeichnung. ' wurde '. $status_bezeichnung + ); + + return true; + } } \ No newline at end of file diff --git a/application/controllers/lehre/anrechnung/RequestAnrechnung.php b/application/controllers/lehre/anrechnung/RequestAnrechnung.php index 77a1b73ef..8ac8683b9 100644 --- a/application/controllers/lehre/anrechnung/RequestAnrechnung.php +++ b/application/controllers/lehre/anrechnung/RequestAnrechnung.php @@ -177,7 +177,6 @@ class requestAnrechnung extends Auth_Controller // Send mail to STGL $mail_params = array( - 'studiensemester_kurzbz' => $studiensemester_kurzbz, 'studiengang_kz' => $prestudent->studiengang_kz, 'lehrveranstaltung_id' => $lehrveranstaltung_id ); diff --git a/application/controllers/lehre/anrechnung/ReviewAnrechnungUebersicht.php b/application/controllers/lehre/anrechnung/ReviewAnrechnungUebersicht.php index ed2979420..bbf391281 100644 --- a/application/controllers/lehre/anrechnung/ReviewAnrechnungUebersicht.php +++ b/application/controllers/lehre/anrechnung/ReviewAnrechnungUebersicht.php @@ -120,7 +120,10 @@ class reviewAnrechnungUebersicht extends Auth_Controller // Output json to ajax if (isset($json) && !isEmptyArray($json)) { - // Send mails to STGL (if not present STGL, send to STGL assistance) + /** + * Send mails to STGL (if not present STGL, send to STGL assistance) + * NOTE: mails are sent at the end to ensure sending only one mail to each STGL + * */ if (!$this->_sendSanchoMails($json, true)) { show_error('Failed sending emails'); diff --git a/application/libraries/AnrechnungLib.php b/application/libraries/AnrechnungLib.php index c77d49c93..17b2538a6 100644 --- a/application/libraries/AnrechnungLib.php +++ b/application/libraries/AnrechnungLib.php @@ -145,6 +145,34 @@ class AnrechnungLib return success($anrechnung_data); } + public function getStudentData($anrechnung_id) + { + if (!is_numeric($anrechnung_id)) + { + show_error('Incorrect parameter'); + } + + $this->ci->AnrechnungModel->addSelect('tbl_benutzer.uid, tbl_prestudent.prestudent_id, tbl_person.person_id, tbl_anrechnung.studiensemester_kurzbz, vorname, nachname, tbl_lehrveranstaltung.bezeichnung AS "lv_bezeichnung"'); + $this->ci->AnrechnungModel->addJoin('public.tbl_prestudent', 'prestudent_id'); + $this->ci->AnrechnungModel->addJoin('public.tbl_person', 'person_id'); + $this->ci->AnrechnungModel->addJoin('public.tbl_benutzer', 'person_id'); + $this->ci->AnrechnungModel->addJoin('lehre.tbl_lehrveranstaltung', 'lehrveranstaltung_id'); + + $result = $this->ci->AnrechnungModel->load($anrechnung_id); + + if (isError($result)) + { + show_error(getError($result)); + } + + if (!hasData($result)) + { + show_error('Failed retrieving students data'); + } + + return $result; + } + /** * Get last Anrechnungstatusbezeichnung in users language. * @param $anrechnung_id From 6a37c71cfc54c6c0e3e7eb5634b5835eda72d655 Mon Sep 17 00:00:00 2001 From: Cris Date: Thu, 28 Jan 2021 10:20:17 +0100 Subject: [PATCH 066/142] Added sending Sanchomail to lector asking to recommend Anrechnung Mails are send to lectors (prio for LV-Leitung, if not present to all lectors of LV) Anyway, as many there recommendation may be requested for many lvs at the same time, the receiver array will be unique to ensure sending only once to one and the same lector. e.g. if lector is lv-leitung for lv x and lector for lv y, will get only one mail. Signed-off-by: cris-technikum --- .../ApproveAnrechnungUebersicht.php | 128 +++++++++++++++++- 1 file changed, 127 insertions(+), 1 deletion(-) diff --git a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php index 207c4de9b..7b66a728c 100644 --- a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php +++ b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php @@ -6,6 +6,8 @@ class approveAnrechnungUebersicht extends Auth_Controller { const BERECHTIGUNG_ANRECHNUNG_GENEHMIGEN = 'lehre/anrechnung_genehmigen'; + const REVIEW_ANRECHNUNG_URI = '/lehre/anrechnung/ReviewAnrechnungUebersicht'; + const ANRECHNUNGSTATUS_PROGRESSED_BY_STGL = 'inProgressDP'; const ANRECHNUNGSTATUS_PROGRESSED_BY_KF = 'inProgressKF'; const ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR = 'inProgressLektor'; @@ -70,7 +72,7 @@ class approveAnrechnungUebersicht extends Auth_Controller if (!is_string($studiensemester_kurzbz)) { - $studiensemester = $this->StudiensemesterModel->getNearest(); // TODO check + $studiensemester = $this->StudiensemesterModel->getNearest(); if (hasData($studiensemester)) { $studiensemester_kurzbz = $studiensemester->retval[0]->studiensemester_kurzbz; @@ -221,6 +223,16 @@ class approveAnrechnungUebersicht extends Auth_Controller // Output json to ajax if (isset($json) && !isEmptyArray($json)) { + /** + * Send mails to lectors + * NOTE: mails are sent at the end to ensure sending only ONE mail to each LV-Leitung or lector + * even if they are required for more recommendations + * */ + if (!$this->_sendSanchoMailToLectors($json)) + { + show_error('Failed sending emails'); + } + return $this->outputJsonSuccess($json); } else @@ -283,4 +295,118 @@ class approveAnrechnungUebersicht extends Auth_Controller return true; } + + /** + * Send mail to lectors asking for recommendation. (first to LV-Leitung, if not present to all lectors of lv) + * @param $mail_params + * @return bool + */ + private function _sendSanchoMailToLectors($mail_params) + { + // Get Lehrveranstaltungen + $anrechnung_arr = array(); + + foreach ($mail_params as $item) + { + $this->AnrechnungModel->addSelect('lehrveranstaltung_id, studiensemester_kurzbz'); + $anrechnung_arr[]= array( + 'lehrveranstaltung_id' => $this->AnrechnungModel->load($item['anrechnung_id'])->retval[0]->lehrveranstaltung_id, + 'studiensemester_kurzbz' => $this->AnrechnungModel->load($item['anrechnung_id'])->retval[0]->studiensemester_kurzbz + ); + } + + $anrechnung_arr = array_unique($anrechnung_arr, SORT_REGULAR); + + + /** + * Get lectors (prio for LV-Leitung, if not present to all lectors of LV. + * Anyway this function will receive a unique array to avoid sending more mails to one and the same lector. + * **/ + $lector_arr = $this->_getLectors($anrechnung_arr); + + // Send mail to lectors + foreach ($lector_arr as $lector) + { + $to = $lector->uid; + $vorname = $lector->vorname; + + // Get full name of stgl + $this->load->model('person/Person_model', 'PersonModel'); + if (!$stgl_name = getData($this->PersonModel->getFullName($this->_uid))) + { + show_error ('Failed retrieving person'); + } + + // Link to Antrag genehmigen + $url = site_url(self::REVIEW_ANRECHNUNG_URI); + + // Prepare mail content + $body_fields = array( + 'vorname' => $vorname, + 'stgl_name' => $stgl_name, + 'link' => anchor($url, 'Anrechnungsanträge Übersicht') + ); + + sendSanchoMail( + 'AnrechnungEmpfehlungAnfordern', + $body_fields, + $to, + 'Neue LV-Anrechnungsanträge benötigen Deine Empfehlung' + ); + } + return true; + } + + /** + * Get lectors (prio for LV-Leitung, if not present to all lectors of LV. + * Anyway this function will receive a unique array to avoid sending more mails to one and the same lector. + * @param $anrechnung_arr + * @return array + */ + private function _getLectors($anrechnung_arr) + { + $lector_arr = array(); + + // Get lectors + foreach($anrechnung_arr as $anrechnung) + { + $this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel'); + $result = $this->LehrveranstaltungModel->getLecturersByLv($anrechnung['studiensemester_kurzbz'], $anrechnung['lehrveranstaltung_id']); + + if (!$result = getData($result)) + { + show_error('Failed retrieving lectors of Lehrveranstaltung'); + } + + // Check if lv has LV-Leitung + $key = array_search(true, array_column($result, 'lvleiter')); + + // If lv has LV-Leitung, keep only the one + if ($key !== false) + { + $lector_arr[]= $result[$key]; + } + // ...otherwise keep all lectors + else + { + $lector_arr = array_merge($lector_arr, $result); + } + } + + /** + * NOTE: This step is only done to make the array unique by uid, vorname and nachname in the following step + * (e.g. if same lector is ones LV-Leitung and another time not, then array_unique would leave both. + * But we wish to send only one email by to that one person) + * **/ + foreach ($lector_arr as $lector) + { + unset($lector->lvleiter); + } + + // Now make the lector array aka mail receivers unique + $lector_arr = array_unique($lector_arr, SORT_REGULAR); + + return $lector_arr; + + } } \ No newline at end of file From 8d09ee7299f5d1c40821e1980818f8ae58996450 Mon Sep 17 00:00:00 2001 From: Cris Date: Thu, 28 Jan 2021 11:22:14 +0100 Subject: [PATCH 067/142] Modified to update Zeugnisnote, if already exists During approving process the zeugnisnote is set to 6 (angerechnet). If zeugnisnote already exists, it will be updated now. Signed-off-by: cris-technikum --- .../ApproveAnrechnungUebersicht.php | 2 +- .../lehre/anrechnung/RequestAnrechnung.php | 5 +- .../anrechnung/ReviewAnrechnungUebersicht.php | 8 ++- application/libraries/AnrechnungLib.php | 52 ++++++++++++++++--- 4 files changed, 57 insertions(+), 10 deletions(-) diff --git a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php index 7b66a728c..829b3139a 100644 --- a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php +++ b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php @@ -1,6 +1,6 @@ load->view('lehre/anrechnung/requestAnrechnung.php', $viewData); } + /** + * Apply Anrechnungsantrag and send to STGL + */ public function apply() { $anmerkung = $this->input->post('anmerkung'); diff --git a/application/controllers/lehre/anrechnung/ReviewAnrechnungUebersicht.php b/application/controllers/lehre/anrechnung/ReviewAnrechnungUebersicht.php index bbf391281..6f777736f 100644 --- a/application/controllers/lehre/anrechnung/ReviewAnrechnungUebersicht.php +++ b/application/controllers/lehre/anrechnung/ReviewAnrechnungUebersicht.php @@ -1,6 +1,6 @@ _uid) show_error('User authentification failed'); } + /** + * Send mails to STGL (if not present then to STGL assistance) + * @param $mail_params + * @param $empfehlung + * @return bool + */ private function _sendSanchoMails($mail_params, $empfehlung) { // Get studiengaenge diff --git a/application/libraries/AnrechnungLib.php b/application/libraries/AnrechnungLib.php index 17b2538a6..f9a0bc2a9 100644 --- a/application/libraries/AnrechnungLib.php +++ b/application/libraries/AnrechnungLib.php @@ -145,6 +145,11 @@ class AnrechnungLib return success($anrechnung_data); } + /** + * Get students data by Anrechnung + * @param $anrechnung_id + * @return mixed + */ public function getStudentData($anrechnung_id) { if (!is_numeric($anrechnung_id)) @@ -233,18 +238,50 @@ class AnrechnungLib $this->ci->AnrechnungModel->addSelect('lehrveranstaltung_id, student_uid, studiensemester_kurzbz'); $this->ci->AnrechnungModel->addJoin('public.tbl_student', 'prestudent_id'); $anrechnung = getData($this->ci->AnrechnungModel->load($anrechnung_id))[0]; - $result = $this->ci->ZeugnisnoteModel->insert(array( + + // Check if zeugnisnote exists + $result = $this->ci->ZeugnisnoteModel->loadWhere(array( 'lehrveranstaltung_id' => $anrechnung->lehrveranstaltung_id, 'student_uid' => $anrechnung->student_uid, - 'studiensemester_kurzbz' => $anrechnung->studiensemester_kurzbz, - 'uebernahmedatum' => (new DateTime())->format('Y-m-d H:m:i'), - 'benotungsdatum' => (new DateTime())->format('Y-m-d H:m:i'), - 'note' => 6, - 'insertvon' => $stgl_uid, - 'bemerkung' => 'Digitale Anrechnung' + 'studiensemester_kurzbz' => $anrechnung->studiensemester_kurzbz ) ); + // If zeugnisnote exists, update... + if (hasData($result)) + { + $this->ci->ZeugnisnoteModel->update( + array( + 'lehrveranstaltung_id' => $anrechnung->lehrveranstaltung_id, + 'student_uid' => $anrechnung->student_uid, + 'studiensemester_kurzbz' => $anrechnung->studiensemester_kurzbz + ), + array( + 'uebernahmedatum' => (new DateTime())->format('Y-m-d H:m:i'), + 'benotungsdatum' => (new DateTime())->format('Y-m-d H:m:i'), + 'note' => 6, + 'insertvon' => $stgl_uid, + 'bemerkung' => 'Digitale Anrechnung' + ) + ); + + } + // ...otherwise insert + else + { + $this->ci->ZeugnisnoteModel->insert(array( + 'lehrveranstaltung_id' => $anrechnung->lehrveranstaltung_id, + 'student_uid' => $anrechnung->student_uid, + 'studiensemester_kurzbz' => $anrechnung->studiensemester_kurzbz, + 'uebernahmedatum' => (new DateTime())->format('Y-m-d H:m:i'), + 'benotungsdatum' => (new DateTime())->format('Y-m-d H:m:i'), + 'note' => 6, + 'insertvon' => $stgl_uid, + 'bemerkung' => 'Digitale Anrechnung' + ) + ); + } + // Transaction complete $this->ci->db->trans_complete(); @@ -448,6 +485,7 @@ class AnrechnungLib return success(true); // recommended } + // Return an object with Anrechnungdata private function _setAnrechnungDataObject($anrechnung) { $anrechnung_data = new StdClass(); From bd293f3b3ad7849c1eca59353b88f548407c0d7a Mon Sep 17 00:00:00 2001 From: Cris Date: Thu, 28 Jan 2021 16:04:21 +0100 Subject: [PATCH 068/142] Changed mail text to inform students about approved/rejected Anrechnungen Signed-off-by: cris-technikum --- .../anrechnung/ApproveAnrechnungUebersicht.php | 18 ++++++++++-------- application/libraries/AnrechnungLib.php | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php index 829b3139a..32c2d27e3 100644 --- a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php +++ b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php @@ -121,7 +121,7 @@ class approveAnrechnungUebersicht extends Auth_Controller 'status_bezeichnung' => $approved ); - if(!$this->_sendSanchoMailToStudent($item['anrechnung_id'], $approved)) + if(!$this->_sendSanchoMailToStudent($item['anrechnung_id'], self::ANRECHNUNGSTATUS_APPROVED)) { show_error('Failed sending mail'); } @@ -169,7 +169,7 @@ class approveAnrechnungUebersicht extends Auth_Controller 'status_bezeichnung' => $rejected ); - if(!$this->_sendSanchoMailToStudent($item['anrechnung_id'], $rejected)) + if(!$this->_sendSanchoMailToStudent($item['anrechnung_id'], self::ANRECHNUNGSTATUS_REJECTED)) { show_error('Failed sending mail'); } @@ -271,26 +271,28 @@ class approveAnrechnungUebersicht extends Auth_Controller * Send mail to student to inform if Anrechnung was approved or rejected * @param $mail_params */ - private function _sendSanchoMailToStudent($anrechnung_id, $status_bezeichnung) + private function _sendSanchoMailToStudent($anrechnung_id, $status_kurzbz) { $result = getData($this->anrechnunglib->getStudentData($anrechnung_id))[0]; // Get student name and mail address $to = $result->uid. '@'. DOMAIN; - + $anrede = $result->geschlecht == 'w' ? 'Sehr geehrte Frau ' : 'Sehr geehrter Herr '; // Prepare mail content $body_fields = array( - 'vorname' => $result->vorname, - 'lehrveranstaltung_bezeichnung' => $result->lv_bezeichnung, - 'status' => $status_bezeichnung + 'anrede_name' => $anrede. $result->vorname. ' '. $result->nachname, + 'lehrveranstaltung_bezeichnung' => $result->lv_bezeichnung, + 'stattgegeben_nichtstattgegeben' => $status_kurzbz == self::ANRECHNUNGSTATUS_APPROVED + ? 'stattgegeben' + : 'nicht stattgegeben' ); sendSanchoMail( 'AnrechnungGenehmigen', $body_fields, $to, - 'Dein Anrechnungsantrag zur LV '. $result->lv_bezeichnung. ' wurde '. $status_bezeichnung + 'Ihr Antrag auf Anerkennung nachgewiesener Kenntnisse wurde abgeschlossen' ); return true; diff --git a/application/libraries/AnrechnungLib.php b/application/libraries/AnrechnungLib.php index f9a0bc2a9..10f21f1b6 100644 --- a/application/libraries/AnrechnungLib.php +++ b/application/libraries/AnrechnungLib.php @@ -157,7 +157,7 @@ class AnrechnungLib show_error('Incorrect parameter'); } - $this->ci->AnrechnungModel->addSelect('tbl_benutzer.uid, tbl_prestudent.prestudent_id, tbl_person.person_id, tbl_anrechnung.studiensemester_kurzbz, vorname, nachname, tbl_lehrveranstaltung.bezeichnung AS "lv_bezeichnung"'); + $this->ci->AnrechnungModel->addSelect('tbl_benutzer.uid, tbl_prestudent.prestudent_id, tbl_person.person_id, tbl_anrechnung.studiensemester_kurzbz, vorname, nachname, geschlecht, tbl_lehrveranstaltung.bezeichnung AS "lv_bezeichnung"'); $this->ci->AnrechnungModel->addJoin('public.tbl_prestudent', 'prestudent_id'); $this->ci->AnrechnungModel->addJoin('public.tbl_person', 'person_id'); $this->ci->AnrechnungModel->addJoin('public.tbl_benutzer', 'person_id'); From 14d1762c9f9ba9e13a8f6d8c4bbfa00ec1e27deb Mon Sep 17 00:00:00 2001 From: Cris Date: Thu, 28 Jan 2021 16:52:14 +0100 Subject: [PATCH 069/142] Changed email links to correct CIS URL Signed-off-by: cris-technikum --- .../lehre/anrechnung/ApproveAnrechnungUebersicht.php | 5 ++++- .../controllers/lehre/anrechnung/RequestAnrechnung.php | 5 ++++- .../lehre/anrechnung/ReviewAnrechnungUebersicht.php | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php index 32c2d27e3..736861025 100644 --- a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php +++ b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php @@ -340,7 +340,10 @@ class approveAnrechnungUebersicht extends Auth_Controller } // Link to Antrag genehmigen - $url = site_url(self::REVIEW_ANRECHNUNG_URI); + $url = + CIS_ROOT. 'cis/index.php?menu='. + CIS_ROOT. 'cis/menu.php?content_id=&content='. + CIS_ROOT. index_page(). self::REVIEW_ANRECHNUNG_URI; // Prepare mail content $body_fields = array( diff --git a/application/controllers/lehre/anrechnung/RequestAnrechnung.php b/application/controllers/lehre/anrechnung/RequestAnrechnung.php index ae9b062b0..cec195d63 100644 --- a/application/controllers/lehre/anrechnung/RequestAnrechnung.php +++ b/application/controllers/lehre/anrechnung/RequestAnrechnung.php @@ -325,7 +325,10 @@ class requestAnrechnung extends Auth_Controller } // Link to Antrag genehmigen - $url = site_url(self::APPROVE_ANRECHNUNG_URI); + $url = + CIS_ROOT. 'cis/index.php?menu='. + CIS_ROOT. 'cis/menu.php?content_id=&content='. + CIS_ROOT. index_page(). self::APPROVE_ANRECHNUNG_URI; // Prepare mail content $body_fields = array( diff --git a/application/controllers/lehre/anrechnung/ReviewAnrechnungUebersicht.php b/application/controllers/lehre/anrechnung/ReviewAnrechnungUebersicht.php index 6f777736f..8bad59d38 100644 --- a/application/controllers/lehre/anrechnung/ReviewAnrechnungUebersicht.php +++ b/application/controllers/lehre/anrechnung/ReviewAnrechnungUebersicht.php @@ -248,7 +248,10 @@ class reviewAnrechnungUebersicht extends Auth_Controller } // Link to Antrag genehmigen - $url = site_url(self::APPROVE_ANRECHNUNG_URI); + $url = + CIS_ROOT. 'cis/index.php?menu='. + CIS_ROOT. 'cis/menu.php?content_id=&content='. + CIS_ROOT. index_page(). self::APPROVE_ANRECHNUNG_URI; // Prepare mail content $body_fields = array( From ce794d0e548a5b98129ccfe85c140a961b236c96 Mon Sep 17 00:00:00 2001 From: Cris Date: Thu, 28 Jan 2021 18:55:02 +0100 Subject: [PATCH 070/142] Added important help text for students view regarding applying correclty German only. English will follow. Signed-off-by: cris-technikum --- .../lehre/anrechnung/requestAnrechnung.php | 2 + .../anrechnung/requestAnrechnungImportant.php | 75 +++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 application/views/lehre/anrechnung/requestAnrechnungImportant.php diff --git a/application/views/lehre/anrechnung/requestAnrechnung.php b/application/views/lehre/anrechnung/requestAnrechnung.php index bdf0775ac..b37178bbc 100644 --- a/application/views/lehre/anrechnung/requestAnrechnung.php +++ b/application/views/lehre/anrechnung/requestAnrechnung.php @@ -183,6 +183,8 @@ $this->load->view( anrechnung_id)? ': '. $this->p->t('anrechnung', 'deadlineUeberschritten') : ''; ?>
    +
    + load->view('lehre/anrechnung/requestAnrechnungImportant'); ?>
    diff --git a/application/views/lehre/anrechnung/requestAnrechnungImportant.php b/application/views/lehre/anrechnung/requestAnrechnungImportant.php new file mode 100644 index 000000000..d0c3d7110 --- /dev/null +++ b/application/views/lehre/anrechnung/requestAnrechnungImportant.php @@ -0,0 +1,75 @@ +
    +
    + +
    +
    + Bitte laden Sie den Antrag in deutscher oder englischer Sprache für das +
      +
    • Wintersemester spätestens bis 15. September
    • +
    • Sommersemester spätestens bis 22. Februar hoch
    • +
    +
    Die Entscheidung über den Antrag erfolgt in der Regel innerhalb von zwei Wochen ab dem 15. September + bzw. 22. Februar. +

    Für jede Lehrveranstaltung ist ein gesonderter Antrag beizubringen. +
    +
    +
    +
    + +
    +
    +
    Beantragung aufgrund eines Zeugnisses
    + Bitte laden Sie das Zeugnis und weitere Nachweis-Dokumente (z.B. Syllabus, Lehrpläne, + Modulbeschreibung…) hoch. +

    Die folgenden Informationen müssen enthalten sein: +
      +
    1. Name der das Zeugnis ausstellenden Institution
    2. +
    3. Beschreibung der Lehrinhalte und / oder Lernergebnisse
    4. +
    5. Zeitlicher Umfang der Lehrveranstaltung (z. B. SWS, ECTS, Unterrichtsstunden…)
    6. +
    +
    +
    Beantragung aufgrund nachgewiesener beruflicher Praxis
    + Soll die Anrechnung auf der Grundlage der beruflichen Praxis erfolgen, laden Sie bitte eine detaillierte + Tätigkeitsbeschreibung hoch. Dies kann durch betriebliche Ausbildungsnachweise und / oder Nachweise von + einschlägigen beruflichen Tätigkeiten mit Zeitangaben (z. B. durch ein qualifiziertes Arbeitszeugnis + oder durch Bestätigungen des Arbeitgebers) erfolgen. +

    Falls diese Informationen nicht enthalten sind, können wir den Antrag nicht prüfen und er wird abgelehnt. +
    +
    +
    +
    + +
    +
    +
    Beantragung aufgrund eines Zeugnisses
    + Bitte geben Sie an, wo Sie die Kenntnisse erworben haben: (Hoch-)Schultyp, Standort, Fachrichtung. + Beispiel Schule: HTL Mödling, Fahrzeugtechnik; Beispiel Hochschule: TU Wien, Bachelor + Wirtschaftsinformatik +
    +
    Beantragung aufgrund nachgewiesener beruflicher Praxis
    + Bitte geben Sie Unternehmen, Position und Funktion sowie Dauer der Beschäftigung an. +
    +
    +
    +
    \ No newline at end of file From aff6e2ed8afa44965cd98d3289ded85a91ef6146 Mon Sep 17 00:00:00 2001 From: Cris Date: Thu, 28 Jan 2021 19:07:19 +0100 Subject: [PATCH 071/142] Changed: Now "Herkunft der Kenntnisse" are required Signed-off-by: cris-technikum --- .../controllers/lehre/anrechnung/RequestAnrechnung.php | 2 ++ application/views/lehre/anrechnung/requestAnrechnung.php | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/application/controllers/lehre/anrechnung/RequestAnrechnung.php b/application/controllers/lehre/anrechnung/RequestAnrechnung.php index cec195d63..0414b9940 100644 --- a/application/controllers/lehre/anrechnung/RequestAnrechnung.php +++ b/application/controllers/lehre/anrechnung/RequestAnrechnung.php @@ -54,6 +54,8 @@ class requestAnrechnung extends Auth_Controller $this->_setAuthUID(); $this->setControllerId(); +// $this->_uid = 'wd15k002'; + $this->_uid = 'be18b106'; } public function index() diff --git a/application/views/lehre/anrechnung/requestAnrechnung.php b/application/views/lehre/anrechnung/requestAnrechnung.php index b37178bbc..fe22a006c 100644 --- a/application/views/lehre/anrechnung/requestAnrechnung.php +++ b/application/views/lehre/anrechnung/requestAnrechnung.php @@ -161,7 +161,7 @@ $this->load->view( p->t('anrechnung', 'herkunftDerKenntnisse'); ?>
    - +
    @@ -174,8 +174,8 @@ $this->load->view(
    -
    - Status: status; ?> +
    + Status: status; ?>
    From 106cbe8194b8017aa5eed3fd23a5b4cc66ba18ba Mon Sep 17 00:00:00 2001 From: Cris Date: Thu, 28 Jan 2021 19:07:19 +0100 Subject: [PATCH 072/142] HOTFIX: Removed test-UIDS! Signed-off-by: cris-technikum --- application/views/lehre/anrechnung/requestAnrechnung.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/application/views/lehre/anrechnung/requestAnrechnung.php b/application/views/lehre/anrechnung/requestAnrechnung.php index b37178bbc..fe22a006c 100644 --- a/application/views/lehre/anrechnung/requestAnrechnung.php +++ b/application/views/lehre/anrechnung/requestAnrechnung.php @@ -161,7 +161,7 @@ $this->load->view( p->t('anrechnung', 'herkunftDerKenntnisse'); ?>
    - +
    @@ -174,8 +174,8 @@ $this->load->view(
    -
    - Status: status; ?> +
    + Status: status; ?>
    From 8ba7744acbde3af9a8780b38d4ce8d367286e6de Mon Sep 17 00:00:00 2001 From: Cris Date: Fri, 29 Jan 2021 08:23:25 +0100 Subject: [PATCH 073/142] HOTFIX: Removed test-UIDS! Signed-off-by: cris-technikum --- application/controllers/lehre/anrechnung/RequestAnrechnung.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/application/controllers/lehre/anrechnung/RequestAnrechnung.php b/application/controllers/lehre/anrechnung/RequestAnrechnung.php index 0414b9940..cec195d63 100644 --- a/application/controllers/lehre/anrechnung/RequestAnrechnung.php +++ b/application/controllers/lehre/anrechnung/RequestAnrechnung.php @@ -54,8 +54,6 @@ class requestAnrechnung extends Auth_Controller $this->_setAuthUID(); $this->setControllerId(); -// $this->_uid = 'wd15k002'; - $this->_uid = 'be18b106'; } public function index() From 70d02e25f9457453159bdb46e7f75fc8196a08ba Mon Sep 17 00:00:00 2001 From: Cris Date: Fri, 29 Jan 2021 11:54:52 +0100 Subject: [PATCH 074/142] Removed doublecheck of last status Signed-off-by: cris-technikum --- .../lehre/anrechnung/RequestAnrechnung.php | 34 +++++-------------- application/libraries/AnrechnungLib.php | 8 ++++- 2 files changed, 15 insertions(+), 27 deletions(-) diff --git a/application/controllers/lehre/anrechnung/RequestAnrechnung.php b/application/controllers/lehre/anrechnung/RequestAnrechnung.php index cec195d63..6317ead1b 100644 --- a/application/controllers/lehre/anrechnung/RequestAnrechnung.php +++ b/application/controllers/lehre/anrechnung/RequestAnrechnung.php @@ -9,6 +9,7 @@ class requestAnrechnung extends Auth_Controller const ANRECHNUNGSTATUS_PROGRESSED_BY_STGL = 'inProgressDP'; const ANRECHNUNGSTATUS_PROGRESSED_BY_KF = 'inProgressKF'; + const ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR = 'inProgressLektor'; const ANRECHNUNGSTATUS_APPROVED = 'approved'; const ANRECHNUNGSTATUS_REJECTED = 'rejected'; @@ -77,10 +78,13 @@ class requestAnrechnung extends Auth_Controller show_error(getError($anrechnungData)); } - // Overwrite progress status for student view. If no Anrechnung exists yet, set to new. - $anrechnungData->status = empty($anrechnungData->status) - ? getUserLanguage() == 'German' ? 'neu' : 'new' - : $this->_getLastAnrechnungstatus($anrechnungData->anrechnung_id); + // Dont show who is progressing the application to the student + if ($anrechnungData->status_kurzbz == self::ANRECHNUNGSTATUS_PROGRESSED_BY_STGL || + $anrechnungData->status_kurzbz == self::ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR || + $anrechnungData->status_kurzbz == self::ANRECHNUNGSTATUS_PROGRESSED_BY_KF) + { + $anrechnungData->status = getUserLanguage() == 'German' ? 'in Bearbeitung' : 'in process'; + } $viewData = array( 'antragData' => $this->anrechnunglib->getAntragData($this->_uid, $studiensemester_kurzbz, $lehrveranstaltung_id), @@ -279,28 +283,6 @@ class requestAnrechnung extends Auth_Controller return $result; } - /** - * Get last Anrechnungstatus. Modify progress status for student view. - * @param $anrechnung_id - * @return string - */ - private function _getLastAnrechnungstatus($anrechnung_id) - { - $result = $this->AnrechnungModel->getLastAnrechnungstatus($anrechnung_id); - $status_kurzbz = getData($result)[0]->status_kurzbz; - - // Dont show who is progressing the application - if ($status_kurzbz == 'inProgressDP' || $status_kurzbz == 'inProgressKF') - { - return getUserLanguage() == 'German' ? 'in Bearbeitung' : 'in process'; - } - else - { - $status_mehrsprachig = getData($result)[0]->bezeichnung_mehrsprachig; - return getUserLanguage() == 'German' ? $status_mehrsprachig[0] : $status_mehrsprachig[1]; - } - } - /** * Send mail to STGL (if not available, send to STGL assistance) * @param $mail_params diff --git a/application/libraries/AnrechnungLib.php b/application/libraries/AnrechnungLib.php index 10f21f1b6..503d1afca 100644 --- a/application/libraries/AnrechnungLib.php +++ b/application/libraries/AnrechnungLib.php @@ -127,7 +127,8 @@ class AnrechnungLib $anrechnung_data->insertvon = ''; $anrechnung_data->studiensemester_kurzbz = ''; $anrechnung_data->empfehlung = ''; - $anrechnung_data->status = ''; + $anrechnung_data->status_kurzbz = ''; + $anrechnung_data->status = getUserLanguage() == 'German' ? 'neu' : 'new'; $anrechnung_data->dokumentname = ''; $result = $this->ci->AnrechnungModel->loadWhere(array('lehrveranstaltung_id' => $lehrveranstaltung_id)); @@ -500,9 +501,14 @@ class AnrechnungLib $anrechnung_data->studiensemester_kurzbz= $anrechnung->studiensemester_kurzbz; $anrechnung_data->empfehlung= $anrechnung->empfehlung_anrechnung; + // Get last status_kurzbz + $result = $this->ci->AnrechnungModel->getLastAnrechnungstatus($anrechnung->anrechnung_id); + $anrechnung_data->status_kurzbz = $result->retval[0]->status_kurzbz; + // Get last status bezeichnung in the users language $anrechnung_data->status = $this->getLastAnrechnungstatus($anrechnung->anrechnung_id); + // Get document name $this->ci->DmsVersionModel->addSelect('name'); $result = $this->ci->DmsVersionModel->loadWhere(array('dms_id' => $anrechnung->dms_id)); From 907ecca333cbcc5f784eb01b373445d6e9b1ca82 Mon Sep 17 00:00:00 2001 From: Cris Date: Fri, 29 Jan 2021 11:55:27 +0100 Subject: [PATCH 075/142] Added coloured status alert in students view Signed-off-by: cris-technikum --- .../lehre/anrechnung/requestAnrechnung.php | 80 +++++++++++-------- .../js/lehre/anrechnung/requestAnrechnung.js | 27 +++++++ 2 files changed, 73 insertions(+), 34 deletions(-) create mode 100644 public/js/lehre/anrechnung/requestAnrechnung.js diff --git a/application/views/lehre/anrechnung/requestAnrechnung.php b/application/views/lehre/anrechnung/requestAnrechnung.php index fe22a006c..fd577142b 100644 --- a/application/views/lehre/anrechnung/requestAnrechnung.php +++ b/application/views/lehre/anrechnung/requestAnrechnung.php @@ -15,30 +15,32 @@ $this->load->view( ), 'ui' => array( 'hilfeZuDieserSeite', - 'hochladen' + 'hochladen' ), - 'person' => array( - 'student', - 'personenkennzeichen' - ), - 'lehre' => array( - 'studiensemester', - 'studiengang', - 'lehrveranstaltung', - 'ects', - 'lektor', - ) + 'person' => array( + 'student', + 'personenkennzeichen' + ), + 'lehre' => array( + 'studiensemester', + 'studiengang', + 'lehrveranstaltung', + 'ects', + 'lektor', + ) ), 'customJSs' => array( - 'public/js/bootstrapper.js' - ) + 'public/js/bootstrapper.js', + 'public/js/lehre/anrechnung/requestAnrechnung.js' + + ) ) ); ?>
    -
    +
    - - 'requestAnrechnung-form'], ['lv_id' => $antragData->lv_id, 'studiensemester' => $antragData->studiensemester_kurzbz] ); ?> @@ -65,14 +67,15 @@ $this->load->view(
    - p->t('anrechnung', 'antrag'); ?> - p->t('anrechnung', 'antragdatum'); ?>: anrechnung_id) ? $anrechnungData->insertamum : '-' ?> + p->t('anrechnung', 'antrag'); ?> + p->t('anrechnung', 'antragdatum'); ?>: anrechnung_id) ? $anrechnungData->insertamum : '-' ?>
    - + @@ -99,7 +102,7 @@ $this->load->view( @@ -142,10 +145,14 @@ $this->load->view(
    - > + >
    - dms_id)): ?> - dokumentname ?> + dms_id)): ?> + dokumentname ?>
    @@ -161,7 +168,8 @@ $this->load->view( p->t('anrechnung', 'herkunftDerKenntnisse'); ?>
    - +
    @@ -173,18 +181,22 @@ $this->load->view( -
    -
    - Status: status; ?> +
    +
    + Status: + + status; ?> +
    - +
    - p->t('global', 'bearbeitungGesperrt'); ?> - anrechnung_id)? ': '. $this->p->t('anrechnung', 'deadlineUeberschritten') : ''; ?> + p->t('global', 'bearbeitungGesperrt'); ?> + anrechnung_id) ? ': ' . $this->p->t('anrechnung', 'deadlineUeberschritten') : ''; ?>
    - +
    - load->view('lehre/anrechnung/requestAnrechnungImportant'); ?> + load->view('lehre/anrechnung/requestAnrechnungImportant'); ?>
    @@ -194,7 +206,7 @@ $this->load->view( value="p->t('anrechnung', 'anrechnungBeantragen'); ?>" >
    - + diff --git a/public/js/lehre/anrechnung/requestAnrechnung.js b/public/js/lehre/anrechnung/requestAnrechnung.js new file mode 100644 index 000000000..71ad2e51f --- /dev/null +++ b/public/js/lehre/anrechnung/requestAnrechnung.js @@ -0,0 +1,27 @@ +const ANRECHNUNGSTATUS_APPROVED = 'approved'; +const ANRECHNUNGSTATUS_REJECTED = 'rejected'; + +$(function(){ + // Set status alert color + requestAnrechnung.setStatusAlertColor(); +}) + +var requestAnrechnung = { + setStatusAlertColor: function () { + let status_kurzbz = $('#requestAnrechnung-status_kurzbz').data('status_kurzbz'); + + switch (status_kurzbz) { + case ANRECHNUNGSTATUS_APPROVED: + $('#requestAnrechnung-status_kurzbz').closest('div').addClass('alert-success'); + break; + case ANRECHNUNGSTATUS_REJECTED: + $('#requestAnrechnung-status_kurzbz').closest('div').addClass('alert-danger'); + break; + case '': + $('#requestAnrechnung-status_kurzbz').closest('div').addClass('alert-info'); + break; + default: + $('#requestAnrechnung-status_kurzbz').closest('div').addClass('alert-warning'); + } + } +} \ No newline at end of file From a218b3632343bc349b1086f2d5468db234b41705 Mon Sep 17 00:00:00 2001 From: Cris Date: Mon, 1 Feb 2021 10:03:18 +0100 Subject: [PATCH 076/142] Added getUID() by prestudentID - method to Prestudent Model Signed-off-by: cris-technikum --- application/models/crm/Prestudent_model.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/application/models/crm/Prestudent_model.php b/application/models/crm/Prestudent_model.php index 2e014800c..4ac78cb35 100644 --- a/application/models/crm/Prestudent_model.php +++ b/application/models/crm/Prestudent_model.php @@ -13,6 +13,27 @@ class Prestudent_model extends DB_Model $this->load->model('crm/prestudentstatus_model', 'PrestudentstatusModel'); } + + /** + * Get students UID by PrestudentID. + * @param $prestudent_id + * @return mixed + */ + public function getUID($prestudent_id) + { + $this->addSelect('uid'); + $this->addJoin('public.tbl_person', 'person_id'); + $this->addJoin('public.tbl_benutzer ', 'person_id'); + + $result = $this->load($prestudent_id); + + if (!hasData($result)) + { + show_error('Failed getting UID by prestudent_id'); + } + + return $result->retval[0]->uid; + } /** * getLastStatuses From a0658a61c344f27077ce347771d0d48838ed15e5 Mon Sep 17 00:00:00 2001 From: Cris Date: Mon, 1 Feb 2021 10:06:05 +0100 Subject: [PATCH 077/142] Added lectors Detail VIEW to review and recommend Anrechnung Signed-off-by: cris-technikum --- .../approveAnrechnungUebersicht.php | 2 +- .../anrechnung/reviewAnrechnungDetail.php | 152 ++++++++++++++++++ .../lehre/anrechnung/reviewAnrechnungInfo.php | 90 +++++++++++ .../anrechnung/reviewAnrechnungUebersicht.php | 2 +- ...nungUebersicht.js => approveAnrechnung.js} | 25 ++- ...hnungUebersicht.js => reviewAnrechnung.js} | 25 ++- 6 files changed, 292 insertions(+), 4 deletions(-) create mode 100644 application/views/lehre/anrechnung/reviewAnrechnungDetail.php create mode 100644 application/views/lehre/anrechnung/reviewAnrechnungInfo.php rename public/js/lehre/anrechnung/{approveAnrechnungUebersicht.js => approveAnrechnung.js} (93%) rename public/js/lehre/anrechnung/{reviewAnrechnungUebersicht.js => reviewAnrechnung.js} (92%) diff --git a/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php b/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php index a19b13d57..1ec8cd310 100644 --- a/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php +++ b/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php @@ -69,7 +69,7 @@ $this->load->view( ), 'customJSs' => array( 'public/js/bootstrapper.js', - 'public/js/lehre/anrechnung/approveAnrechnungUebersicht.js' + 'public/js/lehre/anrechnung/approveAnrechnung.js' ) ) ); diff --git a/application/views/lehre/anrechnung/reviewAnrechnungDetail.php b/application/views/lehre/anrechnung/reviewAnrechnungDetail.php new file mode 100644 index 000000000..7a22abcc1 --- /dev/null +++ b/application/views/lehre/anrechnung/reviewAnrechnungDetail.php @@ -0,0 +1,152 @@ +load->view( + 'templates/FHC-Header', + array( + 'title' => $this->p->t('anrechnung', 'anrechnungenPruefen'), + 'jquery' => true, + 'bootstrap' => true, + 'fontawesome' => true, + 'ajaxlib' => true, + 'dialoglib' => true, + 'phrases' => array( + 'global' => array( + 'anerkennungNachgewiesenerKenntnisse', + 'antragStellen' + ), + 'ui' => array( + 'hilfeZuDieserSeite', + 'hochladen' + ), + 'person' => array( + 'student', + 'personenkennzeichen' + ), + 'lehre' => array( + 'studiensemester', + 'studiengang', + 'lehrveranstaltung', + 'ects', + 'lektor', + ) + ), + 'customJSs' => array( + 'public/js/bootstrapper.js', + 'public/js/lehre/anrechnung/reviewAnrechnung.js' + + ) + ) +); +?> + + +
    +
    + +
    + +
    + +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    + p->t('anrechnung', 'antrag'); ?> + p->t('anrechnung', 'antragdatum'); ?>: anrechnung_id) ? $anrechnungData->insertamum : '-' ?> +
    +
    p->t('person', 'student'); ?>vorname. ' '. $antragData->nachname; ?>vorname . ' ' . $antragData->nachname; ?>
    p->t('person', 'personenkennzeichen'); ?> lektoren) - 1 ?> lektoren as $key => $lektor): ?> - vorname. ' '. $lektor->nachname; + vorname . ' ' . $lektor->nachname; echo $key === $len ? '' : ', ' ?>
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    p->t('person', 'student'); ?>vorname . ' ' . $antragData->nachname; ?>
    p->t('person', 'personenkennzeichen'); ?>matrikelnr ?>
    p->t('lehre', 'studiensemester'); ?>studiensemester_kurzbz ?>
    p->t('lehre', 'studiengang'); ?>stg_bezeichnung ?>
    p->t('lehre', 'lehrveranstaltung'); ?>lv_bezeichnung ?>
    p->t('lehre', 'ects'); ?>ects ?>
    p->t('lehre', 'lektorInnen'); ?> + lektoren) - 1 ?> + lektoren as $key => $lektor): ?> + vorname . ' ' . $lektor->nachname; + echo $key === $len ? '' : ', ' ?> + +
    p->t('anrechnung', 'herkunftDerKenntnisse'); ?>anmerkung ?>
    p->t('anrechnung', 'nachweisdokumente'); ?> + dokumentname ?> +
    +
    +
    +
    + +
    +
    +
    + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + Status: + + status; ?> + +
    +
    + load->view('lehre/anrechnung/reviewAnrechnungInfo'); ?> +
    + + + + + + +load->view('templates/FHC-Footer'); ?> diff --git a/application/views/lehre/anrechnung/reviewAnrechnungInfo.php b/application/views/lehre/anrechnung/reviewAnrechnungInfo.php new file mode 100644 index 000000000..82355a86f --- /dev/null +++ b/application/views/lehre/anrechnung/reviewAnrechnungInfo.php @@ -0,0 +1,90 @@ +
    +
    + +
    +
    + Eine Anerkennung setzt voraus, dass die erworbenen Kenntnisse mit dem Inhalt und Umfang der Lehrveranstaltung gleichwertig sind. +

    Wenn die Gleichwertigkeit gegeben ist, können auch außerhochschulisch erworbene Kenntnisse angerechnet werden (z.B. Sekundarschule, Weiterbildungseinrichtungen). +

    + Umfangmäßige Gleichwertigkeit Schule - Hochschule: +
    1 ECTS an der FH Technikum Wien entspricht einem Arbeitsaufwand von 25 Stunden, ein Schulhalbjahr besteht aus ca. 20 Wochen. +
    Das heißt eine Unterrichtsstunde pro Woche sind insgesamt ca. 20 Stunden. +
    +
    +
    +
    + +
    +
    + Die Entscheidung über den Antrag durch die Studiengangsleitung sollte +
      +
    • innerhalb von zwei Wochen ab dem 15. September (Wintersemester)
    • +
    • innerhalb von zwei Wochen ab dem 22. Februar (Sommersemester) erfolgen
    • +
    +
    +
    +
    +
    + +
    +
    +
    Beantragung aufgrund eines Zeugnisses
    + Falls für den Nachweis der Gleichwertigkeit in Bundesgesetzblättern veröffentlichte Lehrpläne (vgl. HTL, HAK…) verwendet werden, sind entweder nur die für die Anrechnung relevanten Teile hochzuladen oder entsprechend zu markieren. +

    Die folgenden Informationen müssen enthalten sein: +
      +
    1. Name der das Zeugnis ausstellenden Institution
    2. +
    3. Beschreibung der Lehrinhalte und / oder Lernergebnisse
    4. +
    5. Zeitlicher Umfang der Lehrveranstaltung (z. B. SWS, ECTS, Unterrichtsstunden…)
    6. +
    +
    +
    Beantragung aufgrund nachgewiesener beruflicher Praxis
    + Es wird eine detaillierte Tätigkeitsbeschreibung benötigt. Dies kann durch betriebliche Ausbildungsnachweise und / oder Nachweise von + einschlägigen beruflichen Tätigkeiten mit Zeitangaben (z. B. durch ein qualifiziertes Arbeitszeugnis + oder durch Bestätigungen des Arbeitgebers) erfolgen. +

    Falls diese Informationen nicht enthalten sind, kann der Antrag nicht geprüft werden und er wird abgelehnt. +
    +
    +
    +
    + +
    +
    +
    Beantragung aufgrund eines Zeugnisses
    + Angabe, wo die Kenntnisse erworben worden sind: (Hoch-)Schultyp, Standort, Fachrichtung. + Beispiel Schule: HTL Mödling, Fahrzeugtechnik; Beispiel Hochschule: TU Wien, Bachelor + Wirtschaftsinformatik +
    +
    Beantragung aufgrund nachgewiesener beruflicher Praxis
    + Angabe von Unternehmen, Position und Funktion sowie Dauer der Beschäftigung. +
    +
    +
    +
    \ No newline at end of file diff --git a/application/views/lehre/anrechnung/reviewAnrechnungUebersicht.php b/application/views/lehre/anrechnung/reviewAnrechnungUebersicht.php index 6ad6d9553..c52fa75ea 100644 --- a/application/views/lehre/anrechnung/reviewAnrechnungUebersicht.php +++ b/application/views/lehre/anrechnung/reviewAnrechnungUebersicht.php @@ -68,7 +68,7 @@ $this->load->view( ), 'customJSs' => array( 'public/js/bootstrapper.js', - 'public/js/lehre/anrechnung/reviewAnrechnungUebersicht.js' + 'public/js/lehre/anrechnung/reviewAnrechnung.js' ) ) ); diff --git a/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js b/public/js/lehre/anrechnung/approveAnrechnung.js similarity index 93% rename from public/js/lehre/anrechnung/approveAnrechnungUebersicht.js rename to public/js/lehre/anrechnung/approveAnrechnung.js index d8d73b0e4..bcbf0695d 100644 --- a/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js +++ b/public/js/lehre/anrechnung/approveAnrechnung.js @@ -116,6 +116,9 @@ $(function(){ $('#tableWidgetTabulator').tabulator('redraw', true); }); + // Set status alert color + approveAnrechnung.setStatusAlertColor(); + // Show only rows with empfohlene + noch nicht genehmigte/abgelehnte anrechnungen $("#show-recommended").click(function(){ $('#tableWidgetTabulator').tabulator('setFilter', @@ -341,4 +344,24 @@ $(function(){ ); }); -}); \ No newline at end of file +}); + +var approveAnrechnung = { + setStatusAlertColor: function () { + let status_kurzbz = $('#requestAnrechnung-status_kurzbz').data('status_kurzbz'); + + switch (status_kurzbz) { + case ANRECHNUNGSTATUS_APPROVED: + $('#requestAnrechnung-status_kurzbz').closest('div').addClass('alert-success'); + break; + case ANRECHNUNGSTATUS_REJECTED: + $('#requestAnrechnung-status_kurzbz').closest('div').addClass('alert-danger'); + break; + case '': + $('#requestAnrechnung-status_kurzbz').closest('div').addClass('alert-info'); + break; + default: + $('#requestAnrechnung-status_kurzbz').closest('div').addClass('alert-warning'); + } + } +} \ No newline at end of file diff --git a/public/js/lehre/anrechnung/reviewAnrechnungUebersicht.js b/public/js/lehre/anrechnung/reviewAnrechnung.js similarity index 92% rename from public/js/lehre/anrechnung/reviewAnrechnungUebersicht.js rename to public/js/lehre/anrechnung/reviewAnrechnung.js index fb2c45ac0..90865ade5 100644 --- a/public/js/lehre/anrechnung/reviewAnrechnungUebersicht.js +++ b/public/js/lehre/anrechnung/reviewAnrechnung.js @@ -114,6 +114,9 @@ $(function(){ $('#tableWidgetTabulator').tabulator('redraw', true); }); + // Set status alert color + reviewAnrechnung.setStatusAlertColor(); + // Show only rows with anrechnungen ohne Empfehlung $("#show-need-recommendation").click(function(){ $('#tableWidgetTabulator').tabulator('setFilter', @@ -285,4 +288,24 @@ $(function(){ ); }); -}); \ No newline at end of file +}); + +var reviewAnrechnung = { + setStatusAlertColor: function () { + let status_kurzbz = $('#reviewAnrechnung-status_kurzbz').data('status_kurzbz'); + + switch (status_kurzbz) { + case ANRECHNUNGSTATUS_APPROVED: + $('#reviewAnrechnung-status_kurzbz').closest('div').addClass('alert-success'); + break; + case ANRECHNUNGSTATUS_REJECTED: + $('#reviewAnrechnung-status_kurzbz').closest('div').addClass('alert-danger'); + break; + case '': + $('#reviewAnrechnung-status_kurzbz').closest('div').addClass('alert-info'); + break; + default: + $('#reviewAnrechnung-status_kurzbz').closest('div').addClass('alert-warning'); + } + } +} \ No newline at end of file From da3720e65d697bc9fac39e30e2022b5f97f806d5 Mon Sep 17 00:00:00 2001 From: Cris Date: Mon, 1 Feb 2021 10:11:57 +0100 Subject: [PATCH 078/142] Added lectors detail view CONTROLLER + adaptations to AnrechnungLib + phrases Signed-off-by: cris-technikum --- .../anrechnung/ReviewAnrechnungDetail.php | 309 ++++++++++++++++++ application/libraries/AnrechnungLib.php | 4 + system/phrasesupdate.php | 40 +++ 3 files changed, 353 insertions(+) create mode 100644 application/controllers/lehre/anrechnung/ReviewAnrechnungDetail.php diff --git a/application/controllers/lehre/anrechnung/ReviewAnrechnungDetail.php b/application/controllers/lehre/anrechnung/ReviewAnrechnungDetail.php new file mode 100644 index 000000000..f4c92b7fb --- /dev/null +++ b/application/controllers/lehre/anrechnung/ReviewAnrechnungDetail.php @@ -0,0 +1,309 @@ + 'lehre/anrechnung_empfehlen:rw', + 'download' => 'lehre/anrechnung_empfehlen:rw', + 'recommend' => 'lehre/anrechnung_empfehlen:rw', + 'dontRecommend' => 'lehre/anrechnung_empfehlen:rw' + ) + ); + + // Load models + $this->load->model('education/Anrechnung_model', 'AnrechnungModel'); + $this->load->model('education/Anrechnungstatus_model', 'AnrechnungstatusModel'); + $this->load->model('content/DmsVersion_model', 'DmsVersionModel'); + $this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel'); + $this->load->model('crm/Prestudent_model', 'PrestudentModel'); + + // Load libraries + $this->load->library('WidgetLib'); + $this->load->library('PermissionLib'); + $this->load->library('AnrechnungLib'); + $this->load->library('DmsLib'); + + // Load helpers + $this->load->helper('form'); + $this->load->helper('url'); + $this->load->helper('hlp_sancho_helper'); + + // Load language phrases + $this->loadPhrases( + array( + 'global', + 'ui', + 'anrechnung', + 'person', + 'lehre', + 'table' + ) + ); + + $this->_setAuthUID(); + + $this->setControllerId(); + } + + public function index() + { + $anrechnung_id = $this->input->get('anrechnung_id'); + + if (!is_numeric($anrechnung_id)) + { + show_error('Missing correct parameter'); + } + + // Get Anrechung data + $result = $this->anrechnunglib->getAnrechnungData($anrechnung_id); + if (!$anrechnungData = getData($result)) + { + show_error(getError($anrechnungData)); + } + + $viewData = array( + 'antragData' => $this->anrechnunglib->getAntragData( + $student_uid = $this->PrestudentModel->getUID($anrechnungData->prestudent_id), + $anrechnungData->studiensemester_kurzbz, + $anrechnungData->lehrveranstaltung_id + ), + 'anrechnungData' => $anrechnungData + ); + + $this->load->view('lehre/anrechnung/reviewAnrechnungDetail.php', $viewData); + } + + /** + * Recommend Anrechnungen. + */ + public function recommend() + { + $data = $this->input->post('data'); + + if(isEmptyArray($data)) + { + return $this->outputJsonError('Fehler beim Übertragen der Daten.'); + } + + // Get statusbezeichnung for 'inProgressDP' + $this->AnrechnungstatusModel->addSelect('bezeichnung_mehrsprachig'); + $inProgressDP = getData($this->AnrechnungstatusModel->load('inProgressDP'))[0]; + $inProgressDP = getUserLanguage() == 'German' + ? $inProgressDP->bezeichnung_mehrsprachig[0] + : $inProgressDP->bezeichnung_mehrsprachig[1]; + + foreach ($data as $item) + { + // Approve Anrechnung + if(getData($this->anrechnunglib->recommendAnrechnung($item['anrechnung_id']))) + { + $json[]= array( + 'anrechnung_id' => $item['anrechnung_id'], + 'empfehlung_anrechnung' => 'true', + 'status_kurzbz' => self::ANRECHNUNGSTATUS_PROGRESSED_BY_STGL, + 'status_bezeichnung' => $inProgressDP + ); + } + } + + // Output json to ajax + if (isset($json) && !isEmptyArray($json)) + { + /** + * Send mails to STGL (if not present STGL, send to STGL assistance) + * NOTE: mails are sent at the end to ensure sending only one mail to each STGL + * */ + if (!$this->_sendSanchoMails($json, true)) + { + show_error('Failed sending emails'); + } + + return $this->outputJsonSuccess($json); + } + else + { + return $this->outputJsonError('Empfehlungen wurden nicht durchgeführt'); + } + } + + /** + * Dont recommend Anrechnungen. + */ + public function dontRecommend() + { + $data = $this->input->post('data'); + + if(isEmptyArray($data)) + { + return $this->outputJsonError('Fehler beim Übertragen der Daten.'); + } + + // Get statusbezeichnung for 'inProgressDP' + $this->AnrechnungstatusModel->addSelect('bezeichnung_mehrsprachig'); + $inProgressDP = getData($this->AnrechnungstatusModel->load('inProgressDP'))[0]; + $inProgressDP = getUserLanguage() == 'German' + ? $inProgressDP->bezeichnung_mehrsprachig[0] + : $inProgressDP->bezeichnung_mehrsprachig[1]; + + foreach ($data as $item) + { + // Approve Anrechnung + if(getData($this->anrechnunglib->dontRecommendAnrechnung($item['anrechnung_id']))) + { + $json[]= array( + 'anrechnung_id' => $item['anrechnung_id'], + 'empfehlung_anrechnung' => 'false', + 'status_kurzbz' => self::ANRECHNUNGSTATUS_PROGRESSED_BY_STGL, + 'status_bezeichnung' => $inProgressDP + ); + } + } + + // Output json to ajax + if (isset($json) && !isEmptyArray($json)) + { + // Send mails to STGL (if not present STGL, send to STGL assistance) + if (!$this->_sendSanchoMails($json, false)) + { + show_error('Failed sending emails'); + } + + return $this->outputJsonSuccess($json); + } + else + { + return $this->outputJsonError('Empfehlungen wurden nicht durchgeführt'); + } + } + + /** + * Download and open uploaded document (Nachweisdokument). + */ + public function download() + { + $dms_id = $this->input->get('dms_id'); + + if (!is_numeric($dms_id)) + { + show_error('Wrong parameter'); + } + + $this->dmslib->download($dms_id); + } + + + /** + * Retrieve the UID of the logged user and checks if it is valid + */ + private function _setAuthUID() + { + $this->_uid = getAuthUID(); + + if (!$this->_uid) show_error('User authentification failed'); + } + + /** + * Send mails to STGL (if not present then to STGL assistance) + * @param $mail_params + * @param $empfehlung + * @return bool + */ + private function _sendSanchoMails($mail_params, $empfehlung) + { + // Get studiengaenge + $studiengang_kz_arr = array(); + + foreach ($mail_params as $item) + { + $this->AnrechnungModel->addSelect('studiengang_kz'); + $this->AnrechnungModel->addJoin('public.tbl_prestudent', 'prestudent_id'); + + $studiengang_kz_arr[]= $this->AnrechnungModel->load($item['anrechnung_id'])->retval[0]->studiengang_kz; + } + + $studiengang_kz_arr = array_unique($studiengang_kz_arr); + + // Send mail to STGL of each studiengang + foreach ($studiengang_kz_arr as $studiengang_kz) + { + // Get STGL mail address, if available, otherwise get assistance mail address + list ($to, $vorname) = $this->_getSTGLMailAddress($studiengang_kz); + + // Get full name of lector + $this->load->model('person/Person_model', 'PersonModel'); + if (!$lector_name = getData($this->PersonModel->getFullName($this->_uid))) + { + show_error ('Failed retrieving person'); + } + + // Link to Antrag genehmigen + $url = + CIS_ROOT. 'cis/index.php?menu='. + CIS_ROOT. 'cis/menu.php?content_id=&content='. + CIS_ROOT. index_page(). self::APPROVE_ANRECHNUNG_URI; + + // Prepare mail content + $body_fields = array( + 'vorname' => $vorname, + 'lektor_name' => $lector_name, + 'empfehlung' => $empfehlung ? 'positive' : 'negative', + 'link' => anchor($url, 'Anrechnungsanträge Übersicht') + ); + + sendSanchoMail( + 'AnrechnungEmpfehlungAbgeben', + $body_fields, + $to, + 'Neue '. ($empfehlung ? 'positive' : 'negative'). ' Empfehlungen für LV-Anrechnungsanträge' + ); + } + + return true; + } + + // Get STGL mail address, if available, otherwise get assistance mail address + private function _getSTGLMailAddress($stg_kz) + { + $this->load->model('organisation/Studiengang_model', 'StudiengangModel'); + $result = $this->StudiengangModel->getLeitung($stg_kz); + + // Get STGL mail address, if available + if (hasData($result)) + { + return array( + $result->retval[0]->uid. '@'. DOMAIN, + $result->retval[0]->vorname + ); + } + // ...otherwise get assistance mail address + else + { + $result = $this->StudiengangModel->load($stg_kz); + + if (hasData($result)) + { + return array( + $result->retval[0]->email, + '' + ); + } + } + } + +} \ No newline at end of file diff --git a/application/libraries/AnrechnungLib.php b/application/libraries/AnrechnungLib.php index 503d1afca..d86dbbef0 100644 --- a/application/libraries/AnrechnungLib.php +++ b/application/libraries/AnrechnungLib.php @@ -120,6 +120,8 @@ class AnrechnungLib { $anrechnung_data = new StdClass(); $anrechnung_data->anrechnung_id = ''; + $anrechnung_data->prestudent_id = ''; + $anrechnung_data->lehrveranstaltung = ''; $anrechnung_data->begruendung_id = ''; $anrechnung_data->anmerkung = ''; $anrechnung_data->dms_id = ''; @@ -493,6 +495,8 @@ class AnrechnungLib // Get Anrechnung data $anrechnung_data->anrechnung_id = $anrechnung->anrechnung_id; + $anrechnung_data->prestudent_id = $anrechnung->prestudent_id; + $anrechnung_data->lehrveranstaltung_id = $anrechnung->lehrveranstaltung_id; $anrechnung_data->begruendung_id = $anrechnung->begruendung_id; $anrechnung_data->anmerkung = $anrechnung->anmerkung_student; $anrechnung_data->dms_id = $anrechnung->dms_id; diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 7b9d6e799..72a5bbb3e 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -8748,6 +8748,46 @@ Any unusual occurrences 'insertvon' => 'system' ) ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'detailsicht', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Detailsicht', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Details', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'lehre', + 'phrase' => 'lektorInnen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'LektorInnen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Lectors', + 'description' => '', + 'insertvon' => 'system' + ) + ) ) ); From 8fc338ccb481e6709cc852cf1d6b7280486d1fce Mon Sep 17 00:00:00 2001 From: Cris Date: Tue, 2 Feb 2021 13:50:32 +0100 Subject: [PATCH 079/142] Added GUI/functionality to add begruendung for 'NICHT EMPFEHLEN' in lectors overview . Begruendung is added as Notiz . GUI to attach begruendung will slide down the moment 'Nicht Empfehlen' is clicked . added phrases Signed-off-by: cris-technikum --- .../anrechnung/ReviewAnrechnungUebersicht.php | 3 +- application/libraries/AnrechnungLib.php | 14 +- application/models/person/Notiz_model.php | 59 ++++++ .../anrechnung/reviewAnrechnungUebersicht.php | 115 +++++++---- .../js/lehre/anrechnung/reviewAnrechnung.js | 48 ++++- system/phrasesupdate.php | 180 ++++++++++++++++++ 6 files changed, 381 insertions(+), 38 deletions(-) diff --git a/application/controllers/lehre/anrechnung/ReviewAnrechnungUebersicht.php b/application/controllers/lehre/anrechnung/ReviewAnrechnungUebersicht.php index 8bad59d38..ba1b81b17 100644 --- a/application/controllers/lehre/anrechnung/ReviewAnrechnungUebersicht.php +++ b/application/controllers/lehre/anrechnung/ReviewAnrechnungUebersicht.php @@ -159,7 +159,8 @@ class reviewAnrechnungUebersicht extends Auth_Controller foreach ($data as $item) { // Approve Anrechnung - if(getData($this->anrechnunglib->dontRecommendAnrechnung($item['anrechnung_id']))) + if(getData($this->anrechnunglib + ->dontRecommendAnrechnung($item['anrechnung_id'], $item['begruendung']))) { $json[]= array( 'anrechnung_id' => $item['anrechnung_id'], diff --git a/application/libraries/AnrechnungLib.php b/application/libraries/AnrechnungLib.php index d86dbbef0..0f6e2d5ae 100644 --- a/application/libraries/AnrechnungLib.php +++ b/application/libraries/AnrechnungLib.php @@ -10,6 +10,9 @@ class AnrechnungLib const ANRECHNUNGSTATUS_APPROVED = 'approved'; const ANRECHNUNGSTATUS_REJECTED = 'rejected'; + const ANRECHNUNG_NOTIZTITEL_NOTIZ_BY_LEKTOR = 'AnrechnungNotizLektor'; + const ANRECHNUNG_NOTIZTITEL_NOTIZ_BY_STGL = 'AnrechnungNotizSTGL'; + public function __construct() { $this->ci =& get_instance(); @@ -442,7 +445,7 @@ class AnrechnungLib * @return array * @throws Exception */ - public function dontRecommendAnrechnung($anrechnung_id) + public function dontRecommendAnrechnung($anrechnung_id, $begruendung) { // Check last Anrechnungstatus if (!$result = getData($this->ci->AnrechnungModel->getLastAnrechnungstatus($anrechnung_id))[0]) @@ -476,6 +479,15 @@ class AnrechnungLib ) ); + // Add begruendung as notiz + $this->ci->load->model('person/Notiz_model', 'NotizModel'); + $this->ci->NotizModel->addNotizForAnrechnung( + $anrechnung_id, + self::ANRECHNUNG_NOTIZTITEL_NOTIZ_BY_LEKTOR, + $begruendung, + $lektor_uid + ); + // Transaction complete $this->ci->db->trans_complete(); diff --git a/application/models/person/Notiz_model.php b/application/models/person/Notiz_model.php index a5453aaa1..6c67f60a5 100644 --- a/application/models/person/Notiz_model.php +++ b/application/models/person/Notiz_model.php @@ -158,6 +158,65 @@ class Notiz_model extends DB_Model return $this->loadWhere(array('person_id' => $person_id, 'titel LIKE' => $titel)); } + + /** + * Add a Notiz for a given Anrechnung + * @param $anrechnung_id + * @param $titel + * @param $text + * @param $verfasser_uid + * @return array + */ + public function addNotizForAnrechnung($anrechnung_id, $titel, $text, $verfasser_uid) + { + // Loads model Notizzuordnung_model + $this->load->model('person/Notizzuordnung_model', 'NotizzuordnungModel'); + + // Start DB transaction + $this->db->trans_start(false); + + $result = $this->insert(array( + 'titel' => $titel, + 'text' => $text, + 'erledigt' => true, + 'verfasser_uid' => $verfasser_uid, + "insertvon" => $verfasser_uid + )); + + if (isSuccess($result)) + { + $notiz_id = $result->retval; + $result = $this->NotizzuordnungModel->insert(array('notiz_id' => $notiz_id, 'anrechnung_id' => $anrechnung_id)); + } + + // Transaction complete! + $this->db->trans_complete(); + + // Check if everything went ok during the transaction + if ($this->db->trans_status() === false || isError($result)) + { + $this->db->trans_rollback(); + $result = error($result->msg, EXIT_ERROR); + } + else + { + $this->db->trans_commit(); + $result = success($notiz_id); + } + + return $result; + } + + /** + * gets all Notizen for a person + * @param $person_id + */ + public function getNotizByAnrechnung($anrechnung_id) + { + $this->addJoin('public.tbl_notizzuordnung', 'notiz_id'); + + return $this->loadWhere(array('anrechnung' => $anrechnung_id)); + } // ------------------------------------------------------------------------------------------------------ } diff --git a/application/views/lehre/anrechnung/reviewAnrechnungUebersicht.php b/application/views/lehre/anrechnung/reviewAnrechnungUebersicht.php index c52fa75ea..0da952f5f 100644 --- a/application/views/lehre/anrechnung/reviewAnrechnungUebersicht.php +++ b/application/views/lehre/anrechnung/reviewAnrechnungUebersicht.php @@ -12,14 +12,14 @@ $this->load->view( 'dialoglib' => true, 'tablewidget' => true, 'phrases' => array( - 'global' => array( - 'begruendung' - ), - 'anrechnung' => array( - 'nachweisdokumente', - 'empfehlung', - 'herkunft' - ), + 'global' => array( + 'begruendung' + ), + 'anrechnung' => array( + 'nachweisdokumente', + 'empfehlung', + 'herkunft' + ), 'ui' => array( 'anzeigen', 'alleAnzeigen', @@ -34,15 +34,15 @@ $this->load->view( 'tabelleneinstellungen', 'keineDatenVorhanden', 'spaltenEinstellen', - 'ja', - 'nein', - 'nichtSelektierbarAufgrundVon' + 'ja', + 'nein', + 'nichtSelektierbarAufgrundVon' ), 'person' => array( 'student', 'personenkennzeichen', - 'vorname', - 'nachname' + 'vorname', + 'nachname' ), 'lehre' => array( 'studiensemester', @@ -64,7 +64,7 @@ $this->load->view( 'zeilenAuswaehlenEinzeln', 'zeilenAuswaehlenBereich', 'zeilenAuswaehlenAlle' - ) + ) ), 'customJSs' => array( 'public/js/bootstrapper.js', @@ -76,16 +76,16 @@ $this->load->view(
    -
    - -
    - +
    @@ -104,14 +104,54 @@ $this->load->view( ); ?>
    - +
    - load->view('lehre/anrechnung/reviewAnrechnungUebersichtData.php'); ?> + load->view('lehre/anrechnung/reviewAnrechnungUebersichtData.php'); ?> +
    +
    + + +
    +
    @@ -123,37 +163,44 @@ $this->load->view(
    - +
    - - + +
    - + diff --git a/public/js/lehre/anrechnung/reviewAnrechnung.js b/public/js/lehre/anrechnung/reviewAnrechnung.js index 90865ade5..7bf34ef81 100644 --- a/public/js/lehre/anrechnung/reviewAnrechnung.js +++ b/public/js/lehre/anrechnung/reviewAnrechnung.js @@ -230,14 +230,36 @@ $(function(){ ); }); - // Dont recommend Anrechnungen + // Dont recommend Anrechnungen (Overview GUI) $("#dont-recommend-anrechnungen").click(function(){ - // Get selected rows data + + let begruendung_panel = $('#reviewAnrechnungUebersicht-begruendung-panel'); + let begruendung = $('#reviewAnrechnungUebersicht-begruendung').val(); + + + if (begruendung_panel.is(":hidden")) + { + // Show begruendung panel if is hidden + begruendung_panel.slideDown('slow'); + return; + } + else + { + // Check if begruendung is given + if (!begruendung.trim()) // empty or white spaces only + { + FHC_DialogLib.alertInfo('Bitte tragen Sie eine Begründung ein.'); + return; + } + } + + // Get selected rows data and add begruendung let selected_data = $('#tableWidgetTabulator').tabulator('getSelectedData') .map(function(data){ // reduce to necessary fields return { 'anrechnung_id' : data.anrechnung_id, + 'begruendung' : begruendung } }); @@ -259,6 +281,9 @@ $(function(){ 'data': selected_data }; + // Hide begruendung panel again + $(begruendung_panel).slideUp('slow'); + FHC_AjaxClient.ajaxCallPost( FHC_JS_DATA_STORAGE_OBJECT.called_path + "/dontRecommend", data, @@ -288,6 +313,17 @@ $(function(){ ); }); + // Break Begruendung abgeben + $('#reviewAnrechnungUebersicht-begruendung-abbrechen').click(function(){ + $('#reviewAnrechnungUebersicht-begruendung').val(''); + $('#reviewAnrechnungUebersicht-begruendung-panel').slideUp('slow'); + + }) + + // Copy Begruendung into textarea + $(".btn-copyIntoTextarea").click(function(){ + reviewAnrechnung.copyIntoTextarea(this); + }) }); var reviewAnrechnung = { @@ -307,5 +343,13 @@ var reviewAnrechnung = { default: $('#reviewAnrechnung-status_kurzbz').closest('div').addClass('alert-warning'); } + }, + copyIntoTextarea: function(elem){ + + // Find closest textarea + let textarea = $(elem).closest('div').find('textarea'); + + // Copy begruendung into textarea + textarea.val($.trim($(elem).parent().text())); } } \ No newline at end of file diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 72a5bbb3e..32d22b789 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -8788,6 +8788,186 @@ Any unusual occurrences 'insertvon' => 'system' ) ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'empfehlungPositiv', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Anrechnung wird empfohlen, weil die Kenntnisse inhaltlich und umfangmäßig gleichwertig sind.', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Recommendation date', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'empfehlungNegativPruefungNichtMoeglich', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Anrechnung wird nicht empfohlen, weil die Prüfung der Gleichwertigkeit aus formalen Gründen (z.B. mangelhafte Unterlagen) nicht möglich war.', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'empfehlungNegativKenntnisseNichtGleichwertig', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Anrechnung wird nicht empfohlen, weil die Kenntnisse inhaltlich und umfangmäßig nicht gleichwertig sind.', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'empfehlungdatum', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Empfehlungsdatum', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'textUebernehmen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Text übernehmen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Use this text', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'bitteBegruendungAngeben', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Bitte geben Sie eine Begründung für die Ablehnung an', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Please give a reason why you do not recommend to approve this applications', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'moeglicheBegruendungen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Mögliche Begründungen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Possible reasons', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'andereBegruendung', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Andere Begründung', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Other reason', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'begruendungWirdFuerAlleUebernommen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Die Begründung wird für alle gewählten Anträge übernommen.', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'This reason will be used for all of the selected applications.', + 'description' => '', + 'insertvon' => 'system' + ) + ) ) ); From 297c96c3e53f41c809a26f31c94041cf3bc10d63 Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 3 Feb 2021 10:53:51 +0100 Subject: [PATCH 080/142] Changed method getLastAnrechnungstatus() -> added param status_kurzbz Signed-off-by: cris-technikum --- .../models/education/Anrechnung_model.php | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/application/models/education/Anrechnung_model.php b/application/models/education/Anrechnung_model.php index 56d3f3062..ed8adad73 100644 --- a/application/models/education/Anrechnung_model.php +++ b/application/models/education/Anrechnung_model.php @@ -34,10 +34,26 @@ class Anrechnung_model extends DB_Model * @param $anrechnung_id * @return array|null */ - public function getLastAnrechnungstatus($anrechnung_id) + public function getLastAnrechnungstatus($anrechnung_id, $status_kurzbz = null) { + if (is_string($status_kurzbz)) + { + $qry = ' + SELECT * + FROM lehre.tbl_anrechnungstatus + JOIN lehre.tbl_anrechnung_anrechnungstatus USING (status_kurzbz) + WHERE anrechnung_id = ? + AND status_kurzbz = ? + ORDER BY insertamum DESC + LIMIT 1 + '; + + return $this->execQuery($qry, array($anrechnung_id, $status_kurzbz)); + } + + $qry = ' - SELECT status_kurzbz, bezeichnung_mehrsprachig + SELECT * FROM lehre.tbl_anrechnungstatus JOIN lehre.tbl_anrechnung_anrechnungstatus USING (status_kurzbz) WHERE anrechnung_id = ? From b8046aeccf150778014cd632535e0ae1cca923c6 Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 3 Feb 2021 10:55:46 +0100 Subject: [PATCH 081/142] Added insertvon when saving new Anrechnung Signed-off-by: cris-technikum --- application/controllers/lehre/anrechnung/RequestAnrechnung.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/controllers/lehre/anrechnung/RequestAnrechnung.php b/application/controllers/lehre/anrechnung/RequestAnrechnung.php index 6317ead1b..50daa9d58 100644 --- a/application/controllers/lehre/anrechnung/RequestAnrechnung.php +++ b/application/controllers/lehre/anrechnung/RequestAnrechnung.php @@ -157,7 +157,8 @@ class requestAnrechnung extends Auth_Controller 'begruendung_id' => $begruendung_id, 'dms_id' => $uploaddata->retval['dms_id'], 'studiensemester_kurzbz' => $studiensemester_kurzbz, - 'anmerkung_student' => $anmerkung + 'anmerkung_student' => $anmerkung, + 'insertvon' => $this->_uid )); if (isError($result)) From 5235915d6a741642d66d1bf19bef30ef9efed9e6 Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 3 Feb 2021 10:57:27 +0100 Subject: [PATCH 082/142] Changed method getNotizByAnrechnung() -> added param titel Signed-off-by: cris-technikum --- application/models/person/Notiz_model.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/application/models/person/Notiz_model.php b/application/models/person/Notiz_model.php index 6c67f60a5..29e11c1df 100644 --- a/application/models/person/Notiz_model.php +++ b/application/models/person/Notiz_model.php @@ -208,14 +208,24 @@ class Notiz_model extends DB_Model } /** - * gets all Notizen for a person - * @param $person_id + * Get Notiz by Anrechnung and title + * + * @param $anrechnung_id + * @return array */ - public function getNotizByAnrechnung($anrechnung_id) + public function getNotizByAnrechnung($anrechnung_id, $titel = null) { $this->addJoin('public.tbl_notizzuordnung', 'notiz_id'); - return $this->loadWhere(array('anrechnung' => $anrechnung_id)); + if (is_string($titel)) + { + return $this->loadWhere(array( + 'anrechnung_id' => $anrechnung_id, + 'titel' => $titel + )); + } + + return $this->loadWhere(array('anrechnung_id' => $anrechnung_id)); } // ------------------------------------------------------------------------------------------------------ From b13fb0cda86c64fa4d627c8f69f582475624a6f1 Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 3 Feb 2021 11:01:02 +0100 Subject: [PATCH 083/142] Added lector Detail GUI to retrieve and process Empfehlungen Signed-off-by: cris-technikum --- application/libraries/AnrechnungLib.php | 71 ++++++ .../anrechnung/reviewAnrechnungDetail.php | 231 ++++++++++++------ .../anrechnung/reviewAnrechnungDetail.js | 228 +++++++++++++++++ system/phrasesupdate.php | 102 +++++++- 4 files changed, 562 insertions(+), 70 deletions(-) create mode 100644 public/js/lehre/anrechnung/reviewAnrechnungDetail.js diff --git a/application/libraries/AnrechnungLib.php b/application/libraries/AnrechnungLib.php index 0f6e2d5ae..f00cac01b 100644 --- a/application/libraries/AnrechnungLib.php +++ b/application/libraries/AnrechnungLib.php @@ -184,6 +184,77 @@ class AnrechnungLib return $result; } + /** + * Get Empfehlung data object. + * @param $anrechnung_id + * @return array + * @throws Exception + */ + public function getEmpfehlungData($anrechnung_id) + { + if (!is_numeric($anrechnung_id)) + { + show_error('Incorrect parameter'); + } + + $empfehlung_data = new stdClass(); + $empfehlung_data->empfehlung = null; + $empfehlung_data->empfehlung_von = '-'; + $empfehlung_data->empfehlung_am = '-'; + $empfehlung_data->notiz = ''; // Begruendung, if not recommended + + + if(!$anrechnung = getData($this->ci->AnrechnungModel->load($anrechnung_id))[0]) + { + show_error('Failed loading Anrechnung'); + } + + if (is_null($anrechnung->empfehlung_anrechnung)) + { + return success($empfehlung_data); + } + + // If Empfehlung is true or false + if (!is_null($anrechnung->empfehlung_anrechnung)) + { + // Get last lector and date, where recommendation was given + $result = $this->ci->AnrechnungModel->getLastAnrechnungstatus( + $anrechnung_id, + self::ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR + ); + if ($result = getData($result)[0]) + { + $empfehlung_datum = (new DateTime($result->insertamum))->format('d.m.Y'); + } + + // Get full name of lector + $result = $this->ci->PersonModel->getByUID($result->insertvon); + if ($result = getData($result)[0]) + { + $empfehlung_von = $result->vorname. ' '. $result->nachname; + } + + $empfehlung_data->empfehlung = $anrechnung->empfehlung_anrechnung; + $empfehlung_data->empfehlung_von = $empfehlung_von; + $empfehlung_data->empfehlung_am = $empfehlung_datum; + } + + // If Empfehlung is false, retrieve also Notiz with Begruendung + if (!$anrechnung->empfehlung_anrechnung) + { + // Get Ablehnungsbegruendung (only set, if Anrechnung was not recommended yet) + $this->ci->load->model('person/Notiz_model', 'NotizModel'); + $result = $this->ci->NotizModel->getNotizByAnrechnung($anrechnung_id, self::ANRECHNUNG_NOTIZTITEL_NOTIZ_BY_LEKTOR); + if ($notiz = getData($result)[0]) + { + $empfehlung_data->notiz = $notiz->text; + } + } + + return success($empfehlung_data); + + } + /** * Get last Anrechnungstatusbezeichnung in users language. * @param $anrechnung_id diff --git a/application/views/lehre/anrechnung/reviewAnrechnungDetail.php b/application/views/lehre/anrechnung/reviewAnrechnungDetail.php index 7a22abcc1..7b8d29d4c 100644 --- a/application/views/lehre/anrechnung/reviewAnrechnungDetail.php +++ b/application/views/lehre/anrechnung/reviewAnrechnungDetail.php @@ -4,6 +4,7 @@ $this->load->view( array( 'title' => $this->p->t('anrechnung', 'anrechnungenPruefen'), 'jquery' => true, + 'jqueryui' => true, 'bootstrap' => true, 'fontawesome' => true, 'ajaxlib' => true, @@ -29,9 +30,12 @@ $this->load->view( 'lektor', ) ), + 'customCSSs' => array( + 'public/css/Tabulator.css' + ), 'customJSs' => array( 'public/js/bootstrapper.js', - 'public/js/lehre/anrechnung/reviewAnrechnung.js' + 'public/js/lehre/anrechnung/reviewAnrechnungDetail.js' ) ) @@ -55,83 +59,172 @@ $this->load->view(
    + +
    - -
    -
    -
    -
    - p->t('anrechnung', 'antrag'); ?> - p->t('anrechnung', 'antragdatum'); ?>: anrechnung_id) ? $anrechnungData->insertamum : '-' ?> +
    +
    + p->t('anrechnung', 'antrag'); ?> + p->t('anrechnung', 'antragdatum'); ?>: anrechnung_id) ? $anrechnungData->insertamum : '-' ?> +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    p->t('person', 'student'); ?>vorname . ' ' . $antragData->nachname; ?>
    p->t('person', 'personenkennzeichen'); ?>matrikelnr ?>
    p->t('lehre', 'studiensemester'); ?>studiensemester_kurzbz ?>
    p->t('lehre', 'studiengang'); ?>stg_bezeichnung ?>
    p->t('lehre', 'lehrveranstaltung'); ?>lv_bezeichnung ?>
    p->t('lehre', 'ects'); ?>ects ?>
    p->t('lehre', 'lektorInnen'); ?> + lektoren) - 1 ?> + lektoren as $key => $lektor): ?> + vorname . ' ' . $lektor->nachname; + echo $key === $len ? '' : ', ' ?> + +
    p->t('anrechnung', 'herkunftDerKenntnisse'); ?>anmerkung ?>
    p->t('anrechnung', 'nachweisdokumente'); ?> + dokumentname ?> +
    +
    +
    +
    + +
    +
    +
    + +
    + +
    + p->t('anrechnung', 'empfehlung'); ?> +
    + p->t('anrechnung', 'empfehlungVon'); ?>: + empfehlung_von ?> +  |  + p->t('anrechnung', 'empfehlungdatum'); ?>: + empfehlung_am ?> + +
    +
    + +
    + +
    + p->t('anrechnung', 'nochKeineEmpfehlung'); ?> +
    + +
    + p->t('anrechnung', 'empfehlungPositiv'); ?> +
    + +
    +
    p->t('anrechnung', 'empfehlungNegativ'); ?>
    +
    p->t('global', 'begruendung'); ?>: + notiz ?> +
    +
    +
    +
    + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    p->t('person', 'student'); ?>vorname . ' ' . $antragData->nachname; ?>
    p->t('person', 'personenkennzeichen'); ?>matrikelnr ?>
    p->t('lehre', 'studiensemester'); ?>studiensemester_kurzbz ?>
    p->t('lehre', 'studiengang'); ?>stg_bezeichnung ?>
    p->t('lehre', 'lehrveranstaltung'); ?>lv_bezeichnung ?>
    p->t('lehre', 'ects'); ?>ects ?>
    p->t('lehre', 'lektorInnen'); ?> - lektoren) - 1 ?> - lektoren as $key => $lektor): ?> - vorname . ' ' . $lektor->nachname; - echo $key === $len ? '' : ', ' ?> - -
    p->t('anrechnung', 'herkunftDerKenntnisse'); ?>anmerkung ?>
    p->t('anrechnung', 'nachweisdokumente'); ?> - dokumentname ?> -
    -
    - -
    -
    -
    - - -
    -
    -
    +
    + +
    + + +
    +
    Status: @@ -144,7 +237,7 @@ $this->load->view( load->view('lehre/anrechnung/reviewAnrechnungInfo'); ?>
    - +
    diff --git a/public/js/lehre/anrechnung/reviewAnrechnungDetail.js b/public/js/lehre/anrechnung/reviewAnrechnungDetail.js new file mode 100644 index 000000000..22d22f26c --- /dev/null +++ b/public/js/lehre/anrechnung/reviewAnrechnungDetail.js @@ -0,0 +1,228 @@ +const ANRECHNUNGSTATUS_PROGRESSED_BY_STGL = 'inProgressDP'; +const ANRECHNUNGSTATUS_PROGRESSED_BY_KF = 'inProgressKF'; +const ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR = 'inProgressLektor'; +const ANRECHNUNGSTATUS_APPROVED = 'approved'; +const ANRECHNUNGSTATUS_REJECTED = 'rejected'; + + + +$(function(){ + // Pruefen ob Promise unterstuetzt wird + // Tabulator funktioniert nicht mit IE + var canPromise = !! window.Promise; + if(!canPromise) + { + alert("Diese Seite kann mit ihrem Browser nicht angezeigt werden. Bitte verwenden Sie Firefox, Chrome oder Edge um die Seite anzuzeigen"); + window.location.href='about:blank'; + return; + } + + + // Set status alert color + reviewAnrechnung.setStatusAlertColor(); + + // Break Begruendung abgeben + $('#reviewAnrechnungUebersicht-begruendung-abbrechen').click(function(){ + $('#reviewAnrechnungUebersicht-begruendung').val(''); + $('#reviewAnrechnungUebersicht-begruendung-panel').slideUp('slow'); + + }) + + // Copy Begruendung into textarea + $(".btn-copyIntoTextarea").click(function(){ + reviewAnrechnung.copyIntoTextarea(this); + }) + + // Recommend Anrechnung (Detail GUI) + $("#recommend-anrechnung").click(function(){ + let empfehlung_panel = $('#reviewAnrechnungDetail-empfehlung-panel'); + let begruendung_panel = $('#reviewAnrechnungDetail-begruendung-panel'); + + begruendung_panel.css('display', 'none'); + + if (empfehlung_panel.is(":hidden")) + { + // Show begruendung panel if is hidden + empfehlung_panel.slideDown('slow'); + return; + } + + // Get form data + // index 0: anrechnung_id + let form_data = $('form').serializeArray(); + + // Prepare data object for ajax call + let data = { + 'data': [{ + 'anrechnung_id' : form_data[0].value + }] + }; + + // Hide begruendung panel again + $(empfehlung_panel).slideUp('slow'); + + FHC_AjaxClient.ajaxCallPost( + FHC_JS_DATA_STORAGE_OBJECT.called_path + "/recommend", + data, + { + successCallback: function (data, textStatus, jqXHR) + { + if (data.error && data.retval != null) + { + // Print error message + FHC_DialogLib.alertWarning(data.retval); + } + + if (!data.error && data.retval != null) + { + reviewAnrechnung.formatEmpfehlungIsTrue( + data.retval[0].empfehlung_am, + data.retval[0].empfehlung_von + ); + } + }, + errorCallback: function (jqXHR, textStatus, errorThrown) + { + FHC_DialogLib.alertError("Systemfehler
    Bitte kontaktieren Sie Ihren Administrator."); + } + } + ); + }); + + // Dont recommend Anrechnung (Detail GUI) + $("#dont-recommend-anrechnung").click(function(){ + + let begruendung_panel = $('#reviewAnrechnungDetail-begruendung-panel'); + let begruendung = $('#reviewAnrechnungDetail-begruendung').val(); + + let empfehlung_panel = $('#reviewAnrechnungDetail-empfehlung-panel'); + + empfehlung_panel.css('display', 'none'); + + if (begruendung_panel.is(":hidden")) + { + // Show begruendung panel if is hidden + begruendung_panel.slideDown('slow'); + return; + } + else + { + // Check if begruendung is given + if (!begruendung.trim()) // empty or white spaces only + { + FHC_DialogLib.alertInfo('Bitte tragen Sie eine Begründung ein.'); + return; + } + } + + + // Get form data + // index 0: anrechnung_id + let form_data = $('form').serializeArray(); + + // Confirm before rejecting + if(!confirm('Wollen Sie wirklich für die gewählten Anträge keine Empfehlung abgeben?')) + { + return; + } + + // Prepare data object for ajax call + let data = { + 'data': [{ + 'anrechnung_id' : form_data[0].value, + 'begruendung' : begruendung + }] + } + + // Hide begruendung panel again + $(begruendung_panel).slideUp('slow'); + + FHC_AjaxClient.ajaxCallPost( + FHC_JS_DATA_STORAGE_OBJECT.called_path + "/dontRecommend", + data, + { + successCallback: function (data, textStatus, jqXHR) + { + if (data.error && data.retval != null) + { + // Print error message + FHC_DialogLib.alertWarning(data.retval); + } + + if (!data.error && data.retval != null) + { + reviewAnrechnung.formatEmpfehlungIsFalse( + data.retval[0].empfehlung_am, + data.retval[0].empfehlung_von, + begruendung + ); + } + }, + errorCallback: function (jqXHR, textStatus, errorThrown) + { + FHC_DialogLib.alertError("Systemfehler
    Bitte kontaktieren Sie Ihren Administrator."); + } + } + ); + }); + + // Break Empfehlung abgeben + $('#reviewAnrechnungDetail-empfehlung-abbrechen').click(function(){ + $('#reviewAnrechnungDetail-empfehlung-panel').slideUp('slow'); + + }) + + // Break Begruendung abgeben + $('#reviewAnrechnungDetail-begruendung-abbrechen').click(function(){ + $('#reviewAnrechnungDetail-begruendung').val(''); + $('#reviewAnrechnungDetail-begruendung-panel').slideUp('slow'); + + }) + + +}); + +var reviewAnrechnung = { + setStatusAlertColor: function () { + let status_kurzbz = $('#reviewAnrechnung-status_kurzbz').data('status_kurzbz'); + + switch (status_kurzbz) { + case ANRECHNUNGSTATUS_APPROVED: + $('#reviewAnrechnung-status_kurzbz').closest('div').addClass('alert-success'); + break; + case ANRECHNUNGSTATUS_REJECTED: + $('#reviewAnrechnung-status_kurzbz').closest('div').addClass('alert-danger'); + break; + case '': + $('#reviewAnrechnung-status_kurzbz').closest('div').addClass('alert-info'); + break; + default: + $('#reviewAnrechnung-status_kurzbz').closest('div').addClass('alert-warning'); + } + }, + copyIntoTextarea: function(elem){ + + // Find closest textarea + let textarea = $(elem).closest('div').find('textarea'); + + // Copy begruendung into textarea + textarea.val($.trim($(elem).parent().text())); + }, + formatEmpfehlungIsTrue: function(empfehlungAm, emfehlungVon){ + $('#reviewAnrechnungDetail-empfehlungDetail').children().addClass('hidden'); + $('#reviewAnrechnungDetail-empfehlungDetail-empfehlungIsTrue').removeClass('hidden'); + $('#recommend-anrechnung').prop('disabled', true); + $('#dont-recommend-anrechnung').prop('disabled', true); + $('#reviewAnrechnungDetail-empfehlungAm').text(empfehlungAm); + $('#reviewAnrechnungDetail-empfehlungVon').text(emfehlungVon); + }, + formatEmpfehlungIsFalse: function(empfehlungAm, emfehlungVon, begruendung){ + $('#reviewAnrechnungDetail-empfehlungDetail').children().addClass('hidden'); + $('#reviewAnrechnungDetail-empfehlungDetail-empfehlungIsFalse').removeClass('hidden'); + $('#recommend-anrechnung').prop('disabled', true); + $('#dont-recommend-anrechnung').prop('disabled', true); + $('#reviewAnrechnungDetail-empfehlungAm').text(empfehlungAm); + $('#reviewAnrechnungDetail-empfehlungVon').text(emfehlungVon); + $('#reviewAnrechnungDetail-empfehlungDetail-begruendung').text(begruendung); + } +} \ No newline at end of file diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 32d22b789..08ae59701 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -8803,7 +8803,7 @@ Any unusual occurrences ), array( 'sprache' => 'English', - 'text' => 'Recommendation date', + 'text' => '', 'description' => '', 'insertvon' => 'system' ) @@ -8968,6 +8968,106 @@ Any unusual occurrences 'insertvon' => 'system' ) ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'empfehlungNegativ', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => ' Anrechnung wird nicht empfohlen.', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'empfehlungVon', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => ' Empfehlung von', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Recommended by', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'empfehlungenPositiv', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Anrechnungen werden empfohlen, weil die Kenntnisse inhaltlich und umfangmäßig gleichwertig sind.', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'empfehlungenNegativ', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Anrechnungen werden nicht empfohlen.', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'nochKeineEmpfehlung', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Es wurde noch keine Empfehlung abgegeben.', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'No recommendation has been sent yet.', + 'description' => '', + 'insertvon' => 'system' + ) + ) ) ); From 8b6f0f56af6e34d533ff0105a5f4f95204ec557d Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 3 Feb 2021 11:02:26 +0100 Subject: [PATCH 084/142] Corrected not collapsing 'Fristen' in Infopanels Signed-off-by: cris-technikum --- application/views/lehre/anrechnung/reviewAnrechnungInfo.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/views/lehre/anrechnung/reviewAnrechnungInfo.php b/application/views/lehre/anrechnung/reviewAnrechnungInfo.php index 82355a86f..024a1cdf5 100644 --- a/application/views/lehre/anrechnung/reviewAnrechnungInfo.php +++ b/application/views/lehre/anrechnung/reviewAnrechnungInfo.php @@ -8,7 +8,7 @@
    -
    +
    Eine Anerkennung setzt voraus, dass die erworbenen Kenntnisse mit dem Inhalt und Umfang der Lehrveranstaltung gleichwertig sind.

    Wenn die Gleichwertigkeit gegeben ist, können auch außerhochschulisch erworbene Kenntnisse angerechnet werden (z.B. Sekundarschule, Weiterbildungseinrichtungen). @@ -22,7 +22,7 @@
    - +
    +
    diff --git a/public/js/lehre/anrechnung/approveAnrechnung.js b/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js similarity index 100% rename from public/js/lehre/anrechnung/approveAnrechnung.js rename to public/js/lehre/anrechnung/approveAnrechnungUebersicht.js diff --git a/public/js/lehre/anrechnung/reviewAnrechnung.js b/public/js/lehre/anrechnung/reviewAnrechnungUebersicht.js similarity index 94% rename from public/js/lehre/anrechnung/reviewAnrechnung.js rename to public/js/lehre/anrechnung/reviewAnrechnungUebersicht.js index 7bf34ef81..447ab995a 100644 --- a/public/js/lehre/anrechnung/reviewAnrechnung.js +++ b/public/js/lehre/anrechnung/reviewAnrechnungUebersicht.js @@ -179,6 +179,18 @@ $(function(){ // Recommend Anrechnungen $("#recommend-anrechnungen").click(function(){ + let empfehlung_panel = $('#reviewAnrechnungUebersicht-empfehlung-panel'); + let begruendung_panel = $('#reviewAnrechnungUebersicht-begruendung-panel'); + + begruendung_panel.css('display', 'none'); + + if (empfehlung_panel.is(":hidden")) + { + // Show begruendung panel if is hidden + empfehlung_panel.slideDown('slow'); + return; + } + // Get selected rows data let selected_data = $('#tableWidgetTabulator').tabulator('getSelectedData') .map(function(data){ @@ -235,7 +247,9 @@ $(function(){ let begruendung_panel = $('#reviewAnrechnungUebersicht-begruendung-panel'); let begruendung = $('#reviewAnrechnungUebersicht-begruendung').val(); + let empfehlung_panel = $('#reviewAnrechnungUebersicht-empfehlung-panel'); + empfehlung_panel.css('display', 'none'); if (begruendung_panel.is(":hidden")) { @@ -313,6 +327,12 @@ $(function(){ ); }); + // Break Empfehlung abgeben + $('#reviewAnrechnungUebersicht-empfehlung-abbrechen').click(function(){ + $('#reviewAnrechnungUebersicht-empfehlung-panel').slideUp('slow'); + + }) + // Break Begruendung abgeben $('#reviewAnrechnungUebersicht-begruendung-abbrechen').click(function(){ $('#reviewAnrechnungUebersicht-begruendung').val(''); From 1c0c8e9ad4441ae5208a7d4b34fc88e66fcba328 Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 3 Feb 2021 12:36:42 +0100 Subject: [PATCH 087/142] Hided empfehlung/begruendung panels in lector overview after sending recommendation Signed-off-by: cris-technikum --- .../lehre/anrechnung/reviewAnrechnungUebersicht.php | 3 +-- public/js/lehre/anrechnung/reviewAnrechnungUebersicht.js | 9 ++++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/application/views/lehre/anrechnung/reviewAnrechnungUebersicht.php b/application/views/lehre/anrechnung/reviewAnrechnungUebersicht.php index 4de79b452..5941ab741 100644 --- a/application/views/lehre/anrechnung/reviewAnrechnungUebersicht.php +++ b/application/views/lehre/anrechnung/reviewAnrechnungUebersicht.php @@ -115,8 +115,7 @@ $this->load->view( load->view('lehre/anrechnung/reviewAnrechnungUebersichtData.php'); ?>
    - - +
    - + +
    + + +
    +
    -
    -
    @@ -149,7 +198,7 @@ $this->load->view(
    -
    +
    diff --git a/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js b/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js index bcbf0695d..485596b12 100644 --- a/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js +++ b/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js @@ -172,6 +172,18 @@ $(function(){ // Approve Anrechnungen $("#approve-anrechnungen").click(function(){ + let genehmigung_panel = $('#approveAnrechnungUebersicht-empfehlung-panel'); + let begruendung_panel = $('#approveAnrechnungUebersicht-begruendung-panel'); + + begruendung_panel.css('display', 'none'); + + if (genehmigung_panel.is(":hidden")) + { + // Show begruendung panel if is hidden + genehmigung_panel.slideDown('slow'); + return; + } + // Get selected rows data let selected_data = $('#tableWidgetTabulator').tabulator('getSelectedData') .map(function(data){ @@ -188,12 +200,14 @@ $(function(){ return; } - // Prepare data object for ajax call let data = { 'data': selected_data }; + // Hide genehmigung panel again + genehmigung_panel.slideUp('slow'); + FHC_AjaxClient.ajaxCallPost( FHC_JS_DATA_STORAGE_OBJECT.called_path + "/approve", data, @@ -225,6 +239,28 @@ $(function(){ // Reject Anrechnungen $("#reject-anrechnungen").click(function(){ + let begruendung_panel = $('#approveAnrechnungUebersicht-begruendung-panel'); + let begruendung = $('#approveAnrechnungUebersicht-begruendung').val(); + let genehmigung_panel = $('#approveAnrechnungUebersicht-empfehlung-panel'); + + genehmigung_panel.css('display', 'none'); + + if (begruendung_panel.is(":hidden")) + { + // Show begruendung panel if is hidden + begruendung_panel.slideDown('slow'); + return; + } + else + { + // Check if begruendung is given + if (!begruendung.trim()) // empty or white spaces only + { + FHC_DialogLib.alertInfo('Bitte tragen Sie eine Begründung ein.'); + return; + } + } + // Get selected rows data let selected_data = $('#tableWidgetTabulator').tabulator('getSelectedData') .map(function(data){ @@ -252,6 +288,9 @@ $(function(){ 'data': selected_data }; + // Hide begruendung panel again + $(begruendung_panel).slideUp('slow'); + FHC_AjaxClient.ajaxCallPost( FHC_JS_DATA_STORAGE_OBJECT.called_path + "/reject", data, @@ -344,6 +383,24 @@ $(function(){ ); }); + // Break Genehmigung abgeben + $('#approveAnrechnungUebersicht-empfehlung-abbrechen').click(function(){ + $('#approveAnrechnungUebersicht-empfehlung-panel').slideUp('slow'); + + }) + + // Break Ablehnung abgeben + $('#approveAnrechnungUebersicht-begruendung-abbrechen').click(function(){ + $('#approveAnrechnungUebersicht-begruendung').val(''); + $('#approveAnrechnungUebersicht-begruendung-panel').slideUp('slow'); + + }) + + // Copy Begruendung into textarea + $(".btn-copyIntoTextarea").click(function(){ + approveAnrechnung.copyIntoTextarea(this); + }) + }); var approveAnrechnung = { @@ -363,5 +420,13 @@ var approveAnrechnung = { default: $('#requestAnrechnung-status_kurzbz').closest('div').addClass('alert-warning'); } + }, + copyIntoTextarea: function(elem){ + + // Find closest textarea + let textarea = $(elem).closest('div').find('textarea'); + + // Copy begruendung into textarea + textarea.val($.trim($(elem).parent().text())); } } \ No newline at end of file diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 08ae59701..febf31dfd 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -9068,7 +9068,128 @@ Any unusual occurrences 'insertvon' => 'system' ) ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'genehmigungNegativ', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Antrag wird nicht genehmigt.', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'genehmigungenNegativ', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Anträge werden nicht genehmigt.', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'genehmigungNegativPruefungNichtMoeglich', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Anrechnung wird nicht genehmigt, weil die Prüfung der Gleichwertigkeit aus formalen Gründen (z.B. mangelhafte Unterlagen) nicht möglich war.', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'genehmigungNegativKenntnisseNichtGleichwertig', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Anrechnung wird nicht genehmigt, weil die Kenntnisse inhaltlich und umfangmäßig nicht gleichwertig sind.', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'genehmigungenPositiv', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Anrechnungen werden genehmigt, weil die Kenntnisse inhaltlich und umfangmäßig gleichwertig sind.', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'genehmigungPositiv', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Anrechnungen wird genehmigt, weil die Kenntnisse inhaltlich und umfangmäßig gleichwertig sind.', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) ) + ); From 5109828772831fab1d5fcaf0a33cde71113c96b8 Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 3 Feb 2021 12:59:46 +0100 Subject: [PATCH 089/142] Adapted STGL overview: info/begruendungsangabe when approving/rejecting Signed-off-by: cris-technikum --- application/libraries/AnrechnungLib.php | 11 ++++++++++- .../lehre/anrechnung/approveAnrechnungUebersicht.js | 3 ++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/application/libraries/AnrechnungLib.php b/application/libraries/AnrechnungLib.php index f00cac01b..dd8b796c7 100644 --- a/application/libraries/AnrechnungLib.php +++ b/application/libraries/AnrechnungLib.php @@ -376,7 +376,7 @@ class AnrechnungLib * @param $anrechnung_id * @return array */ - public function rejectAnrechnung($anrechnung_id) + public function rejectAnrechnung($anrechnung_id, $begruendung) { // Check last Anrechnungstatus if (!$result = getData($this->ci->AnrechnungModel->getLastAnrechnungstatus($anrechnung_id))[0]) @@ -400,6 +400,15 @@ class AnrechnungLib show_error(getError($result)); } + // Add begruendung as notiz + $this->ci->load->model('person/Notiz_model', 'NotizModel'); + $this->ci->NotizModel->addNotizForAnrechnung( + $anrechnung_id, + self::ANRECHNUNG_NOTIZTITEL_NOTIZ_BY_STGL, + $begruendung, + getAuthUID() + ); + return success(true); // rejected } diff --git a/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js b/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js index 485596b12..275c6795c 100644 --- a/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js +++ b/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js @@ -267,6 +267,7 @@ $(function(){ // reduce to necessary fields return { 'anrechnung_id' : data.anrechnung_id, + 'begruendung' : begruendung } }); @@ -289,7 +290,7 @@ $(function(){ }; // Hide begruendung panel again - $(begruendung_panel).slideUp('slow'); + begruendung_panel.slideUp('slow'); FHC_AjaxClient.ajaxCallPost( FHC_JS_DATA_STORAGE_OBJECT.called_path + "/reject", From 0affbf4e411725a676fa1f89306ff6df5eb87557 Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 3 Feb 2021 14:53:40 +0100 Subject: [PATCH 090/142] Added param to calling function rejectAnrechnung to work properly Signed-off-by: cris-technikum --- .../lehre/anrechnung/ApproveAnrechnungUebersicht.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php index 736861025..772825c7c 100644 --- a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php +++ b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php @@ -161,7 +161,7 @@ class approveAnrechnungUebersicht extends Auth_Controller foreach ($data as $item) { // Reject Anrechnung - if(getData($this->anrechnunglib->rejectAnrechnung($item['anrechnung_id']))) + if(getData($this->anrechnunglib->rejectAnrechnung($item['anrechnung_id'], $item['begruendung']))) { $json[]= array( 'anrechnung_id' => $item['anrechnung_id'], From e780a3e5057a9ad418f350ef4e7318b9964559aa Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 3 Feb 2021 15:30:53 +0100 Subject: [PATCH 091/142] Added GUI for STGL Detail VIEW + logic (Antrag- and Empfehlungdata) Signed-off-by: cris-technikum --- .../anrechnung/ApproveAnrechnungDetail.php | 421 ++++++++++++++++++ application/libraries/AnrechnungLib.php | 11 + .../anrechnung/approveAnrechnungDetail.php | 204 +++++++++ .../anrechnung/reviewAnrechnungDetail.php | 2 +- .../anrechnung/approveAnrechnungDetail.js | 301 +++++++++++++ .../anrechnung/reviewAnrechnungDetail.js | 7 - system/phrasesupdate.php | 40 ++ 7 files changed, 978 insertions(+), 8 deletions(-) create mode 100644 application/controllers/lehre/anrechnung/ApproveAnrechnungDetail.php create mode 100644 application/views/lehre/anrechnung/approveAnrechnungDetail.php create mode 100644 public/js/lehre/anrechnung/approveAnrechnungDetail.js diff --git a/application/controllers/lehre/anrechnung/ApproveAnrechnungDetail.php b/application/controllers/lehre/anrechnung/ApproveAnrechnungDetail.php new file mode 100644 index 000000000..72773b11c --- /dev/null +++ b/application/controllers/lehre/anrechnung/ApproveAnrechnungDetail.php @@ -0,0 +1,421 @@ + 'lehre/anrechnung_empfehlen:rw', + 'download' => 'lehre/anrechnung_empfehlen:rw', + 'recommend' => 'lehre/anrechnung_empfehlen:rw', + 'dontRecommend' => 'lehre/anrechnung_empfehlen:rw' + ) + ); + + // Load models + $this->load->model('education/Anrechnung_model', 'AnrechnungModel'); + $this->load->model('education/Anrechnungstatus_model', 'AnrechnungstatusModel'); + $this->load->model('content/DmsVersion_model', 'DmsVersionModel'); + $this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel'); + $this->load->model('crm/Prestudent_model', 'PrestudentModel'); + $this->load->model('person/Notiz_model', 'NotizModel'); + $this->load->model('person/Person_model', 'PersonModel'); + + // Load libraries + $this->load->library('WidgetLib'); + $this->load->library('PermissionLib'); + $this->load->library('AnrechnungLib'); + $this->load->library('DmsLib'); + + // Load helpers + $this->load->helper('form'); + $this->load->helper('url'); + $this->load->helper('hlp_sancho_helper'); + + // Load language phrases + $this->loadPhrases( + array( + 'global', + 'ui', + 'anrechnung', + 'person', + 'lehre', + 'table' + ) + ); + + $this->_setAuthUID(); + + $this->setControllerId(); + } + + public function index() + { + $anrechnung_id = $this->input->get('anrechnung_id'); + + if (!is_numeric($anrechnung_id)) + { + show_error('Missing correct parameter'); + } + + // Get Anrechung data + if (!$anrechnungData = getData($this->anrechnunglib->getAnrechnungData($anrechnung_id))) + { + show_error('Missing data for Anrechnung.'); + } + + // Get Empfehlung data + if(!$empfehlungData = getData($this->anrechnunglib->getEmpfehlungData($anrechnung_id))) + { + show_error('Missing data for recommendation'); + } + + $viewData = array( + 'antragData' => $this->anrechnunglib->getAntragData( + $student_uid = $this->PrestudentModel->getUID($anrechnungData->prestudent_id), + $anrechnungData->studiensemester_kurzbz, + $anrechnungData->lehrveranstaltung_id + ), + 'anrechnungData' => $anrechnungData, + 'empfehlungData' => $empfehlungData + ); + + $this->load->view('lehre/anrechnung/approveAnrechnungDetail.php', $viewData); + } + + /** + * Approve Anrechnungen. + */ + public function approve() + { + $data = $this->input->post('data'); + + if(isEmptyArray($data)) + { + return $this->outputJsonError('Fehler beim Übertragen der Daten.'); + } + + // Get statusbezeichnung for 'approved' + $this->AnrechnungstatusModel->addSelect('bezeichnung_mehrsprachig'); + $approved = getData($this->AnrechnungstatusModel->load('approved'))[0]; + $approved = getUserLanguage() == 'German' + ? $approved->bezeichnung_mehrsprachig[0] + : $approved->bezeichnung_mehrsprachig[1]; + + foreach ($data as $item) + { + // Approve Anrechnung + if(getData($this->anrechnunglib->approveAnrechnung($item['anrechnung_id']))) + { + $json[]= array( + 'anrechnung_id' => $item['anrechnung_id'], + 'status_kurzbz' => self::ANRECHNUNGSTATUS_APPROVED, + 'status_bezeichnung' => $approved + ); + + if(!$this->_sendSanchoMailToStudent($item['anrechnung_id'], self::ANRECHNUNGSTATUS_APPROVED)) + { + show_error('Failed sending mail'); + } + } + } + + // Output json to ajax + if (isset($json) && !isEmptyArray($json)) + { + return $this->outputJsonSuccess($json); + } + else + { + return $this->outputJsonError('Es wurden keine Anrechnungen genehmigt.'); + } + } + + /** + * Reject Anrechnungen. + */ + public function reject() + { + $data = $this->input->post('data'); + + if(isEmptyArray($data)) + { + return $this->outputJsonError('Fehler beim Übertragen der Daten.'); + } + + // Get statusbezeichnung for 'rejected' + $this->AnrechnungstatusModel->addSelect('bezeichnung_mehrsprachig'); + $rejected = getData($this->AnrechnungstatusModel->load('rejected'))[0]; + $rejected = getUserLanguage() == 'German' + ? $rejected->bezeichnung_mehrsprachig[0] + : $rejected->bezeichnung_mehrsprachig[1]; + + foreach ($data as $item) + { + // Reject Anrechnung + if(getData($this->anrechnunglib->rejectAnrechnung($item['anrechnung_id'], $item['begruendung']))) + { + $json[]= array( + 'anrechnung_id' => $item['anrechnung_id'], + 'status_kurzbz' => self::ANRECHNUNGSTATUS_REJECTED, + 'status_bezeichnung' => $rejected + ); + + if(!$this->_sendSanchoMailToStudent($item['anrechnung_id'], self::ANRECHNUNGSTATUS_REJECTED)) + { + show_error('Failed sending mail'); + } + } + } + + // Output json to ajax + if (isset($json) && !isEmptyArray($json)) + { + return $this->outputJsonSuccess($json); + } + else + { + return $this->outputJsonError('Es wurden keine Anrechnungen genehmigt.'); + } + } + + /** + * Request recommendation for Anrechnungen. + */ + public function requestRecommendation() + { + $data = $this->input->post('data'); + + if(isEmptyArray($data)) + { + return $this->outputJsonError('Fehler beim Übertragen der Daten.'); + } + + // Get statusbezeichnung for 'inProgressLektor' + $this->AnrechnungstatusModel->addSelect('bezeichnung_mehrsprachig'); + $inProgressLektor = getData($this->AnrechnungstatusModel->load('inProgressLektor'))[0]; + $inProgressLektor = getUserLanguage() == 'German' + ? $inProgressLektor->bezeichnung_mehrsprachig[0] + : $inProgressLektor->bezeichnung_mehrsprachig[1]; + + foreach ($data as $item) + { + // Approve Anrechnung + if(getData($this->anrechnunglib->requestRecommendation($item['anrechnung_id']))) + { + $json[]= array( + 'anrechnung_id' => $item['anrechnung_id'], + 'status_kurzbz' => self::ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR, + 'status_bezeichnung' => $inProgressLektor, + 'empfehlung_anrechnung' => null + ); + } + } + + // Output json to ajax + if (isset($json) && !isEmptyArray($json)) + { + /** + * Send mails to lectors + * NOTE: mails are sent at the end to ensure sending only ONE mail to each LV-Leitung or lector + * even if they are required for more recommendations + * */ + if (!$this->_sendSanchoMailToLectors($json)) + { + show_error('Failed sending emails'); + } + + return $this->outputJsonSuccess($json); + } + else + { + return $this->outputJsonError('Es wurden keine Empfehlungen angefordert'); + } + } + + /** + * Download and open uploaded document (Nachweisdokument). + */ + public function download() + { + $dms_id = $this->input->get('dms_id'); + + if (!is_numeric($dms_id)) + { + show_error('Wrong parameter'); + } + + $this->dmslib->download($dms_id); + } + + /** + * Retrieve the UID of the logged user and checks if it is valid + */ + private function _setAuthUID() + { + $this->_uid = getAuthUID(); + + if (!$this->_uid) show_error('User authentification failed'); + } + + /** + * Send mail to student to inform if Anrechnung was approved or rejected + * @param $mail_params + */ + private function _sendSanchoMailToStudent($anrechnung_id, $status_kurzbz) + { + $result = getData($this->anrechnunglib->getStudentData($anrechnung_id))[0]; + + // Get student name and mail address + $to = $result->uid. '@'. DOMAIN; + + $anrede = $result->geschlecht == 'w' ? 'Sehr geehrte Frau ' : 'Sehr geehrter Herr '; + // Prepare mail content + $body_fields = array( + 'anrede_name' => $anrede. $result->vorname. ' '. $result->nachname, + 'lehrveranstaltung_bezeichnung' => $result->lv_bezeichnung, + 'stattgegeben_nichtstattgegeben' => $status_kurzbz == self::ANRECHNUNGSTATUS_APPROVED + ? 'stattgegeben' + : 'nicht stattgegeben' + ); + + sendSanchoMail( + 'AnrechnungGenehmigen', + $body_fields, + $to, + 'Ihr Antrag auf Anerkennung nachgewiesener Kenntnisse wurde abgeschlossen' + ); + + return true; + } + + /** + * Send mail to lectors asking for recommendation. (first to LV-Leitung, if not present to all lectors of lv) + * @param $mail_params + * @return bool + */ + private function _sendSanchoMailToLectors($mail_params) + { + // Get Lehrveranstaltungen + $anrechnung_arr = array(); + + foreach ($mail_params as $item) + { + $this->AnrechnungModel->addSelect('lehrveranstaltung_id, studiensemester_kurzbz'); + $anrechnung_arr[]= array( + 'lehrveranstaltung_id' => $this->AnrechnungModel->load($item['anrechnung_id'])->retval[0]->lehrveranstaltung_id, + 'studiensemester_kurzbz' => $this->AnrechnungModel->load($item['anrechnung_id'])->retval[0]->studiensemester_kurzbz + ); + } + + $anrechnung_arr = array_unique($anrechnung_arr, SORT_REGULAR); + + + /** + * Get lectors (prio for LV-Leitung, if not present to all lectors of LV. + * Anyway this function will receive a unique array to avoid sending more mails to one and the same lector. + * **/ + $lector_arr = $this->_getLectors($anrechnung_arr); + + // Send mail to lectors + foreach ($lector_arr as $lector) + { + $to = $lector->uid; + $vorname = $lector->vorname; + + // Get full name of stgl + $this->load->model('person/Person_model', 'PersonModel'); + if (!$stgl_name = getData($this->PersonModel->getFullName($this->_uid))) + { + show_error ('Failed retrieving person'); + } + + // Link to Antrag genehmigen + $url = + CIS_ROOT. 'cis/index.php?menu='. + CIS_ROOT. 'cis/menu.php?content_id=&content='. + CIS_ROOT. index_page(). self::REVIEW_ANRECHNUNG_URI; + + // Prepare mail content + $body_fields = array( + 'vorname' => $vorname, + 'stgl_name' => $stgl_name, + 'link' => anchor($url, 'Anrechnungsanträge Übersicht') + ); + + sendSanchoMail( + 'AnrechnungEmpfehlungAnfordern', + $body_fields, + $to, + 'Neue LV-Anrechnungsanträge benötigen Deine Empfehlung' + ); + } + return true; + } + + /** + * Get lectors (prio for LV-Leitung, if not present to all lectors of LV. + * Anyway this function will receive a unique array to avoid sending more mails to one and the same lector. + * @param $anrechnung_arr + * @return array + */ + private function _getLectors($anrechnung_arr) + { + $lector_arr = array(); + + // Get lectors + foreach($anrechnung_arr as $anrechnung) + { + $this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel'); + $result = $this->LehrveranstaltungModel->getLecturersByLv($anrechnung['studiensemester_kurzbz'], $anrechnung['lehrveranstaltung_id']); + + if (!$result = getData($result)) + { + show_error('Failed retrieving lectors of Lehrveranstaltung'); + } + + // Check if lv has LV-Leitung + $key = array_search(true, array_column($result, 'lvleiter')); + + // If lv has LV-Leitung, keep only the one + if ($key !== false) + { + $lector_arr[]= $result[$key]; + } + // ...otherwise keep all lectors + else + { + $lector_arr = array_merge($lector_arr, $result); + } + } + + /** + * NOTE: This step is only done to make the array unique by uid, vorname and nachname in the following step + * (e.g. if same lector is ones LV-Leitung and another time not, then array_unique would leave both. + * But we wish to send only one email by to that one person) + * **/ + foreach ($lector_arr as $lector) + { + unset($lector->lvleiter); + } + + // Now make the lector array aka mail receivers unique + $lector_arr = array_unique($lector_arr, SORT_REGULAR); + + return $lector_arr; + + } + +} \ No newline at end of file diff --git a/application/libraries/AnrechnungLib.php b/application/libraries/AnrechnungLib.php index dd8b796c7..c2f7d5f4a 100644 --- a/application/libraries/AnrechnungLib.php +++ b/application/libraries/AnrechnungLib.php @@ -201,6 +201,7 @@ class AnrechnungLib $empfehlung_data->empfehlung = null; $empfehlung_data->empfehlung_von = '-'; $empfehlung_data->empfehlung_am = '-'; + $empfehlung_data->empfehlung_angefordert_am = '-'; $empfehlung_data->notiz = ''; // Begruendung, if not recommended @@ -209,6 +210,16 @@ class AnrechnungLib show_error('Failed loading Anrechnung'); } + // Get date, where recommendation was last requested + $result = $this->ci->AnrechnungModel->getLastAnrechnungstatus( + $anrechnung_id, + self::ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR // when STLG asks for recommendation, status is set to in progress lektor + ); + if ($result = getData($result)[0]) + { + $empfehlung_data->empfehlung_angefordert_am = (new DateTime($result->insertamum))->format('d.m.Y'); + } + if (is_null($anrechnung->empfehlung_anrechnung)) { return success($empfehlung_data); diff --git a/application/views/lehre/anrechnung/approveAnrechnungDetail.php b/application/views/lehre/anrechnung/approveAnrechnungDetail.php new file mode 100644 index 000000000..4469efc7f --- /dev/null +++ b/application/views/lehre/anrechnung/approveAnrechnungDetail.php @@ -0,0 +1,204 @@ +load->view( + 'templates/FHC-Header', + array( + 'title' => $this->p->t('anrechnung', 'anrechnungenGenehmigen'), + 'jquery' => true, + 'jqueryui' => true, + 'bootstrap' => true, + 'fontawesome' => true, + 'ajaxlib' => true, + 'dialoglib' => true, + 'phrases' => array( + 'global' => array( + 'anerkennungNachgewiesenerKenntnisse', + 'antragStellen' + ), + 'ui' => array( + 'hilfeZuDieserSeite', + 'hochladen' + ), + 'person' => array( + 'student', + 'personenkennzeichen' + ), + 'lehre' => array( + 'studiensemester', + 'studiengang', + 'lehrveranstaltung', + 'ects', + 'lektor', + ) + ), + 'customCSSs' => array( + 'public/css/Tabulator.css' + ), + 'customJSs' => array( + 'public/js/bootstrapper.js', + 'public/js/lehre/anrechnung/approveAnrechnungDetail.js' + + ) + ) +); +?> + + +
    +
    + +
    + +
    + +
    +
    +
    +
    + + +
    +
    +
    +
    + p->t('anrechnung', 'antrag'); ?> + p->t('anrechnung', 'antragdatum'); ?>: anrechnung_id) ? $anrechnungData->insertamum : '-' ?> +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    p->t('person', 'student'); ?>vorname . ' ' . $antragData->nachname; ?>
    p->t('person', 'personenkennzeichen'); ?>matrikelnr ?>
    p->t('lehre', 'studiensemester'); ?>studiensemester_kurzbz ?>
    p->t('lehre', 'studiengang'); ?>stg_bezeichnung ?>
    p->t('lehre', 'lehrveranstaltung'); ?>lv_bezeichnung ?>
    p->t('lehre', 'ects'); ?>ects ?>
    p->t('lehre', 'lektorInnen'); ?> + lektoren) - 1 ?> + lektoren as $key => $lektor): ?> + vorname . ' ' . $lektor->nachname; + echo $key === $len ? '' : ', ' ?> + +
    p->t('anrechnung', 'herkunftDerKenntnisse'); ?>anmerkung ?>
    p->t('anrechnung', 'nachweisdokumente'); ?> + dokumentname ?> +
    +
    +
    +
    + +
    +
    +
    + +
    + +
    + p->t('anrechnung', 'empfehlung'); ?> +
    + p->t('anrechnung', 'empfehlungVon'); ?>: + empfehlung_von ?> +  |  + p->t('anrechnung', 'empfehlungdatum'); ?>: + empfehlung_am ?> +
    +
    + +
    + +
    + p->t('anrechnung', 'keineEmpfehlungAngefordert'); ?> +
    + +
    + p->t('anrechnung', 'empfehlungAngefordertNochKeineEmpfehlung'); ?> + empfehlung_angefordert_am ?>. +
    + +
    + p->t('anrechnung', 'empfehlungPositiv'); ?> +
    + +
    +
    p->t('anrechnung', 'empfehlungNegativ'); ?>
    +
    p->t('global', 'begruendung'); ?>: + notiz ?> +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    + +
    +
    + Status: + + status; ?> + +
    +
    + load->view('lehre/anrechnung/reviewAnrechnungInfo'); ?> +
    +
    + +
    +
    + + +load->view('templates/FHC-Footer'); ?> diff --git a/application/views/lehre/anrechnung/reviewAnrechnungDetail.php b/application/views/lehre/anrechnung/reviewAnrechnungDetail.php index 7b8d29d4c..497fbe635 100644 --- a/application/views/lehre/anrechnung/reviewAnrechnungDetail.php +++ b/application/views/lehre/anrechnung/reviewAnrechnungDetail.php @@ -121,7 +121,7 @@ $this->load->view( - +
    diff --git a/public/js/lehre/anrechnung/approveAnrechnungDetail.js b/public/js/lehre/anrechnung/approveAnrechnungDetail.js new file mode 100644 index 000000000..b9b7de9fb --- /dev/null +++ b/public/js/lehre/anrechnung/approveAnrechnungDetail.js @@ -0,0 +1,301 @@ +const ANRECHNUNGSTATUS_PROGRESSED_BY_STGL = 'inProgressDP'; +const ANRECHNUNGSTATUS_PROGRESSED_BY_KF = 'inProgressKF'; +const ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR = 'inProgressLektor'; +const ANRECHNUNGSTATUS_APPROVED = 'approved'; +const ANRECHNUNGSTATUS_REJECTED = 'rejected'; + + + +$(function(){ + // Pruefen ob Promise unterstuetzt wird + // Tabulator funktioniert nicht mit IE + var canPromise = !! window.Promise; + if(!canPromise) + { + alert("Diese Seite kann mit ihrem Browser nicht angezeigt werden. Bitte verwenden Sie Firefox, Chrome oder Edge um die Seite anzuzeigen"); + window.location.href='about:blank'; + return; + } + + // Set status alert color + approveAnrechnungDetail.setStatusAlertColor(); + + // Approve Anrechnungen + $("#approve-anrechnungen").click(function(){ + let genehmigung_panel = $('#approveAnrechnungUebersicht-empfehlung-panel'); + let begruendung_panel = $('#approveAnrechnungUebersicht-begruendung-panel'); + + begruendung_panel.css('display', 'none'); + + if (genehmigung_panel.is(":hidden")) + { + // Show begruendung panel if is hidden + genehmigung_panel.slideDown('slow'); + return; + } + + // Get selected rows data + let selected_data = $('#tableWidgetTabulator').tabulator('getSelectedData') + .map(function(data){ + // reduce to necessary fields + return { + 'anrechnung_id' : data.anrechnung_id, + } + }); + + // Alert and exit if no anrechnung is selected + if (selected_data.length == 0) + { + FHC_DialogLib.alertInfo('Bitte wählen Sie erst zumindest einen Antrag auf Anrechnung'); + return; + } + + // Prepare data object for ajax call + let data = { + 'data': selected_data + }; + + // Hide genehmigung panel again + genehmigung_panel.slideUp('slow'); + + FHC_AjaxClient.ajaxCallPost( + FHC_JS_DATA_STORAGE_OBJECT.called_path + "/approve", + data, + { + successCallback: function (data, textStatus, jqXHR) + { + if (data.error && data.retval != null) + { + // Print error message + FHC_DialogLib.alertWarning(data.retval); + } + + if (!data.error && data.retval != null) + { + // Update status 'genehmigt' + $('#tableWidgetTabulator').tabulator('updateData', data.retval); + + // Print success message + FHC_DialogLib.alertSuccess(data.retval.length + " Anrechnungsanträge wurden genehmigt."); + } + }, + errorCallback: function (jqXHR, textStatus, errorThrown) + { + FHC_DialogLib.alertError("Systemfehler
    Bitte kontaktieren Sie Ihren Administrator."); + } + } + ); + }); + + // Reject Anrechnungen + $("#reject-anrechnungen").click(function(){ + let begruendung_panel = $('#approveAnrechnungUebersicht-begruendung-panel'); + let begruendung = $('#approveAnrechnungUebersicht-begruendung').val(); + let genehmigung_panel = $('#approveAnrechnungUebersicht-empfehlung-panel'); + + genehmigung_panel.css('display', 'none'); + + if (begruendung_panel.is(":hidden")) + { + // Show begruendung panel if is hidden + begruendung_panel.slideDown('slow'); + return; + } + else + { + // Check if begruendung is given + if (!begruendung.trim()) // empty or white spaces only + { + FHC_DialogLib.alertInfo('Bitte tragen Sie eine Begründung ein.'); + return; + } + } + + // Get selected rows data + let selected_data = $('#tableWidgetTabulator').tabulator('getSelectedData') + .map(function(data){ + // reduce to necessary fields + return { + 'anrechnung_id' : data.anrechnung_id, + 'begruendung' : begruendung + } + }); + + // Alert and exit if no anrechnung is selected + if (selected_data.length == 0) + { + FHC_DialogLib.alertInfo('Bitte wählen Sie erst zumindest einen Antrag auf Anrechnung'); + return; + } + + // Confirm before rejecting + if(!confirm('Wollen Sie wirklich die gewählten Anträge ablehnen?')) + { + return; + } + + // Prepare data object for ajax call + let data = { + 'data': selected_data + }; + + // Hide begruendung panel again + begruendung_panel.slideUp('slow'); + + FHC_AjaxClient.ajaxCallPost( + FHC_JS_DATA_STORAGE_OBJECT.called_path + "/reject", + data, + { + successCallback: function (data, textStatus, jqXHR) + { + if (data.error && data.retval != null) + { + // Print error message + FHC_DialogLib.alertWarning(data.retval); + } + + if (!data.error && data.retval != null) + { + // Update status 'genehmigt' + $('#tableWidgetTabulator').tabulator('updateData', data.retval); + + // Print success message + FHC_DialogLib.alertSuccess(data.retval.length + " Anrechnungsanträge wurden abgelehnt."); + } + }, + errorCallback: function (jqXHR, textStatus, errorThrown) + { + FHC_DialogLib.alertError("Systemfehler
    Bitte kontaktieren Sie Ihren Administrator."); + } + } + ); + }); + + // Request Recommendation for Anrechnungen + $("#request-recommendation").click(function(){ + // Get selected rows data + let selected_data = $('#tableWidgetTabulator').tabulator('getSelectedData'); + + // If some of selected anrechnungen has already been recommended... + if (selected_data.some((data) => data.empfehlung_anrechnung !== null)) + { + // ...confirm before requesting recommendation + if(!confirm(FHC_PhrasesLib.t("anrechnung", "confirmTextAntragHatBereitsEmpfehlung"))) + { + return; + } + } + + selected_data.map(function(data){ + // reduce to necessary fields + return { + 'anrechnung_id' : data.anrechnung_id, + } + }); + + // Alert and exit if no anrechnung is selected + if (selected_data.length == 0) + { + FHC_DialogLib.alertInfo('Bitte wählen Sie erst zumindest einen Antrag auf Anrechnung'); + return; + } + + // Prepare data object for ajax call + let data = { + 'data': selected_data + }; + + FHC_AjaxClient.ajaxCallPost( + FHC_JS_DATA_STORAGE_OBJECT.called_path + "/requestRecommendation", + data, + { + successCallback: function (data, textStatus, jqXHR) + { + if (data.error && data.retval != null) + { + // Print error message + FHC_DialogLib.alertWarning(data.retval); + } + + if (!data.error && data.retval != null) + { + // Update status 'genehmigt' + $('#tableWidgetTabulator').tabulator('updateData', data.retval); + + // Print success message + FHC_DialogLib.alertSuccess("Empfehlungen wurden angefordert."); + } + }, + errorCallback: function (jqXHR, textStatus, errorThrown) + { + FHC_DialogLib.alertError("Systemfehler
    Bitte kontaktieren Sie Ihren Administrator."); + } + } + ); + }); + + // Copy Begruendung into textarea + $(".btn-copyIntoTextarea").click(function(){ + approveAnrechnungDetail.copyIntoTextarea(this); + }) + + // Break Empfehlung abgeben + $('#approveAnrechnungDetail-empfehlung-abbrechen').click(function(){ + $('#approveAnrechnungDetail-empfehlung-panel').slideUp('slow'); + + }) + + // Break Begruendung abgeben + $('#approveAnrechnungDetail-begruendung-abbrechen').click(function(){ + $('#approveAnrechnungDetail-begruendung').val(''); + $('#approveAnrechnungDetail-begruendung-panel').slideUp('slow'); + + }) + + +}); + +var approveAnrechnungDetail = { + setStatusAlertColor: function () { + let status_kurzbz = $('#approveAnrechnung-status_kurzbz').data('status_kurzbz'); + + switch (status_kurzbz) { + case ANRECHNUNGSTATUS_APPROVED: + $('#approveAnrechnung-status_kurzbz').closest('div').addClass('alert-success'); + break; + case ANRECHNUNGSTATUS_REJECTED: + $('#approveAnrechnung-status_kurzbz').closest('div').addClass('alert-danger'); + break; + case '': + $('#approveAnrechnung-status_kurzbz').closest('div').addClass('alert-info'); + break; + default: + $('#approveAnrechnung-status_kurzbz').closest('div').addClass('alert-warning'); + } + }, + copyIntoTextarea: function(elem){ + + // Find closest textarea + let textarea = $(elem).closest('div').find('textarea'); + + // Copy begruendung into textarea + textarea.val($.trim($(elem).parent().text())); + }, + formatEmpfehlungIsTrue: function(empfehlungAm, emfehlungVon){ + $('#approveAnrechnungDetail-empfehlungDetail').children().addClass('hidden'); + $('#approveAnrechnungDetail-empfehlungDetail-empfehlungIsTrue').removeClass('hidden'); + $('#recommend-anrechnung').prop('disabled', true); + $('#dont-recommend-anrechnung').prop('disabled', true); + $('#approveAnrechnungDetail-empfehlungAm').text(empfehlungAm); + $('#approveAnrechnungDetail-empfehlungVon').text(emfehlungVon); + }, + formatEmpfehlungIsFalse: function(empfehlungAm, emfehlungVon, begruendung){ + $('#approveAnrechnungDetail-empfehlungDetail').children().addClass('hidden'); + $('#approveAnrechnungDetail-empfehlungDetail-empfehlungIsFalse').removeClass('hidden'); + $('#recommend-anrechnung').prop('disabled', true); + $('#dont-recommend-anrechnung').prop('disabled', true); + $('#approveAnrechnungDetail-empfehlungAm').text(empfehlungAm); + $('#approveAnrechnungDetail-empfehlungVon').text(emfehlungVon); + $('#approveAnrechnungDetail-empfehlungDetail-begruendung').text(begruendung); + } +} \ No newline at end of file diff --git a/public/js/lehre/anrechnung/reviewAnrechnungDetail.js b/public/js/lehre/anrechnung/reviewAnrechnungDetail.js index 22d22f26c..b753d3f64 100644 --- a/public/js/lehre/anrechnung/reviewAnrechnungDetail.js +++ b/public/js/lehre/anrechnung/reviewAnrechnungDetail.js @@ -21,13 +21,6 @@ $(function(){ // Set status alert color reviewAnrechnung.setStatusAlertColor(); - // Break Begruendung abgeben - $('#reviewAnrechnungUebersicht-begruendung-abbrechen').click(function(){ - $('#reviewAnrechnungUebersicht-begruendung').val(''); - $('#reviewAnrechnungUebersicht-begruendung-panel').slideUp('slow'); - - }) - // Copy Begruendung into textarea $(".btn-copyIntoTextarea").click(function(){ reviewAnrechnung.copyIntoTextarea(this); diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index febf31dfd..34680ad95 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -9188,6 +9188,46 @@ Any unusual occurrences 'insertvon' => 'system' ) ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'keineEmpfehlungAngefordert', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Es wurde noch keine Empfehlung angefordert.', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'You have not requested a recommendation yet.', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'empfehlungAngefordertNochKeineEmpfehlung', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Empfehlung wurde angefordert am ', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Recommendation was requested on ', + 'description' => '', + 'insertvon' => 'system' + ) + ) ) ); From 5e1bbfe7187c33234e3324281e9343dce0016e34 Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 3 Feb 2021 15:32:42 +0100 Subject: [PATCH 092/142] Minor change to InfoPanels Signed-off-by: cris-technikum --- .../lehre/anrechnung/reviewAnrechnungInfo.php | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/application/views/lehre/anrechnung/reviewAnrechnungInfo.php b/application/views/lehre/anrechnung/reviewAnrechnungInfo.php index 024a1cdf5..69c0687be 100644 --- a/application/views/lehre/anrechnung/reviewAnrechnungInfo.php +++ b/application/views/lehre/anrechnung/reviewAnrechnungInfo.php @@ -1,24 +1,4 @@
    -
    - -
    -
    - Eine Anerkennung setzt voraus, dass die erworbenen Kenntnisse mit dem Inhalt und Umfang der Lehrveranstaltung gleichwertig sind. -

    Wenn die Gleichwertigkeit gegeben ist, können auch außerhochschulisch erworbene Kenntnisse angerechnet werden (z.B. Sekundarschule, Weiterbildungseinrichtungen). -

    - Umfangmäßige Gleichwertigkeit Schule - Hochschule: -
    1 ECTS an der FH Technikum Wien entspricht einem Arbeitsaufwand von 25 Stunden, ein Schulhalbjahr besteht aus ca. 20 Wochen. -
    Das heißt eine Unterrichtsstunde pro Woche sind insgesamt ca. 20 Stunden. -
    -
    -
    +
    + +
    +
    + Eine Anerkennung setzt voraus, dass die erworbenen Kenntnisse mit dem Inhalt und Umfang der Lehrveranstaltung gleichwertig sind. +

    Wenn die Gleichwertigkeit gegeben ist, können auch außerhochschulisch erworbene Kenntnisse angerechnet werden (z.B. Sekundarschule, Weiterbildungseinrichtungen). +

    + Umfangmäßige Gleichwertigkeit Schule - Hochschule: +
    1 ECTS an der FH Technikum Wien entspricht einem Arbeitsaufwand von 25 Stunden, ein Schulhalbjahr besteht aus ca. 20 Wochen. +
    Das heißt eine Unterrichtsstunde pro Woche sind insgesamt ca. 20 Stunden. +
    +
    +
    +


    + +
    +
    + + +
    + +
    + p->t('anrechnung', 'genehmigung'); ?> +
    + p->t('anrechnung', 'abgeschlossenVon'); ?>: + abgeschlossen_von ?> +  |  + p->t('anrechnung', 'abschlussdatum'); ?>: + abgeschlossen_am ?> + +
    +
    + +
    + +
    + p->t('anrechnung', 'nochKeineGenehmigung'); ?> +
    + +
    + p->t('anrechnung', 'genehmigungPositiv'); ?> +
    + +
    +
    p->t('anrechnung', 'genehmigungNegativ'); ?>
    +
    p->t('global', 'begruendung'); ?>: + notiz ?> +
    +
    +
    +
    + + +
    +
    + +
    +
    + +
    + + +
    +
    diff --git a/public/js/lehre/anrechnung/approveAnrechnungDetail.js b/public/js/lehre/anrechnung/approveAnrechnungDetail.js index f7fc8b9ff..b211192a5 100644 --- a/public/js/lehre/anrechnung/approveAnrechnungDetail.js +++ b/public/js/lehre/anrechnung/approveAnrechnungDetail.js @@ -22,8 +22,8 @@ $(function(){ // Approve Anrechnungen $("#approve-anrechnung").click(function(){ - let genehmigung_panel = $('#approveAnrechnungUebersicht-empfehlung-panel'); - let begruendung_panel = $('#approveAnrechnungUebersicht-begruendung-panel'); + let genehmigung_panel = $('#approveAnrechnungDetail-genehmigung-panel'); + let begruendung_panel = $('#approveAnrechnungDetail-begruendung-panel'); begruendung_panel.css('display', 'none'); @@ -34,25 +34,15 @@ $(function(){ return; } - // Get selected rows data - let selected_data = $('#tableWidgetTabulator').tabulator('getSelectedData') - .map(function(data){ - // reduce to necessary fields - return { - 'anrechnung_id' : data.anrechnung_id, - } - }); - - // Alert and exit if no anrechnung is selected - if (selected_data.length == 0) - { - FHC_DialogLib.alertInfo('Bitte wählen Sie erst zumindest einen Antrag auf Anrechnung'); - return; - } + // Get form data + // index 0: anrechnung_id + let form_data = $('form').serializeArray(); // Prepare data object for ajax call let data = { - 'data': selected_data + 'data': [{ + 'anrechnung_id' : form_data[0].value + }] }; // Hide genehmigung panel again @@ -72,11 +62,11 @@ $(function(){ if (!data.error && data.retval != null) { - // Update status 'genehmigt' - $('#tableWidgetTabulator').tabulator('updateData', data.retval); - - // Print success message - FHC_DialogLib.alertSuccess(data.retval.length + " Anrechnungsanträge wurden genehmigt."); + approveAnrechnungDetail.formatGenehmigungIsPositiv( + data.retval[0].abgeschlossen_am, + data.retval[0].abgeschlossen_von, + data.retval[0].status_bezeichnung + ); } }, errorCallback: function (jqXHR, textStatus, errorThrown) @@ -89,9 +79,9 @@ $(function(){ // Reject Anrechnungen $("#reject-anrechnung").click(function(){ - let begruendung_panel = $('#approveAnrechnungUebersicht-begruendung-panel'); - let begruendung = $('#approveAnrechnungUebersicht-begruendung').val(); - let genehmigung_panel = $('#approveAnrechnungUebersicht-empfehlung-panel'); + let begruendung_panel = $('#approveAnrechnungDetail-begruendung-panel'); + let begruendung = $('#approveAnrechnungDetail-begruendung').val(); + let genehmigung_panel = $('#approveAnrechnungDetail-genehmigung-panel'); genehmigung_panel.css('display', 'none'); @@ -111,33 +101,23 @@ $(function(){ } } - // Get selected rows data - let selected_data = $('#tableWidgetTabulator').tabulator('getSelectedData') - .map(function(data){ - // reduce to necessary fields - return { - 'anrechnung_id' : data.anrechnung_id, - 'begruendung' : begruendung - } - }); - - // Alert and exit if no anrechnung is selected - if (selected_data.length == 0) - { - FHC_DialogLib.alertInfo('Bitte wählen Sie erst zumindest einen Antrag auf Anrechnung'); - return; - } + // Get form data + // index 0: anrechnung_id + let form_data = $('form').serializeArray(); // Confirm before rejecting - if(!confirm('Wollen Sie wirklich die gewählten Anträge ablehnen?')) + if(!confirm('Wollen Sie wirklich für die gewählten Anträge keine Empfehlung abgeben?')) { return; } // Prepare data object for ajax call let data = { - 'data': selected_data - }; + 'data': [{ + 'anrechnung_id' : form_data[0].value, + 'begruendung' : begruendung + }] + } // Hide begruendung panel again begruendung_panel.slideUp('slow'); @@ -156,11 +136,12 @@ $(function(){ if (!data.error && data.retval != null) { - // Update status 'genehmigt' - $('#tableWidgetTabulator').tabulator('updateData', data.retval); - - // Print success message - FHC_DialogLib.alertSuccess(data.retval.length + " Anrechnungsanträge wurden abgelehnt."); + approveAnrechnungDetail.formatGenehmigungIsNegativ( + data.retval[0].abgeschlossen_am, + data.retval[0].abgeschlossen_von, + data.retval[0].status_bezeichnung, + begruendung + ); } }, errorCallback: function (jqXHR, textStatus, errorThrown) @@ -219,9 +200,9 @@ $(function(){ approveAnrechnungDetail.copyIntoTextarea(this); }) - // Break Empfehlung abgeben - $('#approveAnrechnungDetail-empfehlung-abbrechen').click(function(){ - $('#approveAnrechnungDetail-empfehlung-panel').slideUp('slow'); + // Break Genehmigung abgeben + $('#approveAnrechnungDetail-genehmigung-abbrechen').click(function(){ + $('#approveAnrechnungDetail-genehmigung-panel').slideUp('slow'); }) @@ -270,23 +251,27 @@ var approveAnrechnungDetail = { $('#approve-anrechnung').prop('disabled', true); $('#reject-anrechnung').prop('disabled', true); }, - formatEmpfehlungIsTrue: function(empfehlungAm, emfehlungVon, statusBezeichnung){ - $('#approveAnrechnungDetail-empfehlungDetail').children().addClass('hidden'); - $('#approveAnrechnungDetail-empfehlungDetail-empfehlungIsTrue').removeClass('hidden'); + formatGenehmigungIsPositiv: function(abgeschlossenAm, abgeschlossenVon, statusBezeichnung){ + $('#approveAnrechnungDetail-genehmigungDetail').children().addClass('hidden'); + $('#approveAnrechnungDetail-genehmigungDetail-genehmigungIsPositiv').removeClass('hidden'); $('#approveAnrechnung-status_kurzbz').text(statusBezeichnung); + $('#approveAnrechnung-status_kurzbz').closest('div').removeClass('alert-warning').addClass('alert-success'); + $('#approveAnrechnungDetail-abgeschlossenAm').text(abgeschlossenAm); + $('#approveAnrechnungDetail-abgeschlossenVon').text(abgeschlossenVon); $('#request-recommendation').prop('disabled', true); $('#approve-anrechnung').prop('disabled', true); $('#reject-anrechnung').prop('disabled', true); }, - formatEmpfehlungIsFalse: function(empfehlungAm, emfehlungVon, statusBezeichnung, begruendung){ - $('#approveAnrechnungDetail-empfehlungDetail').children().addClass('hidden'); - $('#approveAnrechnungDetail-empfehlungDetail-empfehlungIsFalse').removeClass('hidden'); + formatGenehmigungIsNegativ: function(abgeschlossenAm, abgeschlossenVon, statusBezeichnung, begruendung){ + $('#approveAnrechnungDetail-genehmigungDetail').children().addClass('hidden'); + $('#approveAnrechnungDetail-genehmigungDetail-genehmigungIsNegativ').removeClass('hidden'); $('#approveAnrechnung-status_kurzbz').text(statusBezeichnung); + $('#approveAnrechnung-status_kurzbz').closest('div').removeClass('alert-warning').addClass('alert-danger'); + $('#approveAnrechnungDetail-abgeschlossenAm').text(abgeschlossenAm); + $('#approveAnrechnungDetail-abgeschlossenVon').text(abgeschlossenVon); + $('#approveAnrechnungDetail-genehmigungDetail-begruendung').text(begruendung); $('#request-recommendation').prop('disabled', true); $('#approve-anrechnung').prop('disabled', true); $('#reject-anrechnung').prop('disabled', true); - $('#approveAnrechnungDetail-empfehlungAm').text(empfehlungAm); - $('#approveAnrechnungDetail-empfehlungVon').text(emfehlungVon); - $('#approveAnrechnungDetail-empfehlungDetail-begruendung').text(begruendung); } } \ No newline at end of file diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 34680ad95..dfde89cdc 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -9057,13 +9057,13 @@ Any unusual occurrences 'phrases' => array( array( 'sprache' => 'German', - 'text' => 'Es wurde noch keine Empfehlung abgegeben.', + 'text' => 'Es wurde keine Empfehlung abgegeben.', 'description' => '', 'insertvon' => 'system' ), array( 'sprache' => 'English', - 'text' => 'No recommendation has been sent yet.', + 'text' => 'No request for recommendation.', 'description' => '', 'insertvon' => 'system' ) @@ -9177,7 +9177,7 @@ Any unusual occurrences 'phrases' => array( array( 'sprache' => 'German', - 'text' => 'Anrechnungen wird genehmigt, weil die Kenntnisse inhaltlich und umfangmäßig gleichwertig sind.', + 'text' => 'Anrechnung wird genehmigt, weil die Kenntnisse inhaltlich und umfangmäßig gleichwertig sind.', 'description' => '', 'insertvon' => 'system' ), @@ -9228,6 +9228,86 @@ Any unusual occurrences 'insertvon' => 'system' ) ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'genehmigung', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Genehmigung', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Approvement', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'abgeschlossenVon', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Abgeschlossen von', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Closed by', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'abschlussdatum', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Abschlussdatum', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Closing date', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'nochKeineGenehmigung', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Der Antrag auf Anerkennung der nachgewiesenen Kenntnisse erfordert Ihre Genehmigung / Ablehnung.', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) ) ); From e6da4b2e2d9d2dd239f88d43c8ddbbd91a854c96 Mon Sep 17 00:00:00 2001 From: Cris Date: Thu, 4 Feb 2021 10:25:57 +0100 Subject: [PATCH 101/142] Minor changes - unfold 'Antrag Voraussetzungen' in Infopanels - open Detailpage on same page (not on new tab) - unified sancho mails titles Signed-off-by: cris-technikum --- .../controllers/lehre/anrechnung/ApproveAnrechnungDetail.php | 4 ++-- .../lehre/anrechnung/ApproveAnrechnungUebersicht.php | 4 ++-- .../controllers/lehre/anrechnung/RequestAnrechnung.php | 2 +- .../controllers/lehre/anrechnung/ReviewAnrechnungDetail.php | 2 +- .../lehre/anrechnung/ReviewAnrechnungUebersicht.php | 2 +- application/views/lehre/anrechnung/reviewAnrechnungInfo.php | 2 +- public/js/lehre/anrechnung/approveAnrechnungUebersicht.js | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/application/controllers/lehre/anrechnung/ApproveAnrechnungDetail.php b/application/controllers/lehre/anrechnung/ApproveAnrechnungDetail.php index 6a5a74dd0..d31769199 100644 --- a/application/controllers/lehre/anrechnung/ApproveAnrechnungDetail.php +++ b/application/controllers/lehre/anrechnung/ApproveAnrechnungDetail.php @@ -320,7 +320,7 @@ class approveAnrechnungDetail extends Auth_Controller 'AnrechnungGenehmigen', $body_fields, $to, - 'Ihr Antrag auf Anerkennung nachgewiesener Kenntnisse wurde abgeschlossen' + 'Anerkennung nachgewiesener Kenntnisse: Ihr Antrag ist abgeschlossen' ); return true; @@ -384,7 +384,7 @@ class approveAnrechnungDetail extends Auth_Controller 'AnrechnungEmpfehlungAnfordern', $body_fields, $to, - 'Neue LV-Anrechnungsanträge benötigen Deine Empfehlung' + 'Anerkennung nachgewiesener Kenntnisse: Deine Empfehlung wird benötigt' ); } return true; diff --git a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php index 772825c7c..528cf9ef1 100644 --- a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php +++ b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php @@ -292,7 +292,7 @@ class approveAnrechnungUebersicht extends Auth_Controller 'AnrechnungGenehmigen', $body_fields, $to, - 'Ihr Antrag auf Anerkennung nachgewiesener Kenntnisse wurde abgeschlossen' + 'Anerkennung nachgewiesener Kenntnisse: Ihr Antrag ist abgeschlossen' ); return true; @@ -356,7 +356,7 @@ class approveAnrechnungUebersicht extends Auth_Controller 'AnrechnungEmpfehlungAnfordern', $body_fields, $to, - 'Neue LV-Anrechnungsanträge benötigen Deine Empfehlung' + 'Anerkennung nachgewiesener Kenntnisse: Deine Empfehlung wird benötigt' ); } return true; diff --git a/application/controllers/lehre/anrechnung/RequestAnrechnung.php b/application/controllers/lehre/anrechnung/RequestAnrechnung.php index 50daa9d58..197be0c52 100644 --- a/application/controllers/lehre/anrechnung/RequestAnrechnung.php +++ b/application/controllers/lehre/anrechnung/RequestAnrechnung.php @@ -325,7 +325,7 @@ class requestAnrechnung extends Auth_Controller 'AnrechnungAntragStellen', $body_fields, $to, - 'Neuer LV-Anrechnungsantrag' + 'Anerkennung nachgewiesener Kenntnisse: Neuer Antrag wurde gestellt' ); return true; diff --git a/application/controllers/lehre/anrechnung/ReviewAnrechnungDetail.php b/application/controllers/lehre/anrechnung/ReviewAnrechnungDetail.php index 136006e7b..a6cf66919 100644 --- a/application/controllers/lehre/anrechnung/ReviewAnrechnungDetail.php +++ b/application/controllers/lehre/anrechnung/ReviewAnrechnungDetail.php @@ -294,7 +294,7 @@ class reviewAnrechnungDetail extends Auth_Controller 'AnrechnungEmpfehlungAbgeben', $body_fields, $to, - 'Neue '. ($empfehlung ? 'positive' : 'negative'). ' Empfehlungen für LV-Anrechnungsanträge' + 'Anerkennung nachgewiesener Kenntnisse: Empfehlung wurde abgegeben' ); } diff --git a/application/controllers/lehre/anrechnung/ReviewAnrechnungUebersicht.php b/application/controllers/lehre/anrechnung/ReviewAnrechnungUebersicht.php index ba1b81b17..4f6345d5b 100644 --- a/application/controllers/lehre/anrechnung/ReviewAnrechnungUebersicht.php +++ b/application/controllers/lehre/anrechnung/ReviewAnrechnungUebersicht.php @@ -266,7 +266,7 @@ class reviewAnrechnungUebersicht extends Auth_Controller 'AnrechnungEmpfehlungAbgeben', $body_fields, $to, - 'Neue '. ($empfehlung ? 'positive' : 'negative'). ' Empfehlungen für LV-Anrechnungsanträge' + 'Anerkennung nachgewiesener Kenntnisse: Empfehlung wurde abgegeben' ); } diff --git a/application/views/lehre/anrechnung/reviewAnrechnungInfo.php b/application/views/lehre/anrechnung/reviewAnrechnungInfo.php index 69c0687be..510db7166 100644 --- a/application/views/lehre/anrechnung/reviewAnrechnungInfo.php +++ b/application/views/lehre/anrechnung/reviewAnrechnungInfo.php @@ -27,7 +27,7 @@
    -
    +
    Eine Anerkennung setzt voraus, dass die erworbenen Kenntnisse mit dem Inhalt und Umfang der Lehrveranstaltung gleichwertig sind.

    Wenn die Gleichwertigkeit gegeben ist, können auch außerhochschulisch erworbene Kenntnisse angerechnet werden (z.B. Sekundarschule, Weiterbildungseinrichtungen). diff --git a/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js b/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js index 275c6795c..6c647492f 100644 --- a/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js +++ b/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js @@ -29,7 +29,7 @@ function func_tableBuilt(table) { url:function(cell){ return BASE_URL + "/" + APPROVE_ANRECHNUNG_DETAIL_URI + "?anrechnung_id=" + cell.getData().anrechnung_id }, - target:"_blank" + // target:"_blank" } }, false, "status" // place column after status ); From cfc3b4f985ce27d600bdc43b5520c9a3b2077135 Mon Sep 17 00:00:00 2001 From: Cris Date: Thu, 4 Feb 2021 11:04:20 +0100 Subject: [PATCH 102/142] Corrected: Added space to be able to disable textarea Signed-off-by: cris-technikum --- application/views/lehre/anrechnung/requestAnrechnung.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/lehre/anrechnung/requestAnrechnung.php b/application/views/lehre/anrechnung/requestAnrechnung.php index fd577142b..bb821b611 100644 --- a/application/views/lehre/anrechnung/requestAnrechnung.php +++ b/application/views/lehre/anrechnung/requestAnrechnung.php @@ -169,7 +169,7 @@ $this->load->view(
    + required >anmerkung; ?>
    From 4a8fa95a3a82f1d9f83eb96cc2063306e7fd3167 Mon Sep 17 00:00:00 2001 From: Cris Date: Thu, 4 Feb 2021 15:36:12 +0100 Subject: [PATCH 103/142] Changed: Now infobox color is blue and icons are info-icons Signed-off-by: cris-technikum --- .../anrechnung/requestAnrechnungImportant.php | 16 ++++++++-------- .../lehre/anrechnung/reviewAnrechnungInfo.php | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/application/views/lehre/anrechnung/requestAnrechnungImportant.php b/application/views/lehre/anrechnung/requestAnrechnungImportant.php index d0c3d7110..b80658681 100644 --- a/application/views/lehre/anrechnung/requestAnrechnungImportant.php +++ b/application/views/lehre/anrechnung/requestAnrechnungImportant.php @@ -1,10 +1,10 @@
    -
    +
    @@ -12,8 +12,8 @@
    Bitte laden Sie den Antrag in deutscher oder englischer Sprache für das
      -
    • Wintersemester spätestens bis 15. September
    • -
    • Sommersemester spätestens bis 22. Februar hoch
    • +
    • Wintersemester spätestens bis 15. September
    • +
    • Sommersemester spätestens bis 22. Februar hoch

    Die Entscheidung über den Antrag erfolgt in der Regel innerhalb von zwei Wochen ab dem 15. September bzw. 22. Februar. @@ -21,12 +21,12 @@
    -
    -
    +
    diff --git a/application/views/lehre/anrechnung/reviewAnrechnungInfo.php b/application/views/lehre/anrechnung/reviewAnrechnungInfo.php index 510db7166..46f02e264 100644 --- a/application/views/lehre/anrechnung/reviewAnrechnungInfo.php +++ b/application/views/lehre/anrechnung/reviewAnrechnungInfo.php @@ -1,10 +1,10 @@ -
    -
    -
    +
    From 071a6a4ee6365601d3ab6d0d949af45d10028943 Mon Sep 17 00:00:00 2001 From: Cris Date: Thu, 4 Feb 2021 15:42:26 +0100 Subject: [PATCH 104/142] Added tooltips (Upload info, Read Infoboxen-info) Signed-off-by: cris-technikum --- .../anrechnung/approveAnrechnungDetail.php | 6 +- .../lehre/anrechnung/requestAnrechnung.php | 36 ++++++--- .../anrechnung/reviewAnrechnungDetail.php | 5 ++ .../anrechnung/approveAnrechnungDetail.js | 10 +++ .../js/lehre/anrechnung/requestAnrechnung.js | 12 +++ .../anrechnung/reviewAnrechnungDetail.js | 11 +++ system/phrasesupdate.php | 80 +++++++++++++++++++ 7 files changed, 148 insertions(+), 12 deletions(-) diff --git a/application/views/lehre/anrechnung/approveAnrechnungDetail.php b/application/views/lehre/anrechnung/approveAnrechnungDetail.php index 76e707e17..d84d18234 100644 --- a/application/views/lehre/anrechnung/approveAnrechnungDetail.php +++ b/application/views/lehre/anrechnung/approveAnrechnungDetail.php @@ -65,7 +65,11 @@ $this->load->view(
    - p->t('anrechnung', 'antrag'); ?> + p->t('anrechnung', 'antrag'); ?>  + + + p->t('anrechnung', 'antragdatum'); ?>: anrechnung_id) ? $anrechnungData->insertamum : '-' ?>
    diff --git a/application/views/lehre/anrechnung/requestAnrechnung.php b/application/views/lehre/anrechnung/requestAnrechnung.php index bb821b611..86336ab8b 100644 --- a/application/views/lehre/anrechnung/requestAnrechnung.php +++ b/application/views/lehre/anrechnung/requestAnrechnung.php @@ -67,7 +67,11 @@ $this->load->view(
    - p->t('anrechnung', 'antrag'); ?> + p->t('anrechnung', 'antrag'); ?>  + + + p->t('anrechnung', 'antragdatum'); ?>: anrechnung_id) ? $anrechnungData->insertamum : '-' ?>
    @@ -115,7 +119,7 @@ $this->load->view(
    -
    +

    p->t('anrechnung', 'antragStellenText'); ?>

    - +
    - -
    - +
    - +
    Status: diff --git a/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php b/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php index ef9a419ae..57c87b94e 100644 --- a/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php +++ b/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php @@ -12,15 +12,15 @@ $this->load->view( 'dialoglib' => true, 'tablewidget' => true, 'phrases' => array( - 'global' => array( - 'begruendung' - ), - 'anrechnung' => array( - 'nachweisdokumente', - 'empfehlung', - 'confirmTextAntragHatBereitsEmpfehlung', - 'herkunft' - ), + 'global' => array( + 'begruendung' + ), + 'anrechnung' => array( + 'nachweisdokumente', + 'empfehlung', + 'confirmTextAntragHatBereitsEmpfehlung', + 'herkunft' + ), 'ui' => array( 'anzeigen', 'alleAnzeigen', @@ -35,15 +35,15 @@ $this->load->view( 'tabelleneinstellungen', 'keineDatenVorhanden', 'spaltenEinstellen', - 'ja', - 'nein', - 'nichtSelektierbarAufgrundVon' + 'ja', + 'nein', + 'nichtSelektierbarAufgrundVon' ), 'person' => array( 'student', 'personenkennzeichen', - 'vorname', - 'nachname' + 'vorname', + 'nachname' ), 'lehre' => array( 'studiensemester', @@ -65,7 +65,7 @@ $this->load->view( 'zeilenAuswaehlenEinzeln', 'zeilenAuswaehlenBereich', 'zeilenAuswaehlenAlle' - ) + ) ), 'customJSs' => array( 'public/js/bootstrapper.js', @@ -77,16 +77,16 @@ $this->load->view(
    @@ -174,33 +184,40 @@ $this->load->view(
    - +
    - - - + + +
    -
    +
    diff --git a/application/views/lehre/anrechnung/reviewAnrechnungDetail.php b/application/views/lehre/anrechnung/reviewAnrechnungDetail.php index 9028b40e8..73713561a 100644 --- a/application/views/lehre/anrechnung/reviewAnrechnungDetail.php +++ b/application/views/lehre/anrechnung/reviewAnrechnungDetail.php @@ -59,7 +59,7 @@ $this->load->view(
    - +
    @@ -67,7 +67,8 @@ $this->load->view(
    p->t('anrechnung', 'antrag'); ?>   - @@ -103,11 +104,11 @@ $this->load->view( p->t('lehre', 'lektorInnen'); ?> - lektoren) - 1 ?> - lektoren as $key => $lektor): ?> - vorname . ' ' . $lektor->nachname; - echo $key === $len ? '' : ', ' ?> - + lektoren) - 1 ?> + lektoren as $key => $lektor): ?> + vorname . ' ' . $lektor->nachname; + echo $key === $len ? '' : ', ' ?> + @@ -129,107 +130,128 @@ $this->load->view(
    -
    - -
    - -
    - p->t('anrechnung', 'empfehlung'); ?> -
    - p->t('anrechnung', 'empfehlungVon'); ?>: - empfehlung_von ?> -  |  - p->t('anrechnung', 'empfehlungdatum'); ?>: - empfehlung_am ?> - +
    +
    + p->t('anrechnung', 'empfehlung'); ?> +
    + p->t('anrechnung', 'empfehlungVon'); ?>: + empfehlung_von ?> +  |  + p->t('anrechnung', 'empfehlungdatum'); ?>: + empfehlung_am ?> + +
    +
    +
    + +
    + p->t('anrechnung', 'nochKeineEmpfehlung'); ?> +
    + +
    + p->t('anrechnung', 'empfehlungPositivConfirmed'); ?> +
    + +
    +
    + p->t('anrechnung', 'empfehlungNegativConfirmed'); ?> +
    +
    p->t('global', 'begruendung'); ?> + : + notiz ?>
    - -
    - -
    - p->t('anrechnung', 'nochKeineEmpfehlung'); ?> -
    - -
    - p->t('anrechnung', 'empfehlungPositiv'); ?> -
    - -
    -
    p->t('anrechnung', 'empfehlungNegativ'); ?>
    -
    p->t('global', 'begruendung'); ?>: - notiz ?> -
    -
    -
    -
    +
    +
    +
    - +
    - -
    - - -
    +
    - +
    Status: diff --git a/application/views/lehre/anrechnung/reviewAnrechnungUebersicht.php b/application/views/lehre/anrechnung/reviewAnrechnungUebersicht.php index 5941ab741..51b1e60b2 100644 --- a/application/views/lehre/anrechnung/reviewAnrechnungUebersicht.php +++ b/application/views/lehre/anrechnung/reviewAnrechnungUebersicht.php @@ -120,23 +120,25 @@ $this->load->view( @@ -205,9 +216,9 @@ $this->load->view(
    - -
    diff --git a/public/js/lehre/anrechnung/approveAnrechnungDetail.js b/public/js/lehre/anrechnung/approveAnrechnungDetail.js index e72a781d7..3313f7202 100644 --- a/public/js/lehre/anrechnung/approveAnrechnungDetail.js +++ b/public/js/lehre/anrechnung/approveAnrechnungDetail.js @@ -7,6 +7,10 @@ const ANRECHNUNGSTATUS_REJECTED = 'rejected'; $(function(){ + + const genehmigung_panel = $('#approveAnrechnungDetail-genehmigung-panel'); + const begruendung_panel = $('#approveAnrechnungDetail-begruendung-panel'); + // Pruefen ob Promise unterstuetzt wird // Tabulator funktioniert nicht mit IE var canPromise = !! window.Promise; @@ -23,10 +27,8 @@ $(function(){ // Init tooltips approveAnrechnungDetail.initTooltips(); - // Approve Anrechnungen - $("#approve-anrechnung").click(function(){ - let genehmigung_panel = $('#approveAnrechnungDetail-genehmigung-panel'); - let begruendung_panel = $('#approveAnrechnungDetail-begruendung-panel'); + // Ask if Approve Anrechnungen + $("#approveAnrechnungDetail-approve-anrechnung-ask").click(function(){ begruendung_panel.css('display', 'none'); @@ -36,9 +38,12 @@ $(function(){ genehmigung_panel.slideDown('slow'); return; } + }); + + // Approve Anrechnungen + $("#approveAnrechnungDetail-approve-anrechnung-confirm").click(function(){ // Get form data - // index 0: anrechnung_id let form_data = $('form').serializeArray(); // Prepare data object for ajax call @@ -80,11 +85,8 @@ $(function(){ ); }); - // Reject Anrechnungen - $("#reject-anrechnung").click(function(){ - let begruendung_panel = $('#approveAnrechnungDetail-begruendung-panel'); - let begruendung = $('#approveAnrechnungDetail-begruendung').val(); - let genehmigung_panel = $('#approveAnrechnungDetail-genehmigung-panel'); + // Ask if Reject Anrechnungen + $("#approveAnrechnungDetail-reject-anrechnung-ask").click(function(){ genehmigung_panel.css('display', 'none'); @@ -94,26 +96,26 @@ $(function(){ begruendung_panel.slideDown('slow'); return; } - else - { - // Check if begruendung is given - if (!begruendung.trim()) // empty or white spaces only - { - FHC_DialogLib.alertInfo('Bitte tragen Sie eine Begründung ein.'); - return; - } - } + }); - // Get form data - // index 0: anrechnung_id - let form_data = $('form').serializeArray(); + // Reject Anrechnungen + $("#approveAnrechnungDetail-reject-anrechnung-confirm").click(function(){ - // Confirm before rejecting - if(!confirm('Wollen Sie wirklich für die gewählten Anträge keine Empfehlung abgeben?')) + let begruendung = $('#approveAnrechnungDetail-begruendung').val(); + + // Check if begruendung is given + if (!begruendung.trim()) // empty or white spaces only { + FHC_DialogLib.alertInfo('Bitte tragen Sie eine Begründung ein.'); return; } + // Avoid form redirecting automatically + event.preventDefault(); + + // Get form data + let form_data = $('form').serializeArray(); + // Prepare data object for ajax call let data = { 'data': [{ @@ -159,7 +161,6 @@ $(function(){ $("#request-recommendation").click(function(){ // Get form data - // index 0: anrechnung_id let form_data = $('form').serializeArray(); @@ -205,14 +206,14 @@ $(function(){ // Break Genehmigung abgeben $('#approveAnrechnungDetail-genehmigung-abbrechen').click(function(){ - $('#approveAnrechnungDetail-genehmigung-panel').slideUp('slow'); + genehmigung_panel.slideUp('slow'); }) // Break Begruendung abgeben $('#approveAnrechnungDetail-begruendung-abbrechen').click(function(){ $('#approveAnrechnungDetail-begruendung').val(''); - $('#approveAnrechnungDetail-begruendung-panel').slideUp('slow'); + begruendung_panel.slideUp('slow'); }) @@ -250,7 +251,7 @@ var approveAnrechnungDetail = { let textarea = $(elem).closest('div').find('textarea'); // Copy begruendung into textarea - textarea.val($.trim($(elem).parent().text())); + textarea.val($.trim($(elem).parent().find('span:first').text())); }, formatEmpfehlungIsRequested: function(empfehlungAngefordertAm, statusBezeichnung) { $('#approveAnrechnungDetail-empfehlungDetail').children().addClass('hidden'); diff --git a/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js b/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js index 6c647492f..142c57573 100644 --- a/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js +++ b/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js @@ -100,6 +100,10 @@ function tableWidgetHook_selectAllButton(tableWidgetDiv){ $(function(){ + + const genehmigung_panel = $('#approveAnrechnungUebersicht-genehmigung-panel'); + const begruendung_panel = $('#approveAnrechnungUebersicht-begruendung-panel'); + // Pruefen ob Promise unterstuetzt wird // Tabulator funktioniert nicht mit IE var canPromise = !! window.Promise; @@ -170,10 +174,8 @@ $(function(){ } }) - // Approve Anrechnungen - $("#approve-anrechnungen").click(function(){ - let genehmigung_panel = $('#approveAnrechnungUebersicht-empfehlung-panel'); - let begruendung_panel = $('#approveAnrechnungUebersicht-begruendung-panel'); + // Ask if Approve Anrechnungen + $("#approveAnrechnungUebersicht-approve-anrechnungen-ask").click(function(){ begruendung_panel.css('display', 'none'); @@ -183,6 +185,10 @@ $(function(){ genehmigung_panel.slideDown('slow'); return; } + }); + + // Approve Anrechnungen + $("#approveAnrechnungUebersicht-approve-anrechnungen-confirm").click(function(){ // Get selected rows data let selected_data = $('#tableWidgetTabulator').tabulator('getSelectedData') @@ -237,11 +243,8 @@ $(function(){ ); }); - // Reject Anrechnungen - $("#reject-anrechnungen").click(function(){ - let begruendung_panel = $('#approveAnrechnungUebersicht-begruendung-panel'); - let begruendung = $('#approveAnrechnungUebersicht-begruendung').val(); - let genehmigung_panel = $('#approveAnrechnungUebersicht-empfehlung-panel'); + // Ask if Reject Anrechnungen + $("#approveAnrechnungUebersicht-reject-anrechnungen-ask").click(function(){ genehmigung_panel.css('display', 'none'); @@ -251,14 +254,20 @@ $(function(){ begruendung_panel.slideDown('slow'); return; } - else + }); + + // Reject Anrechnungen + $("#approveAnrechnungUebersicht-reject-anrechnungen-confirm").click(function(){ + + let begruendung = $('#approveAnrechnungUebersicht-begruendung').val(); + + genehmigung_panel.css('display', 'none'); + + // Check if begruendung is given + if (!begruendung.trim()) // empty or white spaces only { - // Check if begruendung is given - if (!begruendung.trim()) // empty or white spaces only - { - FHC_DialogLib.alertInfo('Bitte tragen Sie eine Begründung ein.'); - return; - } + FHC_DialogLib.alertInfo('Bitte tragen Sie eine Begründung ein.'); + return; } // Get selected rows data @@ -278,11 +287,8 @@ $(function(){ return; } - // Confirm before rejecting - if(!confirm('Wollen Sie wirklich die gewählten Anträge ablehnen?')) - { - return; - } + // Avoid form redirecting automatically + event.preventDefault(); // Prepare data object for ajax call let data = { @@ -322,7 +328,7 @@ $(function(){ }); // Request Recommendation for Anrechnungen - $("#request-recommendation").click(function(){ + $("#approveAnrechnungUebersicht-request-recommendation").click(function(){ // Get selected rows data let selected_data = $('#tableWidgetTabulator').tabulator('getSelectedData'); @@ -386,14 +392,14 @@ $(function(){ // Break Genehmigung abgeben $('#approveAnrechnungUebersicht-empfehlung-abbrechen').click(function(){ - $('#approveAnrechnungUebersicht-empfehlung-panel').slideUp('slow'); + genehmigung_panel.slideUp('slow'); }) // Break Ablehnung abgeben $('#approveAnrechnungUebersicht-begruendung-abbrechen').click(function(){ $('#approveAnrechnungUebersicht-begruendung').val(''); - $('#approveAnrechnungUebersicht-begruendung-panel').slideUp('slow'); + begruendung_panel.slideUp('slow'); }) diff --git a/public/js/lehre/anrechnung/reviewAnrechnungDetail.js b/public/js/lehre/anrechnung/reviewAnrechnungDetail.js index 31ee7e6ac..2865421ce 100644 --- a/public/js/lehre/anrechnung/reviewAnrechnungDetail.js +++ b/public/js/lehre/anrechnung/reviewAnrechnungDetail.js @@ -7,6 +7,10 @@ const ANRECHNUNGSTATUS_REJECTED = 'rejected'; $(function(){ + + const empfehlung_panel = $('#reviewAnrechnungDetail-empfehlung-panel'); + const begruendung_panel = $('#reviewAnrechnungDetail-begruendung-panel'); + // Pruefen ob Promise unterstuetzt wird // Tabulator funktioniert nicht mit IE var canPromise = !! window.Promise; @@ -29,10 +33,8 @@ $(function(){ reviewAnrechnung.copyIntoTextarea(this); }) - // Recommend Anrechnung (Detail GUI) - $("#recommend-anrechnung").click(function(){ - let empfehlung_panel = $('#reviewAnrechnungDetail-empfehlung-panel'); - let begruendung_panel = $('#reviewAnrechnungDetail-begruendung-panel'); + // Ask if Recommend Anrechnung + $("#reviewAnrechnungDetail-recommend-anrechnung-ask").click(function(){ begruendung_panel.css('display', 'none'); @@ -42,9 +44,12 @@ $(function(){ empfehlung_panel.slideDown('slow'); return; } + }); + + // Recommend Anrechnung + $("#reviewAnrechnungDetail-recommend-anrechnung-confirm").click(function(){ // Get form data - // index 0: anrechnung_id let form_data = $('form').serializeArray(); // Prepare data object for ajax call @@ -55,7 +60,7 @@ $(function(){ }; // Hide begruendung panel again - $(empfehlung_panel).slideUp('slow'); + empfehlung_panel.slideUp('slow'); FHC_AjaxClient.ajaxCallPost( FHC_JS_DATA_STORAGE_OBJECT.called_path + "/recommend", @@ -86,13 +91,8 @@ $(function(){ ); }); - // Dont recommend Anrechnung (Detail GUI) - $("#dont-recommend-anrechnung").click(function(){ - - let begruendung_panel = $('#reviewAnrechnungDetail-begruendung-panel'); - let begruendung = $('#reviewAnrechnungDetail-begruendung').val(); - - let empfehlung_panel = $('#reviewAnrechnungDetail-empfehlung-panel'); + // Ask if Dont recommend Anrechnung + $("#reviewAnrechnungDetail-dont-recommend-anrechnung-ask").click(function(){ empfehlung_panel.css('display', 'none'); @@ -102,27 +102,26 @@ $(function(){ begruendung_panel.slideDown('slow'); return; } - else - { - // Check if begruendung is given - if (!begruendung.trim()) // empty or white spaces only - { - FHC_DialogLib.alertInfo('Bitte tragen Sie eine Begründung ein.'); - return; - } - } - - - // Get form data - // index 0: anrechnung_id - let form_data = $('form').serializeArray(); - - // Confirm before rejecting - if(!confirm('Wollen Sie wirklich für die gewählten Anträge keine Empfehlung abgeben?')) + }); + + // Dont recommend Anrechnung + $("#reviewAnrechnungDetail-dont-recommend-anrechnung-confirm").click(function(){ + + let begruendung = $('#reviewAnrechnungDetail-begruendung').val(); + + // Check if begruendung is given + if (!begruendung.trim()) // empty or white spaces only { + FHC_DialogLib.alertInfo('Bitte tragen Sie eine Begründung ein.'); return; } + // Avoid form redirecting automatically + event.preventDefault(); + + // Get form data + let form_data = $('form').serializeArray(); + // Prepare data object for ajax call let data = { 'data': [{ @@ -132,7 +131,7 @@ $(function(){ } // Hide begruendung panel again - $(begruendung_panel).slideUp('slow'); + begruendung_panel.slideUp('slow'); FHC_AjaxClient.ajaxCallPost( FHC_JS_DATA_STORAGE_OBJECT.called_path + "/dontRecommend", @@ -166,15 +165,14 @@ $(function(){ // Break Empfehlung abgeben $('#reviewAnrechnungDetail-empfehlung-abbrechen').click(function(){ - $('#reviewAnrechnungDetail-empfehlung-panel').slideUp('slow'); + empfehlung_panel.slideUp('slow'); }) // Break Begruendung abgeben $('#reviewAnrechnungDetail-begruendung-abbrechen').click(function(){ $('#reviewAnrechnungDetail-begruendung').val(''); - $('#reviewAnrechnungDetail-begruendung-panel').slideUp('slow'); - + begruendung_panel.slideUp('slow'); }) @@ -212,7 +210,7 @@ var reviewAnrechnung = { let textarea = $(elem).closest('div').find('textarea'); // Copy begruendung into textarea - textarea.val($.trim($(elem).parent().text())); + textarea.val($.trim($(elem).parent().find('span:first').text())); }, formatEmpfehlungIsTrue: function(empfehlungAm, emfehlungVon, statusBezeichnung){ $('#reviewAnrechnungDetail-empfehlungDetail').children().addClass('hidden'); diff --git a/public/js/lehre/anrechnung/reviewAnrechnungUebersicht.js b/public/js/lehre/anrechnung/reviewAnrechnungUebersicht.js index 7a0e09b99..854d1e299 100644 --- a/public/js/lehre/anrechnung/reviewAnrechnungUebersicht.js +++ b/public/js/lehre/anrechnung/reviewAnrechnungUebersicht.js @@ -98,6 +98,10 @@ function tableWidgetHook_selectAllButton(tableWidgetDiv){ $(function(){ + + const empfehlung_panel = $('#reviewAnrechnungUebersicht-empfehlung-panel'); + const begruendung_panel = $('#reviewAnrechnungUebersicht-begruendung-panel'); + // Pruefen ob Promise unterstuetzt wird // Tabulator funktioniert nicht mit IE var canPromise = !! window.Promise; @@ -177,10 +181,8 @@ $(function(){ } }) - // Recommend Anrechnungen - $("#recommend-anrechnungen").click(function(){ - let empfehlung_panel = $('#reviewAnrechnungUebersicht-empfehlung-panel'); - let begruendung_panel = $('#reviewAnrechnungUebersicht-begruendung-panel'); + // Ask ifRecommend Anrechnungen + $("#reviewAnrechnungUebersicht-recommend-anrechnungen-ask").click(function(){ begruendung_panel.css('display', 'none'); @@ -190,6 +192,10 @@ $(function(){ empfehlung_panel.slideDown('slow'); return; } + }); + + // Recommend Anrechnungen + $("#reviewAnrechnungUebersicht-recommend-anrechnungen-confirm").click(function(){ // Get selected rows data let selected_data = $('#tableWidgetTabulator').tabulator('getSelectedData') @@ -245,12 +251,8 @@ $(function(){ ); }); - // Dont recommend Anrechnungen (Overview GUI) - $("#dont-recommend-anrechnungen").click(function(){ - - let begruendung_panel = $('#reviewAnrechnungUebersicht-begruendung-panel'); - let begruendung = $('#reviewAnrechnungUebersicht-begruendung').val(); - let empfehlung_panel = $('#reviewAnrechnungUebersicht-empfehlung-panel'); + // Ask if Dont recommend Anrechnungen + $("#reviewAnrechnungUebersicht-dont-recommend-anrechnungen-ask").click(function(){ empfehlung_panel.css('display', 'none'); @@ -260,14 +262,20 @@ $(function(){ begruendung_panel.slideDown('slow'); return; } - else + }); + + // Dont recommend Anrechnungen + $("#reviewAnrechnungUebersicht-dont-recommend-anrechnungen-confirm").click(function(){ + + let begruendung = $('#reviewAnrechnungUebersicht-begruendung').val(); + + empfehlung_panel.css('display', 'none'); + + // Check if begruendung is given + if (!begruendung.trim()) // empty or white spaces only { - // Check if begruendung is given - if (!begruendung.trim()) // empty or white spaces only - { - FHC_DialogLib.alertInfo('Bitte tragen Sie eine Begründung ein.'); - return; - } + FHC_DialogLib.alertInfo('Bitte tragen Sie eine Begründung ein.'); + return; } // Get selected rows data and add begruendung @@ -287,11 +295,8 @@ $(function(){ return; } - // Confirm before rejecting - if(!confirm('Wollen Sie wirklich für die gewählten Anträge keine Empfehlung abgeben?')) - { - return; - } + // Avoid form redirecting automatically + event.preventDefault(); // Prepare data object for ajax call let data = { @@ -332,14 +337,14 @@ $(function(){ // Break Empfehlung abgeben $('#reviewAnrechnungUebersicht-empfehlung-abbrechen').click(function(){ - $('#reviewAnrechnungUebersicht-empfehlung-panel').slideUp('slow'); + empfehlung_panel.slideUp('slow'); }) // Break Begruendung abgeben $('#reviewAnrechnungUebersicht-begruendung-abbrechen').click(function(){ $('#reviewAnrechnungUebersicht-begruendung').val(''); - $('#reviewAnrechnungUebersicht-begruendung-panel').slideUp('slow'); + begruendung_panel.slideUp('slow'); }) diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index fac59b210..b0e97e6b3 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -8792,12 +8792,32 @@ Any unusual occurrences array( 'app' => 'core', 'category' => 'anrechnung', - 'phrase' => 'empfehlungPositiv', + 'phrase' => 'empfehlungPositivSubquestion', 'insertvon' => 'system', 'phrases' => array( array( 'sprache' => 'German', - 'text' => 'Anrechnung wird empfohlen, weil die Kenntnisse inhaltlich und umfangmäßig gleichwertig sind.', + 'text' => "Bitte bestätigen Sie: Anrechnung wird empfohlen, weil die Kenntnisse inhaltlich und umfangmäßig gleichwertig sind.", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'empfehlungPositivConfirmed', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Anrechnung wird empfohlen, weil die Kenntnisse inhaltlich und umfangmäßig gleichwertig sind.", 'description' => '', 'insertvon' => 'system' ), @@ -8897,13 +8917,13 @@ Any unusual occurrences 'phrases' => array( array( 'sprache' => 'German', - 'text' => 'Bitte geben Sie eine Begründung für die Ablehnung an', + 'text' => 'Bitte geben Sie eine Begründung für die Ablehnung an und bestätigen danach.', 'description' => '', 'insertvon' => 'system' ), array( 'sprache' => 'English', - 'text' => 'Please give a reason why you do not recommend to approve this applications', + 'text' => 'Please give a reason why you do not recommend to approve this applications and confirm.', 'description' => '', 'insertvon' => 'system' ) @@ -8972,7 +8992,7 @@ Any unusual occurrences array( 'app' => 'core', 'category' => 'anrechnung', - 'phrase' => 'empfehlungNegativ', + 'phrase' => 'empfehlungNegativConfirmed', 'insertvon' => 'system', 'phrases' => array( array( @@ -9017,7 +9037,7 @@ Any unusual occurrences 'phrases' => array( array( 'sprache' => 'German', - 'text' => 'Anrechnungen werden empfohlen, weil die Kenntnisse inhaltlich und umfangmäßig gleichwertig sind.', + 'text' => "Bitte bestätigen Sie: Alle ausgewählten Anrechnungen werden empfohlen, weil die Kenntnisse inhaltlich und umfangmäßig gleichwertig sind.", 'description' => '', 'insertvon' => 'system' ), @@ -9089,6 +9109,26 @@ Any unusual occurrences ) ) ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'genehmigungNegativQuestion', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Antrag nicht genehmigen?', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), array( 'app' => 'core', 'category' => 'anrechnung', @@ -9109,6 +9149,26 @@ Any unusual occurrences ) ) ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'genehmigungenNegativQuestion', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Anrechnungen nicht genehmigen?', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), array( 'app' => 'core', 'category' => 'anrechnung', @@ -9157,7 +9217,27 @@ Any unusual occurrences 'phrases' => array( array( 'sprache' => 'German', - 'text' => 'Anrechnungen werden genehmigt, weil die Kenntnisse inhaltlich und umfangmäßig gleichwertig sind.', + 'text' => "Bitte bestätigen Sie: Alle ausgewählten Anrechnungen werden genehmigt, weil die Kenntnisse inhaltlich und umfangmäßig gleichwertig sind.", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'genehmigungenPositivQuestion', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Anrechnungen genehmigen?', 'description' => '', 'insertvon' => 'system' ), @@ -9189,6 +9269,46 @@ Any unusual occurrences ) ) ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'genehmigungPositivQuestion', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Antrag genehmigen?', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'genehmigungPositivSubquestion', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Bitte bestätigen Sie: Anrechnung wird genehmigt, weil die Kenntnisse inhaltlich und umfangmäßig gleichwertig sind.", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), array( 'app' => 'core', 'category' => 'anrechnung', @@ -9388,7 +9508,110 @@ Any unusual occurrences 'insertvon' => 'system' ) ) - ) + ), + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'bestaetigen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Bestätigen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Confirm', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'empfehlungPositivQuestion', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Anrechnung empfehlen?', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Confirm', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'empfehlungenPositivQuestion', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Anrechnungen empfehlen?', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Confirm', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'empfehlungNegativQuestion', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Anrechnung nicht empfehlen?', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Confirm', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'empfehlungenNegativQuestion', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Anrechnungen nicht empfehlen?', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Confirm', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + + + ); From 25400d8b5ff0788cd0cf08f97b48e5390ef27e4b Mon Sep 17 00:00:00 2001 From: Cris Date: Mon, 8 Feb 2021 17:25:34 +0100 Subject: [PATCH 110/142] Removed updateamum/updatevon when updating Anrechnungmodel They are not needed. Just confusing. Signed-off-by: cris-technikum --- application/libraries/AnrechnungLib.php | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/application/libraries/AnrechnungLib.php b/application/libraries/AnrechnungLib.php index 6b3b200bd..3482023cb 100644 --- a/application/libraries/AnrechnungLib.php +++ b/application/libraries/AnrechnungLib.php @@ -379,9 +379,7 @@ class AnrechnungLib $this->ci->AnrechnungModel->update( $anrechnung_id, array( - 'genehmigt_von' => $stgl_uid, - 'updateamum' => (new DateTime())->format('Y-m-d H:m:i'), - 'updatevon' => $stgl_uid + 'genehmigt_von' => $stgl_uid ) ); @@ -523,9 +521,7 @@ class AnrechnungLib $this->ci->AnrechnungModel->update( $anrechnung_id, array( - 'empfehlung_anrechnung' => null, - 'updateamum' => (new DateTime())->format('Y-m-d H:m:i'), - 'updatevon' => getAuthUID() + 'empfehlung_anrechnung' => null ) ); @@ -566,8 +562,6 @@ class AnrechnungLib // Start DB transaction $this->ci->db->trans_start(false); - $lektor_uid = getAuthUID(); - // Insert new status progessed by stgl $this->ci->AnrechnungModel->saveAnrechnungstatus($anrechnung_id, self::ANRECHNUNGSTATUS_PROGRESSED_BY_STGL); @@ -575,9 +569,7 @@ class AnrechnungLib $this->ci->AnrechnungModel->update( $anrechnung_id, array( - 'empfehlung_anrechnung' => true, - 'updateamum' => (new DateTime())->format('Y-m-d H:m:i'), - 'updatevon' => $lektor_uid + 'empfehlung_anrechnung' => true ) ); @@ -618,8 +610,6 @@ class AnrechnungLib // Start DB transaction $this->ci->db->trans_start(false); - $lektor_uid = getAuthUID(); - // Insert new status progessed by stgl $this->ci->AnrechnungModel->saveAnrechnungstatus($anrechnung_id, self::ANRECHNUNGSTATUS_PROGRESSED_BY_STGL); @@ -627,12 +617,12 @@ class AnrechnungLib $this->ci->AnrechnungModel->update( $anrechnung_id, array( - 'empfehlung_anrechnung' => false, - 'updateamum' => (new DateTime())->format('Y-m-d H:m:i'), - 'updatevon' => $lektor_uid + 'empfehlung_anrechnung' => false ) ); + $lektor_uid = getAuthUID(); + // Add begruendung as notiz $this->ci->load->model('person/Notiz_model', 'NotizModel'); $this->ci->NotizModel->addNotizForAnrechnung( From 00799f2f642948bdfe59aab0427db0a85938c743 Mon Sep 17 00:00:00 2001 From: Cris Date: Mon, 8 Feb 2021 17:35:34 +0100 Subject: [PATCH 111/142] Adapted: Ordered Notizen to retrieve last inserted first Signed-off-by: cris-technikum --- application/models/person/Notiz_model.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/models/person/Notiz_model.php b/application/models/person/Notiz_model.php index 29e11c1df..2e09875d8 100644 --- a/application/models/person/Notiz_model.php +++ b/application/models/person/Notiz_model.php @@ -208,7 +208,7 @@ class Notiz_model extends DB_Model } /** - * Get Notiz by Anrechnung and title + * Get Notizen by Anrechnung and title ordered last first * * @param $anrechnung_id * @return array @@ -216,6 +216,7 @@ class Notiz_model extends DB_Model public function getNotizByAnrechnung($anrechnung_id, $titel = null) { $this->addJoin('public.tbl_notizzuordnung', 'notiz_id'); + $this->addOrder('insertamum', 'DESC'); if (is_string($titel)) { From 77774e8cec60015f86506c71a72d06cb59276bf0 Mon Sep 17 00:00:00 2001 From: Cris Date: Mon, 8 Feb 2021 18:01:06 +0100 Subject: [PATCH 112/142] Corrected STGL permission check to check against UID Signed-off-by: cris-technikum --- .../anrechnung/ApproveAnrechnungDetail.php | 29 +++++++++++++------ .../ApproveAnrechnungUebersicht.php | 15 ++++++---- 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/application/controllers/lehre/anrechnung/ApproveAnrechnungDetail.php b/application/controllers/lehre/anrechnung/ApproveAnrechnungDetail.php index fb20b2a5c..0a04ceefa 100644 --- a/application/controllers/lehre/anrechnung/ApproveAnrechnungDetail.php +++ b/application/controllers/lehre/anrechnung/ApproveAnrechnungDetail.php @@ -37,6 +37,7 @@ class approveAnrechnungDetail extends Auth_Controller $this->load->model('crm/Prestudent_model', 'PrestudentModel'); $this->load->model('person/Notiz_model', 'NotizModel'); $this->load->model('person/Person_model', 'PersonModel'); + $this->load->model('organisation/Studiengang_model', 'StudiengangModel'); // Load libraries $this->load->library('WidgetLib'); @@ -309,23 +310,28 @@ class approveAnrechnungDetail extends Auth_Controller */ private function _checkIfEntitledToReadAnrechnung($anrechnung_id) { - // Retrieve studiengaenge the user is entitled for - $studiengang_kz_arr = $this->permissionlib->getSTG_isEntitledFor(self::BERECHTIGUNG_ANRECHNUNG_GENEHMIGEN); - $result = $this->AnrechnungModel->load($anrechnung_id); if(!$result = getData($result)[0]) { - show_error('Failed retrieving Anrechnung'); + show_error('Failed loading Anrechnung'); } $result = $this->LehrveranstaltungModel->loadWhere(array( 'lehrveranstaltung_id' => $result->lehrveranstaltung_id )); + if(!$result = getData($result)[0]) + { + show_error('Failed loading Lehrveranstaltung'); + } + + // Get STGL + $result = $this->StudiengangModel->getLeitung($result->studiengang_kz); + if($result = getData($result)[0]) { - if (in_array($result->studiengang_kz, $studiengang_kz_arr)) + if ($result->uid == $this->_uid) { return; } @@ -340,9 +346,6 @@ class approveAnrechnungDetail extends Auth_Controller */ private function _checkIfEntitledToReadDMSDoc($dms_id) { - // Retrieve studiengaenge the user is entitled for - $studiengang_kz_arr = $this->permissionlib->getSTG_isEntitledFor(self::BERECHTIGUNG_ANRECHNUNG_GENEHMIGEN); - $result = $this->AnrechnungModel->loadWhere(array('dms_id' => $dms_id)); if(!$result = getData($result)[0]) @@ -354,9 +357,17 @@ class approveAnrechnungDetail extends Auth_Controller 'lehrveranstaltung_id' => $result->lehrveranstaltung_id )); + if(!$result = getData($result)[0]) + { + show_error('Failed loading Lehrveranstaltung'); + } + + // Get STGL + $result = $this->StudiengangModel->getLeitung($result->studiengang_kz); + if($result = getData($result)[0]) { - if (in_array($result->studiengang_kz, $studiengang_kz_arr)) + if ($result->uid == $this->_uid) { return; } diff --git a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php index ccf3af2ea..f2894b310 100644 --- a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php +++ b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php @@ -276,10 +276,6 @@ class approveAnrechnungUebersicht extends Auth_Controller */ private function _checkIfEntitledToReadDMSDoc($dms_id) { - // Retrieve studiengaenge the user is entitled for - $studiengang_kz_arr = $this->permissionlib->getSTG_isEntitledFor(self::BERECHTIGUNG_ANRECHNUNG_GENEHMIGEN); - - $result = $this->AnrechnungModel->loadWhere(array('dms_id' => $dms_id)); if(!$result = getData($result)[0]) @@ -291,9 +287,18 @@ class approveAnrechnungUebersicht extends Auth_Controller 'lehrveranstaltung_id' => $result->lehrveranstaltung_id )); + + if(!$result = getData($result)[0]) + { + show_error('Failed loading Lehrveranstaltung'); + } + + // Get STGL + $result = $this->StudiengangModel->getLeitung($result->studiengang_kz); + if($result = getData($result)[0]) { - if (in_array($result->studiengang_kz, $studiengang_kz_arr)) + if ($result->uid == $this->_uid) { return; } From 2a59d2464b23db41dc88de6739784f362270eb52 Mon Sep 17 00:00:00 2001 From: Cris Date: Mon, 8 Feb 2021 18:07:40 +0100 Subject: [PATCH 113/142] Uncommented tooltips for genehmigung/empfehlung Signed-off-by: cris-technikum --- .../anrechnung/approveAnrechnungDetail.php | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/application/views/lehre/anrechnung/approveAnrechnungDetail.php b/application/views/lehre/anrechnung/approveAnrechnungDetail.php index a55611d20..05fe14e55 100644 --- a/application/views/lehre/anrechnung/approveAnrechnungDetail.php +++ b/application/views/lehre/anrechnung/approveAnrechnungDetail.php @@ -136,11 +136,11 @@ $this->load->view(
    p->t('anrechnung', 'empfehlung'); ?>  - - - + + +p->t('anrechnung', 'empfehlungInfoTooltipText'); ?> + +
    p->t('anrechnung', 'empfehlungVon'); ?>: empfehlung_von ?> @@ -203,11 +203,11 @@ $this->load->view(
    p->t('anrechnung', 'genehmigung'); ?>  - - - + + +p->t('anrechnung', 'genehmigungInfoTooltipText'); ?> + +
    p->t('anrechnung', 'abgeschlossenVon'); ?>: abgeschlossen_von ?> From 17ae1b144c15142f0caf605402a7093d0a964128 Mon Sep 17 00:00:00 2001 From: Cris Date: Mon, 8 Feb 2021 18:13:50 +0100 Subject: [PATCH 114/142] Corrected: Now correct text for confirmed positive recommendation Signed-off-by: cris-technikum --- application/views/lehre/anrechnung/approveAnrechnungDetail.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/lehre/anrechnung/approveAnrechnungDetail.php b/application/views/lehre/anrechnung/approveAnrechnungDetail.php index 05fe14e55..9a6612aee 100644 --- a/application/views/lehre/anrechnung/approveAnrechnungDetail.php +++ b/application/views/lehre/anrechnung/approveAnrechnungDetail.php @@ -170,7 +170,7 @@ $this->load->view(
    - p->t('anrechnung', 'empfehlungPositiv'); ?> + p->t('anrechnung', 'empfehlungPositivConfirmed'); ?>
    Date: Mon, 8 Feb 2021 18:25:27 +0100 Subject: [PATCH 115/142] Corrected typos in name that caused button not being disabled Signed-off-by: cris-technikum --- .../anrechnung/approveAnrechnungDetail.php | 4 +- .../anrechnung/reviewAnrechnungDetail.php | 2 +- .../anrechnung/approveAnrechnungDetail.js | 40 +++++++++---------- .../anrechnung/reviewAnrechnungDetail.js | 22 +++++----- 4 files changed, 34 insertions(+), 34 deletions(-) diff --git a/application/views/lehre/anrechnung/approveAnrechnungDetail.php b/application/views/lehre/anrechnung/approveAnrechnungDetail.php index 9a6612aee..a35161e83 100644 --- a/application/views/lehre/anrechnung/approveAnrechnungDetail.php +++ b/application/views/lehre/anrechnung/approveAnrechnungDetail.php @@ -187,7 +187,7 @@ $this->load->view(
    - @@ -334,7 +334,7 @@ $this->load->view(
    Status: - status; ?> diff --git a/application/views/lehre/anrechnung/reviewAnrechnungDetail.php b/application/views/lehre/anrechnung/reviewAnrechnungDetail.php index 73713561a..cb43e684b 100644 --- a/application/views/lehre/anrechnung/reviewAnrechnungDetail.php +++ b/application/views/lehre/anrechnung/reviewAnrechnungDetail.php @@ -255,7 +255,7 @@ $this->load->view(
    Status: - status; ?> diff --git a/public/js/lehre/anrechnung/approveAnrechnungDetail.js b/public/js/lehre/anrechnung/approveAnrechnungDetail.js index 3313f7202..182120bf6 100644 --- a/public/js/lehre/anrechnung/approveAnrechnungDetail.js +++ b/public/js/lehre/anrechnung/approveAnrechnungDetail.js @@ -158,7 +158,7 @@ $(function(){ }); // Request Recommendation for Anrechnungen - $("#request-recommendation").click(function(){ + $("#approveAnrechnungDetail-request-recommendation").click(function(){ // Get form data let form_data = $('form').serializeArray(); @@ -222,20 +222,20 @@ $(function(){ var approveAnrechnungDetail = { setStatusAlertColor: function () { - let status_kurzbz = $('#approveAnrechnung-status_kurzbz').data('status_kurzbz'); + let status_kurzbz = $('#approveAnrechnungDetail-status_kurzbz').data('status_kurzbz'); switch (status_kurzbz) { case ANRECHNUNGSTATUS_APPROVED: - $('#approveAnrechnung-status_kurzbz').closest('div').addClass('alert-success'); + $('#approveAnrechnungDetail-status_kurzbz').closest('div').addClass('alert-success'); break; case ANRECHNUNGSTATUS_REJECTED: - $('#approveAnrechnung-status_kurzbz').closest('div').addClass('alert-danger'); + $('#approveAnrechnungDetail-status_kurzbz').closest('div').addClass('alert-danger'); break; case '': - $('#approveAnrechnung-status_kurzbz').closest('div').addClass('alert-info'); + $('#approveAnrechnungDetail-status_kurzbz').closest('div').addClass('alert-info'); break; default: - $('#approveAnrechnung-status_kurzbz').closest('div').addClass('alert-warning'); + $('#approveAnrechnungDetail-status_kurzbz').closest('div').addClass('alert-warning'); } }, initTooltips: function (){ @@ -257,32 +257,32 @@ var approveAnrechnungDetail = { $('#approveAnrechnungDetail-empfehlungDetail').children().addClass('hidden'); $('#approveAnrechnungDetail-empfehlungDetail-empfehlungIsAngefordert').removeClass('hidden'); $('#approveAnrechnungDetail-empfehlungDetail-empfehlungAngefordertAm').text(empfehlungAngefordertAm); - $('#approveAnrechnung-status_kurzbz').text(statusBezeichnung); - $('#request-recommendation').prop('disabled', true); - $('#approve-anrechnung').prop('disabled', true); - $('#reject-anrechnung').prop('disabled', true); + $('#approveAnrechnungDetail-status_kurzbz').text(statusBezeichnung); + $('#approveAnrechnungDetail-request-recommendation').prop('disabled', true); + $('#approveAnrechnungDetail-approve-anrechnung-ask').prop('disabled', true); + $('#approveAnrechnungDetail-reject-anrechnung-ask').prop('disabled', true); }, formatGenehmigungIsPositiv: function(abgeschlossenAm, abgeschlossenVon, statusBezeichnung){ $('#approveAnrechnungDetail-genehmigungDetail').children().addClass('hidden'); $('#approveAnrechnungDetail-genehmigungDetail-genehmigungIsPositiv').removeClass('hidden'); - $('#approveAnrechnung-status_kurzbz').text(statusBezeichnung); - $('#approveAnrechnung-status_kurzbz').closest('div').removeClass('alert-warning').addClass('alert-success'); + $('#approveAnrechnungDetail-status_kurzbz').text(statusBezeichnung); + $('#approveAnrechnungDetail-status_kurzbz').closest('div').removeClass('alert-warning').addClass('alert-success'); $('#approveAnrechnungDetail-abgeschlossenAm').text(abgeschlossenAm); $('#approveAnrechnungDetail-abgeschlossenVon').text(abgeschlossenVon); - $('#request-recommendation').prop('disabled', true); - $('#approve-anrechnung').prop('disabled', true); - $('#reject-anrechnung').prop('disabled', true); + $('#approveAnrechnungDetail-request-recommendation').prop('disabled', true); + $('#approveAnrechnungDetail-approve-anrechnung-ask').prop('disabled', true); + $('#approveAnrechnungDetail-reject-anrechnung-ask').prop('disabled', true); }, formatGenehmigungIsNegativ: function(abgeschlossenAm, abgeschlossenVon, statusBezeichnung, begruendung){ $('#approveAnrechnungDetail-genehmigungDetail').children().addClass('hidden'); $('#approveAnrechnungDetail-genehmigungDetail-genehmigungIsNegativ').removeClass('hidden'); - $('#approveAnrechnung-status_kurzbz').text(statusBezeichnung); - $('#approveAnrechnung-status_kurzbz').closest('div').removeClass('alert-warning').addClass('alert-danger'); + $('#approveAnrechnungDetail-status_kurzbz').text(statusBezeichnung); + $('#approveAnrechnungDetail-status_kurzbz').closest('div').removeClass('alert-warning').addClass('alert-danger'); $('#approveAnrechnungDetail-abgeschlossenAm').text(abgeschlossenAm); $('#approveAnrechnungDetail-abgeschlossenVon').text(abgeschlossenVon); $('#approveAnrechnungDetail-genehmigungDetail-begruendung').text(begruendung); - $('#request-recommendation').prop('disabled', true); - $('#approve-anrechnung').prop('disabled', true); - $('#reject-anrechnung').prop('disabled', true); + $('#approveAnrechnungDetail-request-recommendation').prop('disabled', true); + $('#approveAnrechnungDetail-approve-anrechnung-ask').prop('disabled', true); + $('#approveAnrechnungDetail-reject-anrechnung-ask').prop('disabled', true); } } \ No newline at end of file diff --git a/public/js/lehre/anrechnung/reviewAnrechnungDetail.js b/public/js/lehre/anrechnung/reviewAnrechnungDetail.js index 2865421ce..500134af5 100644 --- a/public/js/lehre/anrechnung/reviewAnrechnungDetail.js +++ b/public/js/lehre/anrechnung/reviewAnrechnungDetail.js @@ -180,20 +180,20 @@ $(function(){ var reviewAnrechnung = { setStatusAlertColor: function () { - let status_kurzbz = $('#reviewAnrechnung-status_kurzbz').data('status_kurzbz'); + let status_kurzbz = $('#reviewAnrechnungDetail-status_kurzbz').data('status_kurzbz'); switch (status_kurzbz) { case ANRECHNUNGSTATUS_APPROVED: - $('#reviewAnrechnung-status_kurzbz').closest('div').addClass('alert-success'); + $('#reviewAnrechnungDetail-status_kurzbz').closest('div').addClass('alert-success'); break; case ANRECHNUNGSTATUS_REJECTED: - $('#reviewAnrechnung-status_kurzbz').closest('div').addClass('alert-danger'); + $('#reviewAnrechnungDetail-status_kurzbz').closest('div').addClass('alert-danger'); break; case '': - $('#reviewAnrechnung-status_kurzbz').closest('div').addClass('alert-info'); + $('#reviewAnrechnungDetail-status_kurzbz').closest('div').addClass('alert-info'); break; default: - $('#reviewAnrechnung-status_kurzbz').closest('div').addClass('alert-warning'); + $('#reviewAnrechnungDetail-status_kurzbz').closest('div').addClass('alert-warning'); } }, initTooltips: function (){ @@ -215,18 +215,18 @@ var reviewAnrechnung = { formatEmpfehlungIsTrue: function(empfehlungAm, emfehlungVon, statusBezeichnung){ $('#reviewAnrechnungDetail-empfehlungDetail').children().addClass('hidden'); $('#reviewAnrechnungDetail-empfehlungDetail-empfehlungIsTrue').removeClass('hidden'); - $('#reviewAnrechnung-status_kurzbz').text(statusBezeichnung); - $('#recommend-anrechnung').prop('disabled', true); - $('#dont-recommend-anrechnung').prop('disabled', true); + $('#reviewAnrechnungDetail-status_kurzbz').text(statusBezeichnung); + $('#reviewAnrechnungDetail-recommend-anrechnung-ask').prop('disabled', true); + $('#reviewAnrechnungDetail-dont-recommend-anrechnung-ask').prop('disabled', true); $('#reviewAnrechnungDetail-empfehlungAm').text(empfehlungAm); $('#reviewAnrechnungDetail-empfehlungVon').text(emfehlungVon); }, formatEmpfehlungIsFalse: function(empfehlungAm, emfehlungVon, statusBezeichnung, begruendung){ $('#reviewAnrechnungDetail-empfehlungDetail').children().addClass('hidden'); $('#reviewAnrechnungDetail-empfehlungDetail-empfehlungIsFalse').removeClass('hidden'); - $('#reviewAnrechnung-status_kurzbz').text(statusBezeichnung); - $('#recommend-anrechnung').prop('disabled', true); - $('#dont-recommend-anrechnung').prop('disabled', true); + $('#reviewAnrechnungDetail-status_kurzbz').text(statusBezeichnung); + $('#reviewAnrechnungDetail-recommend-anrechnung-ask').prop('disabled', true); + $('#reviewAnrechnungDetail-dont-recommend-anrechnung-ask').prop('disabled', true); $('#reviewAnrechnungDetail-empfehlungAm').text(empfehlungAm); $('#reviewAnrechnungDetail-empfehlungVon').text(emfehlungVon); $('#reviewAnrechnungDetail-empfehlungDetail-begruendung').text(begruendung); From d1537df896e51a031e4f5b2e039dcb87d11bcec7 Mon Sep 17 00:00:00 2001 From: Cris Date: Tue, 9 Feb 2021 14:36:29 +0100 Subject: [PATCH 116/142] Fixed: Now Nachweisdokument- and Detail-Links clickable after table update Signed-off-by: cris-technikum --- public/js/lehre/anrechnung/approveAnrechnungUebersicht.js | 5 +++++ public/js/lehre/anrechnung/reviewAnrechnungUebersicht.js | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js b/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js index 142c57573..7766f56f9 100644 --- a/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js +++ b/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js @@ -21,6 +21,7 @@ function func_tableBuilt(table) { table.addColumn( { title: "Details", + field: 'details', align: "center", width: 100, formatter: "link", @@ -66,6 +67,10 @@ function func_rowUpdated(row){ // Deselect and disable new selection of updated rows row.deselect(); row.getElement().style["pointerEvents"] = "none"; + + // ...but leave url links selectable + row.getCell('dokument_bezeichnung').getElement().firstChild.style["pointerEvents"] = "auto"; + row.getCell('details').getElement().firstChild.style["pointerEvents"] = "auto"; } // Returns tooltip diff --git a/public/js/lehre/anrechnung/reviewAnrechnungUebersicht.js b/public/js/lehre/anrechnung/reviewAnrechnungUebersicht.js index 854d1e299..367f84a1f 100644 --- a/public/js/lehre/anrechnung/reviewAnrechnungUebersicht.js +++ b/public/js/lehre/anrechnung/reviewAnrechnungUebersicht.js @@ -21,6 +21,7 @@ function func_tableBuilt(table) { table.addColumn( { title: "Details", + field: 'details', align: "center", width: 100, formatter: "link", @@ -64,6 +65,10 @@ function func_rowUpdated(row){ // Deselect and disable new selection of updated rows row.deselect(); row.getElement().style["pointerEvents"] = "none"; + + // ...but leave url links selectable + row.getCell('dokument_bezeichnung').getElement().firstChild.style["pointerEvents"] = "auto"; + row.getCell('details').getElement().firstChild.style["pointerEvents"] = "auto"; } // Returns tooltip From 81151025da1fa80d8b11644421e44c3ff63db892 Mon Sep 17 00:00:00 2001 From: Cris Date: Tue, 9 Feb 2021 14:54:32 +0100 Subject: [PATCH 117/142] Fixed non-existing phrases . anrechnungNichtEmpfehlenAsk . empfehlungNegativ The phrases did not exist anymore, they got new name. Now fixed. Signed-off-by: cris-technikum --- application/views/lehre/anrechnung/approveAnrechnungDetail.php | 2 +- application/views/lehre/anrechnung/reviewAnrechnungDetail.php | 2 +- .../views/lehre/anrechnung/reviewAnrechnungUebersicht.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/application/views/lehre/anrechnung/approveAnrechnungDetail.php b/application/views/lehre/anrechnung/approveAnrechnungDetail.php index a35161e83..43b4f89f7 100644 --- a/application/views/lehre/anrechnung/approveAnrechnungDetail.php +++ b/application/views/lehre/anrechnung/approveAnrechnungDetail.php @@ -176,7 +176,7 @@ $this->load->view(
    - p->t('anrechnung', 'empfehlungNegativ'); ?> + p->t('anrechnung', 'empfehlungNegativConfirmed'); ?>
    p->t('global', 'begruendung'); ?> : diff --git a/application/views/lehre/anrechnung/reviewAnrechnungDetail.php b/application/views/lehre/anrechnung/reviewAnrechnungDetail.php index cb43e684b..4a389d2ae 100644 --- a/application/views/lehre/anrechnung/reviewAnrechnungDetail.php +++ b/application/views/lehre/anrechnung/reviewAnrechnungDetail.php @@ -172,7 +172,7 @@ $this->load->view(