diff --git a/application/controllers/api/frontend/v1/Profil.php b/application/controllers/api/frontend/v1/Profil.php index f234fc30e..b58d90d07 100644 --- a/application/controllers/api/frontend/v1/Profil.php +++ b/application/controllers/api/frontend/v1/Profil.php @@ -108,6 +108,7 @@ class Profil extends FHCAPI_Controller $res->data = $this->viewStudentProfil($uid); } } + $res->data->fotoStatus=$this->isFotoAkzeptiert($this->pid); $res->data->editAllowed = $editAllowed; $this->terminateWithSuccess($res); } @@ -648,5 +649,28 @@ class Profil extends FHCAPI_Controller $zutrittskarte_ausgegebenam = str_replace("-", ".", $zutrittskarte_ausgegebenam); return $zutrittskarte_ausgegebenam; } + + /** + * checks whether the foto of a user is accepted or not + * @access private + * @param integer $pid the personId of the student or mitarbeiter + * @return bool whether the foto is accepted or not + */ + private function isFotoAkzeptiert($pid) + { + $this->load->model('person/Fotostatusperson_model','FotostatusModel'); + $fotostatus = $this->FotostatusModel->execReadOnlyQuery(" + select distinct on (person_id) person_id, insertamum, fotostatus_kurzbz + from public.tbl_person_fotostatus + where person_id = ? + order by person_id, insertamum desc",[$pid]); + $fotostatus = $this->getDataOrTerminateWithError($fotostatus); + if(is_array($fotostatus) && count($fotostatus) > 0){ + $fotostatus = current($fotostatus)->fotostatus_kurzbz == 'akzeptiert'; + } + else + $fotostatus = false; + return $fotostatus; + } } diff --git a/public/css/components/Profil.css b/public/css/components/Profil.css index b1ac8d67a..220c2ebfe 100644 --- a/public/css/components/Profil.css +++ b/public/css/components/Profil.css @@ -9,7 +9,6 @@ width:21px; background-color:var(--fhc-profil-border); position:absolute; - /* top: 1px is important, otherwise it goes over the border of the thumbnail*/ top:1px; right:12px; display:flex; @@ -18,6 +17,19 @@ border-radius:3px; } +.image-upload { + height: 22px; + width: 21px; + background-color: var(--fhc-profil-border); + position: absolute; + bottom: 4.5px; + left: 14.5px; + display: flex; + align-items: center; + justify-content: center; + border-radius: 3px 3px 3px 0; +} + .tabulator-collapsed-row{ padding:15px; background-color: var(--fhc-profil-tabulator-shadow); diff --git a/public/js/components/Cis/Profil/MitarbeiterProfil.js b/public/js/components/Cis/Profil/MitarbeiterProfil.js index 07a6339e4..0bb628e19 100644 --- a/public/js/components/Cis/Profil/MitarbeiterProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterProfil.js @@ -218,6 +218,9 @@ export default { editable() { return this.data?.editAllowed ?? false; }, + fotoStatus() { + return this.data?.fotoStatus ?? false; + }, getTelefonValue() { if(this.data.standort_telefon?.kontakt) { return this.data.standort_telefon.kontakt + " " + this.data.telefonklappe @@ -337,7 +340,7 @@ export default {
- +
diff --git a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js index cef970ec2..23a86b5f9 100644 --- a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js @@ -113,6 +113,9 @@ export default { editable() { return this.data?.editAllowed ?? false; }, + fotoStatus() { + return this.data?.fotoStatus ?? false; + }, personEmails() { return this.data?.emails ? this.data.emails : []; @@ -189,7 +192,7 @@ export default {
- +
diff --git a/public/js/components/Cis/Profil/ProfilComponents/ProfilInformation.js b/public/js/components/Cis/Profil/ProfilComponents/ProfilInformation.js index e39b4d57d..2881ecec1 100644 --- a/public/js/components/Cis/Profil/ProfilComponents/ProfilInformation.js +++ b/public/js/components/Cis/Profil/ProfilComponents/ProfilInformation.js @@ -11,6 +11,10 @@ export default { editable: { type: Boolean, default: false + }, + fotoStatus:{ + type: Boolean, + default: true } }, data() { @@ -83,6 +87,9 @@ export default {
+
+
+
diff --git a/public/js/components/Cis/Profil/StudentProfil.js b/public/js/components/Cis/Profil/StudentProfil.js index 635033fda..2c0d5ba2b 100644 --- a/public/js/components/Cis/Profil/StudentProfil.js +++ b/public/js/components/Cis/Profil/StudentProfil.js @@ -166,6 +166,9 @@ export default { editable() { return this.data?.editAllowed ?? false; }, + fotoStatus() { + return this.data?.fotoStatus ?? false; + }, filteredEditData() { return this.editDataFilter @@ -239,9 +242,9 @@ export default { }, template: /*html*/ `
- - +
@@ -251,7 +254,7 @@ export default {
--> - +
@@ -267,24 +270,24 @@ export default {
- +
- +
- +
- +
diff --git a/public/js/components/Cis/Profil/StudentViewProfil.js b/public/js/components/Cis/Profil/StudentViewProfil.js index 1c2044441..f7ad03b98 100644 --- a/public/js/components/Cis/Profil/StudentViewProfil.js +++ b/public/js/components/Cis/Profil/StudentViewProfil.js @@ -29,6 +29,9 @@ export default { editable() { return this.data?.editAllowed ?? false; }, + fotoStatus() { + return this.data?.fotoStatus ?? false; + }, profilInformation() { if (!this.data) { return {}; @@ -115,7 +118,7 @@ export default {
- +