From c75e1f94165f0bda32fa27bf772a956cfb42c6a7 Mon Sep 17 00:00:00 2001 From: Johann Hoffmann Date: Fri, 5 Jun 2026 10:12:03 +0200 Subject: [PATCH] WIP --- application/config/abgabe.php | 2 +- .../controllers/api/frontend/v1/Abgabe.php | 19 ++++++++++-------- .../models/education/Projektarbeit_model.php | 5 ++++- .../Cis/Abgabetool/AbgabeMitarbeiterDetail.js | 5 ++++- .../Cis/Abgabetool/AbgabeStudentDetail.js | 2 +- .../Cis/Abgabetool/AbgabetoolStudent.js | 2 +- system/phrasesupdate.php | 20 +++++++++++++++++++ 7 files changed, 42 insertions(+), 13 deletions(-) diff --git a/application/config/abgabe.php b/application/config/abgabe.php index e1cdfbfa7..dd059d047 100644 --- a/application/config/abgabe.php +++ b/application/config/abgabe.php @@ -29,7 +29,7 @@ $config['ALLOWED_NOTEN_ABGABETOOL'] = [10, 14]; // tbl_note pk // benotete projektarbeiten sperren weitere terminanlage & bearbeitung, diese noten sind ausnahmen dieser Regel // wie zB "Nicht beurteilt" & "Noch nicht eingetragen" $config['NONFINAL_NOTEN_ABGABETOOL'] = [9]; -$config['beurteilung_link_fallback'] = 'addons/fhtw/content/projektbeurteilung/projektbeurteilungDocumentExport.php?projektarbeit_id=?&betreuerart_kurzbz=?&person_id=?'; +$config['beurteilung_link_fallback'] = 'cis/private/lehre/projektbeurteilungDocumentExport.php?projektarbeit_id=?&betreuerart_kurzbz=?&person_id=?'; $config['PROJEKTARBEITSBEURTEILUNG_MAIL_BASELINK_ERSTBEGUTACHTER'] = 'index.ci.php/extensions/FHC-Core-Projektarbeitsbeurteilung/ProjektarbeitsbeurteilungErstbegutachter'; $config['PROJEKTARBEITSBEURTEILUNG_MAIL_BASELINK_ZWEITBEGUTACHTER'] = 'index.ci.php/extensions/FHC-Core-Projektarbeitsbeurteilung/ProjektarbeitsbeurteilungErstbegutachter'; diff --git a/application/controllers/api/frontend/v1/Abgabe.php b/application/controllers/api/frontend/v1/Abgabe.php index d80a98ced..6e0ae2eef 100644 --- a/application/controllers/api/frontend/v1/Abgabe.php +++ b/application/controllers/api/frontend/v1/Abgabe.php @@ -848,8 +848,6 @@ class Abgabe extends FHCAPI_Controller // load existing entry of paabgabe and check if note has changed to negativ, to avoid sending when // only notiz has changed. - // TODO: what if paabgabe is a qualgate1, is benotet negativ and then its type is changed to gate2? - $existingResult = $this->PaabgabeModel->load($paabgabe_id); $existingPaabgabeArr = getData($existingResult); if(count($existingPaabgabeArr) > 0) $existingPaabgabe = $existingPaabgabeArr[0]; @@ -860,8 +858,10 @@ class Abgabe extends FHCAPI_Controller $this->terminateWithError($this->p->t('abgabetool', 'c4abgabetypAendernNichtErlaubt')); } - - // check if a change of deadline aka datum is being attempted -> should not be allowed at this point? + // check if a change of deadline aka datum is being attempted -> notallowed at this point + if($datum !== $existingPaabgabe->datum) { + $this->terminateWithError($this->p->t('abgabetool', 'c4datumAendernNichtErlaubt')); + } } $result = $this->PaabgabeModel->update( @@ -1238,9 +1238,12 @@ class Abgabe extends FHCAPI_Controller private function getProjektbetreuerEmailByPersonID($person_id) { $this->load->model('education/Projektarbeit_model', 'ProjektarbeitModel'); $result = $this->ProjektarbeitModel->getProjektbetreuerEmailByPersonID($person_id); - $email = $this->getDataOrTerminateWithError($result, 'general'); - - return $email[0]->uid ? $email[0]->uid.'@'.DOMAIN : $email[0]->private_email; + if(hasData($result)) { + $email = getData($result); + return $email[0]->uid ? $email[0]->uid.'@'.DOMAIN : $email[0]->private_email; + } else { + return null; + } } //TODO: SWITCH TO NOTEN API ONCE NOTENTOOL IS IN MASTER TO AVOID DUPLICATE API @@ -1629,7 +1632,7 @@ class Abgabe extends FHCAPI_Controller $email = $this->getProjektbetreuerEmailByProjektarbeitID($projektarbeit_id); - if(!$email) $this->terminateWithError($this->p->t('abgabetool', 'c4fehlerMailBegutachterv2'), 'general'); + if(!$email) $this->terminateWithError('early fail', 'general'); $mailres = sendSanchoMail( 'ParbeitsbeurteilungEndupload', diff --git a/application/models/education/Projektarbeit_model.php b/application/models/education/Projektarbeit_model.php index ef1759154..aaa0962b1 100644 --- a/application/models/education/Projektarbeit_model.php +++ b/application/models/education/Projektarbeit_model.php @@ -207,7 +207,10 @@ class Projektarbeit_model extends DB_Model campus.tbl_paabgabetyp.paabgabetyp_kurzbz, campus.tbl_paabgabetyp.bezeichnung, campus.tbl_paabgabe.abgabedatum, - campus.tbl_paabgabe.insertvon + campus.tbl_paabgabe.insertvon, + campus.tbl_paabgabe.updatevon, + campus.tbl_paabgabe.insertamum, + campus.tbl_paabgabe.updateamum FROM campus.tbl_paabgabe JOIN campus.tbl_paabgabetyp USING(paabgabetyp_kurzbz) WHERE campus.tbl_paabgabe.projektarbeit_id IN ? ORDER BY campus.tbl_paabgabe.datum"; diff --git a/public/js/components/Cis/Abgabetool/AbgabeMitarbeiterDetail.js b/public/js/components/Cis/Abgabetool/AbgabeMitarbeiterDetail.js index ee25abec5..fd77ad347 100644 --- a/public/js/components/Cis/Abgabetool/AbgabeMitarbeiterDetail.js +++ b/public/js/components/Cis/Abgabetool/AbgabeMitarbeiterDetail.js @@ -905,7 +905,7 @@ export const AbgabeMitarbeiterDetail = {
{{ $capitalize( $p.t('abgabetool/c4actions') )}}
-
+
+
+ Your grey text here +
diff --git a/public/js/components/Cis/Abgabetool/AbgabeStudentDetail.js b/public/js/components/Cis/Abgabetool/AbgabeStudentDetail.js index 242313925..8cbe26e97 100644 --- a/public/js/components/Cis/Abgabetool/AbgabeStudentDetail.js +++ b/public/js/components/Cis/Abgabetool/AbgabeStudentDetail.js @@ -658,7 +658,7 @@ export const AbgabeStudentDetail = {