diff --git a/application/controllers/api/frontend/v1/OtherLvPlan.php b/application/controllers/api/frontend/v1/OtherLvPlan.php index af075fbc3..1807f0a4a 100644 --- a/application/controllers/api/frontend/v1/OtherLvPlan.php +++ b/application/controllers/api/frontend/v1/OtherLvPlan.php @@ -62,6 +62,8 @@ class OtherLvPlan extends FHCAPI_Controller "foto" => $profileData->data->foto, "vorname" => $profileData->data->vorname, "nachname" => $profileData->data->nachname, + "titel" => $profileData->data->titel, + "postnomen" => $profileData->data->postnomen, ], ]; diff --git a/public/js/components/Cis/LvPlan/OtherLvPlan.js b/public/js/components/Cis/LvPlan/OtherLvPlan.js index d1caebc90..6c70e1c93 100644 --- a/public/js/components/Cis/LvPlan/OtherLvPlan.js +++ b/public/js/components/Cis/LvPlan/OtherLvPlan.js @@ -32,7 +32,7 @@ export default { listGroup: [], rangeIntervalFirst: null, otherPersonData: { - fullName: "", + fullNameWithTitle: "", photo: "", }, timezone: FHC_JS_DATA_STORAGE_OBJECT.timezone, @@ -210,10 +210,17 @@ export default { this.isOtherPersonMitarbeiter = !!viewData?.user_data?.is_mitarbeiter; this.isOtherPersonStudent = !!viewData?.user_data?.is_student; - this.otherPersonData.fullName = - viewData?.user_data?.vorname + - " " + - viewData?.user_data?.nachname; + let fullNameWithTitleFragments = [ + viewData?.user_data?.titel, + viewData?.user_data?.vorname, + viewData?.user_data?.nachname, + viewData?.user_data?.postnomen, + ]; + fullNameWithTitleFragments = fullNameWithTitleFragments.filter( + (fragment) => !!fragment, + ); + this.otherPersonData.fullNameWithTitle = + fullNameWithTitleFragments.join(" "); this.otherPersonData.photo = viewData?.user_data?.foto; }, async redirectToMyLvPlanIfAuthUid() { @@ -225,12 +232,21 @@ export default { this.$router.push({ name: "MyLvPlan" }); } }, + copyFullNameWithTitleToClipboard() { + navigator.clipboard.writeText( + this.otherPersonData.fullNameWithTitle, + ); + this.$fhcAlert.alertSuccess( + this.$p.t("profil/name_title_clipboard_copy_confirmation"), + ); + }, }, async created() { await this.redirectToMyLvPlanIfAuthUid(); await this.fetchViewData(); + await this.$p.loadCategory(["profil"]); }, - template: ` + template: /*html*/ `

@@ -238,8 +254,11 @@ export default { {{ $p.t('lehre/stundenplan') + (studiensemester_kurzbz ? " " + studiensemester_kurzbz : "") }}
- - {{ otherPersonData.fullName }} + + {{ otherPersonData.fullNameWithTitle }} + + + profile picture
diff --git a/public/js/components/Cis/Profil/ProfilComponents/ProfilInformation.js b/public/js/components/Cis/Profil/ProfilComponents/ProfilInformation.js index d714c9faa..2df4024ca 100644 --- a/public/js/components/Cis/Profil/ProfilComponents/ProfilInformation.js +++ b/public/js/components/Cis/Profil/ProfilComponents/ProfilInformation.js @@ -67,6 +67,21 @@ export default { return res; }, }, + methods: { + copyFullNameWithTitleToClipboard() { + let fragments = [ + this.$props.data.Titel, + this.$props.data.Vorname, + this.$props.data.Nachname, + this.$props.data.Postnomen, + ]; + fragments = fragments.filter((fragment) => !!fragment); + navigator.clipboard.writeText(fragments.join(" ")); + this.$fhcAlert.alertSuccess( + this.$p.t("profil/name_title_clipboard_copy_confirmation"), + ); + }, + }, template: /*html*/ `
@@ -124,6 +139,16 @@ export default { {{wert?wert:'-'}}
+ + + + + {{ $p.t("profil/name_title_copy") }} +

diff --git a/public/js/components/Cis/Renderer/Lehreinheit/modalContent.js b/public/js/components/Cis/Renderer/Lehreinheit/modalContent.js index 738c0c75c..eb8908648 100644 --- a/public/js/components/Cis/Renderer/Lehreinheit/modalContent.js +++ b/public/js/components/Cis/Renderer/Lehreinheit/modalContent.js @@ -51,6 +51,16 @@ export default { return numberPadding(this.event.ende.getHours()) + ":" + numberPadding(this.event.ende.getMinutes()); } }, + watch: { + event: { + async handler() { + if (this.$props.event.type == "lehreinheit") { + await this.getLvMenu(); + } + }, + deep: true, + }, + }, methods: { mehtodNumberPadding: function (number) { return numberPadding(number); @@ -58,21 +68,31 @@ export default { methodFormatDate: function (d) { return formatDate(d); }, + async getLvMenu() { + const semesterResponse = await this.$api.call( + ApiLvPlan.getLehreinheitStudiensemester( + Array.isArray(this.event.lehreinheit_id) + ? this.event.lehreinheit_id[0] + : this.event.lehreinheit_id, + ), + ); + if (semesterResponse.meta.status !== "success") return; + + const studiensemesterKurzbz = semesterResponse.data; + const lvMenuResponse = await this.$api.call( + ApiAddons.getLvMenu( + this.event.lehrveranstaltung_id, + studiensemesterKurzbz, + ), + ); + if (lvMenuResponse.meta.status !== "success") return; + + this.lvMenu = lvMenuResponse.data; + }, }, - created() { - if (this.event.type == 'lehreinheit') { - this.$api - .call(ApiLvPlan.getLehreinheitStudiensemester(Array.isArray(this.event.lehreinheit_id) ? this.event.lehreinheit_id[0] : this.event.lehreinheit_id)) - .then(res => res.data) - .then(studiensemester_kurzbz => this.$api.call( - ApiAddons.getLvMenu( - this.event.lehrveranstaltung_id, - studiensemester_kurzbz - ) - )) - .then(res => { - this.lvMenu = res.data; - }); + async created() { + if (this.$props.event.type == 'lehreinheit') { + await this.getLvMenu(); } }, template: ` diff --git a/public/js/components/Cis/Studium/Studium.js b/public/js/components/Cis/Studium/Studium.js index 815793f55..2b6fb5779 100644 --- a/public/js/components/Cis/Studium/Studium.js +++ b/public/js/components/Cis/Studium/Studium.js @@ -382,13 +382,13 @@ export default {