also show email contact for zweitbetreuer in student page + distinguish them in the label in case of more than 1 betreuer;

This commit is contained in:
Johann Hoffmann
2026-06-30 13:02:19 +02:00
parent 787e5d0ee4
commit d405296a14
4 changed files with 55 additions and 25 deletions
@@ -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);
}
}
}
@@ -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)
@@ -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 = {
</div>
</div>
<div class="row mt-2">
<div class="col-4 col-md-3 fw-bold">{{$capitalize( $p.t('abgabetool/c4betreuerEmailKontaktv2') )}}</div>
<div class="col-4 col-md-3 fw-bold">{{ getErstbetreuerEmailLabel(projektarbeit) }}</div>
<div class="col-8 col-md-9">
<a :href="getMailLink(projektarbeit)"><i class="fa fa-envelope" style="color:#00649C"></i></a>
</div>
@@ -502,6 +527,13 @@ export const AbgabetoolStudent = {
{{ projektarbeit.zweitbetreuer?.first }}
</div>
</div>
<div v-if="projektarbeit.zweitbetreuer_person_id || projektarbeit.zweitbetreuer" class="row mt-2">
<div class="col-4 col-md-3 fw-bold">{{ getZweitbetreuerEmailLabel(projektarbeit) }}</div>
<div class="col-8 col-md-9">
<a v-if="projektarbeit.zweitbetreuer_mail" :href="getZweitbetreuerMailLink(projektarbeit)"><i class="fa fa-envelope" style="color:#00649C"></i></a>
<span v-else>-</span>
</div>
</div>
<div class="row mt-2">
<div class="col-4 col-md-3 fw-bold">{{$capitalize( $p.t('abgabetool/c4projekttyp') )}}</div>
<div class="col-8 col-md-9">
+20
View File
@@ -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',