From 17c2004a394f78a0f653e7fa91b7968572bfdcab Mon Sep 17 00:00:00 2001 From: Cris Date: Tue, 20 Jun 2023 13:36:42 +0200 Subject: [PATCH] Adapted: Check for config 'fbl' in Job to send Sammelmail only to LV-Leitung (no fallback to other lectors) --- application/controllers/jobs/AnrechnungJob.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/application/controllers/jobs/AnrechnungJob.php b/application/controllers/jobs/AnrechnungJob.php index 48ee6d4ca..b442c7e56 100644 --- a/application/controllers/jobs/AnrechnungJob.php +++ b/application/controllers/jobs/AnrechnungJob.php @@ -37,6 +37,9 @@ class AnrechnungJob extends JOB_Controller $this->load->helper('hlp_sancho_helper'); $this->load->library('AnrechnungLib'); + + // Load configs + $this->load->config('anrechnung'); } /** @@ -258,7 +261,15 @@ class AnrechnungJob extends JOB_Controller $arr_lvLector_arr = array(); foreach ($anrechnung_id_arr as $anrechnung_id) { - $arr_lvLector_arr[]= $this->anrechnunglib->getLectors($anrechnung_id); // Returns LV Leitung. If not present, then all lectors of LV. + // Get full name of Fachbereichsleitung or LV Leitung. + if($this->config->item('fbl') === TRUE) + { + $arr_lvLector_arr[] = $this->anrechnunglib->getLeitungOfLvOe($anrechnung_id); + } + else + { + $arr_lvLector_arr[] = $this->anrechnunglib->getLectors($anrechnung_id); // Returns LV Leitung. If not present, then all lectors of LV. + } } // Unique lector array to send only one mail per lector