diff --git a/application/controllers/api/frontend/v1/stv/Kontakt.php b/application/controllers/api/frontend/v1/stv/Kontakt.php index d246a04d9..cd35768f3 100644 --- a/application/controllers/api/frontend/v1/stv/Kontakt.php +++ b/application/controllers/api/frontend/v1/stv/Kontakt.php @@ -574,6 +574,19 @@ class Kontakt extends FHCAPI_Controller $person_id = $this->input->post('person_id'); $standort_id = $this->input->post('standort_id'); + //check person_id: allow editing only of persons who are no mitarbeiter + if($person_id) + { + $this->load->model('person/Benutzer_model', 'BenutzerModel'); + $this->BenutzerModel->addJoin('public.tbl_mitarbeiter ma', 'ON (ma.mitarbeiter_uid = public.tbl_benutzer.uid)'); + + $result = $this->BenutzerModel->loadWhere([ + 'person_id' => $person_id + ]); + if(hasData($result)) + return $this->terminateWithError($this->p->t('ui', 'editingMitarbeiterPVonly'), self::ERROR_TYPE_GENERAL); + } + $result = $this->KontaktModel->update( [ 'kontakt_id' => $kontakt_id diff --git a/public/js/components/Bootstrap/Modal.js b/public/js/components/Bootstrap/Modal.js index 0f2504da6..778951c46 100644 --- a/public/js/components/Bootstrap/Modal.js +++ b/public/js/components/Bootstrap/Modal.js @@ -103,6 +103,13 @@ export default { keyboard: this.keyboard }); }, + //to avoid pagelocks if more than one instance + beforeUnmount() { + if (this.modal) { + this.modal.dispose(); + this.modal = null; + } + }, popup(body, options, title, footer) { const BsModal = this, slots = {}; diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Kontakt/Contact.js b/public/js/components/Stv/Studentenverwaltung/Details/Kontakt/Contact.js index 4bdda4762..f6f884dde 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Kontakt/Contact.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Kontakt/Contact.js @@ -263,7 +263,7 @@ export default { this.$refs[modalRef].hide(); }, reload() { - this.$refs.table.reloadTable(); + this.$refs.table?.reloadTable(); }, searchFirma(event) { if (this.abortController.firmen) { diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Projektarbeit/Projektbetreuer.js b/public/js/components/Stv/Studentenverwaltung/Details/Projektarbeit/Projektbetreuer.js index 8be2d0153..eba03b8f7 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Projektarbeit/Projektbetreuer.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Projektarbeit/Projektbetreuer.js @@ -30,6 +30,9 @@ export default { computed: { betreuerFormOpened() { return this.newMode || this.editMode; + }, + isMitarbeiter(){ + return this.autocompleteSelectedBetreuer?.name?.includes('Mitarbeiter') ?? false; } }, props: { @@ -430,6 +433,11 @@ export default { }, actionKontaktdatenBearbeiten() { if (!this.autocompleteSelectedBetreuer) return; + if (this.isMitarbeiter) + { + this.$fhcAlert.alertError(this.$p.t('ui', 'editingMitarbeiterPVonly')); + return; + } this.$refs.kontaktdatenModal.show(); }, // stuff to do after new person has been saved @@ -494,7 +502,12 @@ export default {
- +
@@ -605,7 +618,7 @@ export default { - + ` } diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 11c110f4f..501b5d38e 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -63774,6 +63774,26 @@ I have been informed that I am under no obligation to consent to the transmissio ) ), // ### Infocenter Onboarding END + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'editingMitarbeiterPVonly', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Kontaktdaten von Mitarbeiter*innen dürfen nur in der Personalverwaltung editiert werden.', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Employee contact details may only be edited in the personnel administration system.', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), //**************************** CIS Projektabgabeuebersicht start array( 'app' => 'core',