From d405296a1495ed3d04bdd5f564f2b7f330bc1a19 Mon Sep 17 00:00:00 2001 From: Johann Hoffmann Date: Tue, 30 Jun 2026 13:02:19 +0200 Subject: [PATCH] also show email contact for zweitbetreuer in student page + distinguish them in the label in case of more than 1 betreuer; --- .../controllers/api/frontend/v1/Abgabe.php | 2 ++ .../Cis/Abgabetool/AbgabetoolAssistenz.js | 24 ------------- .../Cis/Abgabetool/AbgabetoolStudent.js | 34 ++++++++++++++++++- system/phrasesupdate.php | 20 +++++++++++ 4 files changed, 55 insertions(+), 25 deletions(-) diff --git a/application/controllers/api/frontend/v1/Abgabe.php b/application/controllers/api/frontend/v1/Abgabe.php index 45889f447..ec97b9a2e 100644 --- a/application/controllers/api/frontend/v1/Abgabe.php +++ b/application/controllers/api/frontend/v1/Abgabe.php @@ -293,6 +293,8 @@ class Abgabe extends FHCAPI_Controller if(count($data) > 0) { $pa->zweitbetreuer = $data[0]; } + + $pa->zweitbetreuer_mail = $this->getProjektbetreuerEmailByPersonID($pa->zweitbetreuer_person_id); } } } diff --git a/public/js/components/Cis/Abgabetool/AbgabetoolAssistenz.js b/public/js/components/Cis/Abgabetool/AbgabetoolAssistenz.js index 3dcf7c0a1..3d8fc1d79 100644 --- a/public/js/components/Cis/Abgabetool/AbgabetoolAssistenz.js +++ b/public/js/components/Cis/Abgabetool/AbgabetoolAssistenz.js @@ -1900,7 +1900,6 @@ export const AbgabetoolAssistenz = { openTimeline(val) { this.$api.call(ApiAbgabe.fetchProjektarbeitenHistory(val.student_uid)).then(res => { - console.log(res) res.data.forEach(projekt => { projekt.abgabetermine?.forEach(termin => { @@ -1923,29 +1922,6 @@ export const AbgabetoolAssistenz = { this.$refs.drawer.show() }) }, - // openTimeline(val) { - // - // this.$api.call(ApiAbgabe.fetchProjektarbeitenHistory(val.student_uid)).then(res => { - // console.log(res) - // }) - // - // const projekt = this.projektarbeiten.find(p => p.projektarbeit_id == val.projektarbeit_id) - // if(!projekt) { - // - // this.$fhcAlert.alertInfo('Keine projektarbeit gefunden') - // - // return - // } - // - // projekt.abgabetermine.forEach(termin => { - // // show note only on termine with abgabetypen which are benotbar - // const terminTypOpt = this.abgabeTypeOptions.find(opt => opt.paabgabetyp_kurzbz == termin.paabgabetyp_kurzbz) - // termin.benotbar = terminTypOpt.benotbar - // }) - // - // this.timelineProjekt = projekt - // this.$refs.drawer.show() - // }, paabgabetypFormatter(cell) { const key = cell.getValue() return this.$p.t('abgabetool/c4paatyp' + key) diff --git a/public/js/components/Cis/Abgabetool/AbgabetoolStudent.js b/public/js/components/Cis/Abgabetool/AbgabetoolStudent.js index c059ce83b..1c00c21e9 100644 --- a/public/js/components/Cis/Abgabetool/AbgabetoolStudent.js +++ b/public/js/components/Cis/Abgabetool/AbgabetoolStudent.js @@ -300,6 +300,31 @@ export const AbgabetoolStudent = { return 'mailto:'+projektarbeit.email } else return '' }, + getZweitbetreuerMailLink(projektarbeit) { + if(projektarbeit.zweitbetreuer_mail) { + return 'mailto:'+projektarbeit.zweitbetreuer_mail + } else return '' + }, + hasZweitbetreuer(projektarbeit) { + return !!(projektarbeit.zweitbetreuer_person_id || projektarbeit.zweitbetreuer) + }, + getErstbetreuerEmailLabel(projektarbeit) { + // with only one betreuer keep the generic label; with multiple betreuer + // distinguish the email rows by their betreuungsart bezeichnung + if(!this.hasZweitbetreuer(projektarbeit)) { + return this.$capitalize(this.$p.t('abgabetool/c4betreuerEmailKontaktv2')) + } + const art = projektarbeit.betreuerart_kurzbz + ? this.$p.t('abgabetool/c4betrart' + projektarbeit.betreuerart_kurzbz) + : this.$p.t('abgabetool/c4betreuerv2') + return this.$capitalize(this.$p.t('abgabetool/c4emailBetreuungsart', [art])) + }, + getZweitbetreuerEmailLabel(projektarbeit) { + const art = projektarbeit.zweitbetreuer_betreuerart_kurzbz + ? this.$p.t('abgabetool/c4betrart' + projektarbeit.zweitbetreuer_betreuerart_kurzbz) + : '' + return this.$capitalize(this.$p.t('abgabetool/c4emailBetreuungsart', [art])) + }, getNoteBezeichnung(projektarbeit) { if(projektarbeit.note && this.notenOptions) { const noteOpt = this.notenOptions.find(opt => opt.note == projektarbeit.note) @@ -491,7 +516,7 @@ export const AbgabetoolStudent = {
-
{{$capitalize( $p.t('abgabetool/c4betreuerEmailKontaktv2') )}}
+
{{ getErstbetreuerEmailLabel(projektarbeit) }}
@@ -502,6 +527,13 @@ export const AbgabetoolStudent = { {{ projektarbeit.zweitbetreuer?.first }}
+
+
{{ getZweitbetreuerEmailLabel(projektarbeit) }}
+
+ + - +
+
{{$capitalize( $p.t('abgabetool/c4projekttyp') )}}
diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 00b66b00c..e01cb1130 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -45943,6 +45943,26 @@ array( ) ) ), + array( + 'app' => 'core', + 'category' => 'abgabetool', + 'phrase' => 'c4emailBetreuungsart', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'E-Mail {0}', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Email {0}', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), array( 'app' => 'core', 'category' => 'abgabetool',