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 {