From 1dba4be23f4e7da2e571c64f9dbe42a3c3a39b5b Mon Sep 17 00:00:00 2001 From: ma0048 Date: Mon, 17 Feb 2025 13:31:57 +0100 Subject: [PATCH 1/3] - studsatus ablaeufe einzelen aktivieren/deaktivieren - history absteigend sortiert --- application/config/studierendenantrag.php | 29 ++++++ application/controllers/jobs/AntragJob.php | 77 ++++++++++++---- .../controllers/lehre/Studierendenantrag.php | 89 ++++++++++++------- application/libraries/AntragLib.php | 1 + .../views/lehre/Antrag/Leitung/List.php | 1 + .../components/Studierendenantrag/Leitung.js | 4 +- .../Studierendenantrag/Leitung/Actions.js | 5 +- .../Studierendenantrag/Leitung/Table.js | 2 +- 8 files changed, 156 insertions(+), 52 deletions(-) diff --git a/application/config/studierendenantrag.php b/application/config/studierendenantrag.php index 4e25aef28..ef2098aca 100644 --- a/application/config/studierendenantrag.php +++ b/application/config/studierendenantrag.php @@ -168,3 +168,32 @@ $config['stgkz_blacklist_wiederholung'] = []; * @var array An array of noten ids */ $config['note_blacklist_wiederholung'] = []; + +/** + * Enable/disable the Abmeldung StG process + * + * @var bool + */ +$config['abmeldung_stg_enabled'] = true; + +/** + * Enable/disable the Abmeldung process + * + * @var bool + */ +$config['abmeldung_enabled'] = true; + +/** + * Enable/disable the Unterbrecher process + * + * @var bool + */ +$config['unterbrechung_enabled'] = true; + +/** + * Enable/disable the Wiederholer process + * + * @var bool + */ +$config['wiederholung_enabled'] = true; + diff --git a/application/controllers/jobs/AntragJob.php b/application/controllers/jobs/AntragJob.php index 11b950174..4419997ec 100644 --- a/application/controllers/jobs/AntragJob.php +++ b/application/controllers/jobs/AntragJob.php @@ -40,6 +40,13 @@ class AntragJob extends JOB_Controller */ public function sendStglSammelmail() { + + if ($this->config->item('abmeldung_enabled') !== true && + $this->config->item('abmeldung_stg_enabled') !== true && + $this->config->item('unterbrechung_enabled') !== true && + $this->config->item('wiederholung_enabled') !== true) + return $this->logError('Konnte Job nicht starten: Keine der Configs "abmeldung_stg_enabled", "abmeldung_enabled", "unterbrechung_enabled", "wiederholung_enabled" auf true gesetzt'); + $this->load->model('person/Person_model', 'PersonModel'); $this->logInfo('Start Job sendStglSammelmail'); @@ -47,25 +54,38 @@ class AntragJob extends JOB_Controller $this->load->model('organisation/Studiengang_model', 'StudiengangModel'); $this->StudierendenantragModel->addJoin('public.tbl_prestudent', 'prestudent_id'); - $this->db->group_start(); - $this->db->where('typ', Studierendenantrag_model::TYP_ABMELDUNG); - $this->db->where('campus.get_status_studierendenantrag(studierendenantrag_id)', Studierendenantragstatus_model::STATUS_CREATED); - $this->db->group_end(); - $this->db->or_group_start(); - $this->db->where('typ', Studierendenantrag_model::TYP_ABMELDUNG_STGL); - $this->db->where('campus.get_status_studierendenantrag(studierendenantrag_id)', Studierendenantragstatus_model::STATUS_CREATED); - $this->db->group_end(); + if ($this->config->item('abmeldung_enabled') === true) + { + $this->db->group_start(); + $this->db->where('typ', Studierendenantrag_model::TYP_ABMELDUNG); + $this->db->where('campus.get_status_studierendenantrag(studierendenantrag_id)', Studierendenantragstatus_model::STATUS_CREATED); + $this->db->group_end(); + } - $this->db->or_group_start(); - $this->db->where('typ', Studierendenantrag_model::TYP_UNTERBRECHUNG); - $this->db->where('campus.get_status_studierendenantrag(studierendenantrag_id)', Studierendenantragstatus_model::STATUS_CREATED); - $this->db->group_end(); + if ($this->config->item('abmeldung_stg_enabled') === true) + { + $this->db->or_group_start(); + $this->db->where('typ', Studierendenantrag_model::TYP_ABMELDUNG_STGL); + $this->db->where('campus.get_status_studierendenantrag(studierendenantrag_id)', Studierendenantragstatus_model::STATUS_CREATED); + $this->db->group_end(); + } - $this->db->or_group_start(); - $this->db->where('typ', Studierendenantrag_model::TYP_WIEDERHOLUNG); - $this->db->where('campus.get_status_studierendenantrag(studierendenantrag_id)', Studierendenantragstatus_model::STATUS_LVSASSIGNED); - $this->db->group_end(); + if ($this->config->item('unterbrechung_enabled') === true) + { + $this->db->or_group_start(); + $this->db->where('typ', Studierendenantrag_model::TYP_UNTERBRECHUNG); + $this->db->where('campus.get_status_studierendenantrag(studierendenantrag_id)', Studierendenantragstatus_model::STATUS_CREATED); + $this->db->group_end(); + } + + if ($this->config->item('wiederholung_enabled') === true) + { + $this->db->or_group_start(); + $this->db->where('typ', Studierendenantrag_model::TYP_WIEDERHOLUNG); + $this->db->where('campus.get_status_studierendenantrag(studierendenantrag_id)', Studierendenantragstatus_model::STATUS_LVSASSIGNED); + $this->db->group_end(); + } $result = $this->StudierendenantragModel->load(); if(isError($result)) @@ -203,6 +223,10 @@ class AntragJob extends JOB_Controller public function sendReminderWiedereinstieg() { $now = new DateTime(); + + if ($this->config->item('unterbrechung_enabled') !== true) + return $this->logError('Konnte Job nicht starten: Config "unterbrechung_enabled" nicht auf true gesetzt'); + $modifier = $this->config->item('unterbrechung_job_remind_wiedereinstieg_date_modifier'); if (!$modifier) return $this->logError('Konnte Job nicht starten: Config "unterbrechung_job_remind_wiedereinstieg_date_modifiers" nicht gesetzt'); @@ -276,6 +300,13 @@ class AntragJob extends JOB_Controller { $this->logInfo('Start Job handleWiederholerDeadline'); + if ($this->config->item('wiederholung_enabled') !== true) + { + $this->logError('Config "wiederholung_enabled" nicht auf true gesetzt'); + $this->logInfo('Ende Job handleWiederholerDeadline'); + return; + } + $this->load->library('PrestudentLib'); $insertvon = $this->config->item('antrag_job_systemuser'); @@ -394,6 +425,13 @@ class AntragJob extends JOB_Controller { $this->logInfo('Start Job handleAbmeldungenStglDeadline'); + if ($this->config->item('abmeldung_stg_enabled') !== true) + { + $this->logError('Config "abmeldung_stg_enabled" nicht auf true gesetzt'); + $this->logInfo('Ende Job handleAbmeldungenStglDeadline'); + return; + } + $insertvon = $this->config->item('antrag_job_systemuser'); if (!$insertvon) { $this->logError('Config "antrag_job_systemuser" nicht gesetzt'); @@ -527,6 +565,13 @@ class AntragJob extends JOB_Controller { $this->logInfo('Start Job sendAufforderungWiederholer'); + if ($this->config->item('wiederholung_enabled') !== true) + { + $this->logError('Config "wiederholung_enabled" nicht auf true gesetzt'); + $this->logInfo('Ende Job sendAufforderungWiederholer'); + return; + } + $modifier_request_1 = $this->config->item('wiederholung_job_request_1_date_modifier'); $modifier_request_2 = $this->config->item('wiederholung_job_request_2_date_modifier'); $modifier_deadline = $this->config->item('wiederholung_job_deadline_date_modifier'); diff --git a/application/controllers/lehre/Studierendenantrag.php b/application/controllers/lehre/Studierendenantrag.php index 107c9af96..ebc1d2eaa 100644 --- a/application/controllers/lehre/Studierendenantrag.php +++ b/application/controllers/lehre/Studierendenantrag.php @@ -28,7 +28,9 @@ class Studierendenantrag extends FHC_Controller 'studierendenantrag' ]); - if (strtolower($this->router->method) === 'leitung') + $this->load->config('studierendenantrag'); + + if (strtolower($this->router->method) === 'leitung') $this->_isAllowed([ 'leitung' => ['student/studierendenantrag:r', 'student/antragfreigabe:r'] ]); @@ -54,18 +56,27 @@ class Studierendenantrag extends FHC_Controller 'bezeichnungStg' => $antrag->bezeichnung, 'bezeichnungOrgform' => $antrag->orgform ); - - $result = $this->antraglib->getPrestudentWiederholungsBerechtigt($antrag->prestudent_id); - if (getData($result) == 1) - $prestudentenArr[$antrag->prestudent_id]['allowedNewTypes'][] = 'Wiederholung'; - $result = $this->antraglib->getPrestudentUnterbrechungsBerechtigt($antrag->prestudent_id); - if (getData($result) == 1) - $prestudentenArr[$antrag->prestudent_id]['allowedNewTypes'][] = 'Unterbrechung'; + if ($this->config->item('wiederholung_enabled') === true) + { + $result = $this->antraglib->getPrestudentWiederholungsBerechtigt($antrag->prestudent_id); + if (getData($result) == 1) + $prestudentenArr[$antrag->prestudent_id]['allowedNewTypes'][] = 'Wiederholung'; + } - $result = $this->antraglib->getPrestudentAbmeldeBerechtigt($antrag->prestudent_id); - if (getData($result) == 1) - $prestudentenArr[$antrag->prestudent_id]['allowedNewTypes'][] = 'Abmeldung'; + if ($this->config->item('unterbrechung_enabled') === true) + { + $result = $this->antraglib->getPrestudentUnterbrechungsBerechtigt($antrag->prestudent_id); + if (getData($result) == 1) + $prestudentenArr[$antrag->prestudent_id]['allowedNewTypes'][] = 'Unterbrechung'; + } + + if ($this->config->item('abmeldung_enabled') === true) + { + $result = $this->antraglib->getPrestudentAbmeldeBerechtigt($antrag->prestudent_id); + if (getData($result) == 1) + $prestudentenArr[$antrag->prestudent_id]['allowedNewTypes'][] = 'Abmeldung'; + } } if ($antrag->studierendenantrag_id == null) continue; @@ -88,45 +99,59 @@ class Studierendenantrag extends FHC_Controller $this->load->view('lehre/Antrag/Leitung/List', [ 'stgA' => $stgA, - 'stgL' => $stgL + 'stgL' => $stgL, + 'abmeldung_enabled' => $this->config->item('abmeldung_stg_enabled') ]); } public function abmeldung($prestudent_id, $studierendenantrag_id = null) { - $this->load->view('lehre/Antrag/Create', [ - 'prestudent_id' => $prestudent_id, - 'studierendenantrag_id' => $studierendenantrag_id, - 'antrag_type' => 'Abmeldung' - ]); + if ($this->config->item('abmeldung_enabled') === true) + { + $this->load->view('lehre/Antrag/Create', [ + 'prestudent_id' => $prestudent_id, + 'studierendenantrag_id' => $studierendenantrag_id, + 'antrag_type' => 'Abmeldung' + ]); + } } public function abmeldungstgl($prestudent_id, $studierendenantrag_id = null) { - $this->load->view('lehre/Antrag/Create', [ - 'prestudent_id' => $prestudent_id, - 'studierendenantrag_id' => $studierendenantrag_id, - 'antrag_type' => 'AbmeldungStgl' - ]); + if ($this->config->item('abmeldung_stg_enabled') === true) + { + $this->load->view('lehre/Antrag/Create', [ + 'prestudent_id' => $prestudent_id, + 'studierendenantrag_id' => $studierendenantrag_id, + 'antrag_type' => 'AbmeldungStgl' + ]); + } } public function unterbrechung($prestudent_id, $studierendenantrag_id = null) { - $this->load->view('lehre/Antrag/Create', [ - 'prestudent_id' => $prestudent_id, - 'studierendenantrag_id' => $studierendenantrag_id, - 'antrag_type' => 'Unterbrechung' - ]); + if ($this->config->item('unterbrechung_enabled') === true) + { + $this->load->view('lehre/Antrag/Create', [ + 'prestudent_id' => $prestudent_id, + 'studierendenantrag_id' => $studierendenantrag_id, + 'antrag_type' => 'Unterbrechung' + ]); + } + } public function wiederholung($prestudent_id, $studierendenantrag_id = null) { - $this->load->view('lehre/Antrag/Create', [ - 'prestudent_id' => $prestudent_id, - 'studierendenantrag_id' => $studierendenantrag_id, - 'antrag_type' => 'Wiederholung' - ]); + if ($this->config->item('wiederholung_enabled') === true) + { + $this->load->view('lehre/Antrag/Create', [ + 'prestudent_id' => $prestudent_id, + 'studierendenantrag_id' => $studierendenantrag_id, + 'antrag_type' => 'Wiederholung' + ]); + } } /** diff --git a/application/libraries/AntragLib.php b/application/libraries/AntragLib.php index 885acac90..e476b28d8 100644 --- a/application/libraries/AntragLib.php +++ b/application/libraries/AntragLib.php @@ -1937,6 +1937,7 @@ class AntragLib public function getAntragHistory($antrag_id) { + $this->_ci->StudierendenantragstatusModel->addOrder('insertamum', 'DESC'); $result = $this->_ci->StudierendenantragstatusModel->loadWithTypWhere([ 'studierendenantrag_id' => $antrag_id ]); diff --git a/application/views/lehre/Antrag/Leitung/List.php b/application/views/lehre/Antrag/Leitung/List.php index 1225b16b6..e7d3a47f1 100644 --- a/application/views/lehre/Antrag/Leitung/List.php +++ b/application/views/lehre/Antrag/Leitung/List.php @@ -44,6 +44,7 @@ $this->load->view( diff --git a/public/js/components/Studierendenantrag/Leitung.js b/public/js/components/Studierendenantrag/Leitung.js index 36e3a505d..fd7f5c99a 100644 --- a/public/js/components/Studierendenantrag/Leitung.js +++ b/public/js/components/Studierendenantrag/Leitung.js @@ -15,7 +15,8 @@ export default { }, props: { stgL: Array, - stgA: Array + stgA: Array, + abmeldung_enabled: Boolean }, data() { return { @@ -230,6 +231,7 @@ export default {
- + diff --git a/public/js/components/Studierendenantrag/Leitung/Table.js b/public/js/components/Studierendenantrag/Leitung/Table.js index 8201462b4..a6737ffd7 100644 --- a/public/js/components/Studierendenantrag/Leitung/Table.js +++ b/public/js/components/Studierendenantrag/Leitung/Table.js @@ -53,7 +53,7 @@ export default { return this.$fhcApi.factory .studstatus.leitung.getHistory(this.lastHistoryClickedId) .then(res => { - this.historyData = res.data.sort((a, b) => a.insertamum > b.insertamum); + this.historyData = res.data; }) .catch(this.$fhcApi.handleSystemError); }, From 92a08cebad46d3c0616d336e83f34d44c35dc668 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Mon, 17 Feb 2025 13:47:07 +0100 Subject: [PATCH 2/3] - addOrder ins model verschoben --- application/libraries/AntragLib.php | 1 - application/models/education/Studierendenantragstatus_model.php | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/application/libraries/AntragLib.php b/application/libraries/AntragLib.php index e476b28d8..885acac90 100644 --- a/application/libraries/AntragLib.php +++ b/application/libraries/AntragLib.php @@ -1937,7 +1937,6 @@ class AntragLib public function getAntragHistory($antrag_id) { - $this->_ci->StudierendenantragstatusModel->addOrder('insertamum', 'DESC'); $result = $this->_ci->StudierendenantragstatusModel->loadWithTypWhere([ 'studierendenantrag_id' => $antrag_id ]); diff --git a/application/models/education/Studierendenantragstatus_model.php b/application/models/education/Studierendenantragstatus_model.php index cf9cce1be..354af7491 100644 --- a/application/models/education/Studierendenantragstatus_model.php +++ b/application/models/education/Studierendenantragstatus_model.php @@ -50,7 +50,7 @@ class Studierendenantragstatus_model extends DB_Model $this->addSelect('bezeichnung[(' . $lang . ')] AS typ'); $this->addJoin('campus.tbl_studierendenantrag_statustyp', 'studierendenantrag_statustyp_kurzbz'); - + $this->addOrder($this->dbTable. '.insertamum', 'DESC'); return $this->loadWhere($where); } From 3578e0183803195a200388c54feaae528715eb7b Mon Sep 17 00:00:00 2001 From: ma0048 Date: Mon, 23 Feb 2026 08:47:36 +0100 Subject: [PATCH 3/3] unterbrecher ablehnungsgrund anzeigen --- application/libraries/AntragLib.php | 3 ++- .../education/Studierendenantrag_model.php | 2 ++ .../Studierendenantrag/Form/Unterbrechung.js | 11 ++++++++++ system/phrasesupdate.php | 20 +++++++++++++++++++ 4 files changed, 35 insertions(+), 1 deletion(-) diff --git a/application/libraries/AntragLib.php b/application/libraries/AntragLib.php index d90a98241..4fe2790ab 100644 --- a/application/libraries/AntragLib.php +++ b/application/libraries/AntragLib.php @@ -1657,7 +1657,7 @@ class AntragLib $result = $this->_ci->StudierendenantragModel->loadWithStatusWhere($where); if (isError($result)) - return $result; + return $result; if (!hasData($result)) return error($this->_ci->p->t('studierendenantrag', "error_no_antrag_found", ['id' => $studierendenantrag_id])); @@ -1709,6 +1709,7 @@ class AntragLib $result->statustyp = $antrag->statustyp; $result->status_insertvon = $antrag->status_insertvon; $result->grund = $antrag->grund; + $result->status_grund = $antrag->status_grund; $result->studierendenantrag_id = $antrag->studierendenantrag_id; $result->typ = $antrag->typ; $result->datum = $antrag->datum; diff --git a/application/models/education/Studierendenantrag_model.php b/application/models/education/Studierendenantrag_model.php index 677d01f04..40224ffc9 100644 --- a/application/models/education/Studierendenantrag_model.php +++ b/application/models/education/Studierendenantrag_model.php @@ -149,6 +149,7 @@ class Studierendenantrag_model extends DB_Model $this->addSelect($this->dbTable . '.grund AS grund'); $this->addSelect('s.studierendenantrag_statustyp_kurzbz status'); $this->addSelect('s.insertvon status_insertvon'); + $this->addSelect('s.grund AS status_grund'); $this->addSelect('t.bezeichnung[(' . $lang . ')] statustyp'); $this->addSelect('p.unruly AS unruly'); $this->addSelect($this->dbTable . '.insertamum AS insertamum'); @@ -269,6 +270,7 @@ class Studierendenantrag_model extends DB_Model $this->addSelect($this->dbTable . '.grund'); $this->addSelect($this->dbTable . '.dms_id'); $this->addSelect('s.insertvon AS status_insertvon'); + $this->addSelect('s.grund AS status_grund'); $this->addSelect( "(SELECT count(1) FROM campus.tbl_studierendenantrag_status WHERE studierendenantrag_id = " . $this->dbTable . diff --git a/public/js/components/Studierendenantrag/Form/Unterbrechung.js b/public/js/components/Studierendenantrag/Form/Unterbrechung.js index 20bda7138..7fab231ca 100644 --- a/public/js/components/Studierendenantrag/Form/Unterbrechung.js +++ b/public/js/components/Studierendenantrag/Form/Unterbrechung.js @@ -90,6 +90,17 @@ export default { msg, severity: this.statusSeverity }); + + if (this.data.status === 'Abgelehnt' && this.data?.status_grund?.trim()) + { + this.$emit('setInfos', [ + { + title: this.$p.t('studierendenantrag', 'status_grund_abgelehnt'), + body: this.data.status_grund, + severity: this.statusSeverity + } + ]); + } } return result; } diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 5dc9bc1c0..da9c475b6 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -24030,6 +24030,26 @@ array( ) ) ), + array( + 'app' => 'core', + 'category' => 'studierendenantrag', + 'phrase' => 'status_grund_abgelehnt', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Grund der Ablehnung:', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Reason for rejection:', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), array( 'app' => 'core', 'category' => 'studierendenantrag',