Merge branch 'feature-62462/FHC4_Studierendenverwaltung_Delete_Photo'

This commit is contained in:
Harald Bamberger
2025-09-26 14:37:55 +02:00
2 changed files with 19 additions and 2 deletions
@@ -276,7 +276,17 @@ class Student extends FHCAPI_Controller
$update_person = array();
foreach ($array_allowed_props_person as $prop) {
$val = $this->input->post($prop);
if ($val !== null) {
if ($val === null)
{
continue;
}
if($prop == 'foto')
{
$fotoval = ($val == '') ? null : str_replace('data:image/jpeg;base64,', '', $val);
$update_person[$prop] = $fotoval;
}
else
{
$update_person[$prop] = $val;
}
}
@@ -102,6 +102,13 @@ export default {
redirectToLeitung(){
this.$emit('redirectToLeitung', {
person_id: this.leitungData.person_id});
},
getFotoSrc(foto) {
if(foto === null) {
return FHC_JS_DATA_STORAGE_OBJECT.app_root + 'skin/images/profilbild_dummy.jpg';
} else {
return 'data:image/jpeg;base64,' + foto;
}
}
},
template: `
@@ -116,7 +123,7 @@ export default {
<img
class="d-block h-100 rounded"
alt="Profilbild"
:src="'data:image/jpeg;base64,' + person.foto"
:src="getFotoSrc(person.foto)"
/>
<template v-if="person.foto_sperre">