From 108f91ea1a5237124237e23d84e8bee7861f6049 Mon Sep 17 00:00:00 2001 From: adisposkofh Date: Mon, 10 Aug 2026 17:09:31 +0200 Subject: [PATCH] quick copy option on full name and title in profile and other lv plan --- .../api/frontend/v1/OtherLvPlan.php | 3 + .../js/components/Cis/LvPlan/OtherLvPlan.js | 35 ++++++++--- .../ProfilComponents/ProfilInformation.js | 25 ++++++++ system/phrasesupdate.php | 60 +++++++++++++++++++ 4 files changed, 115 insertions(+), 8 deletions(-) diff --git a/application/controllers/api/frontend/v1/OtherLvPlan.php b/application/controllers/api/frontend/v1/OtherLvPlan.php index af075fbc3..5b930b002 100644 --- a/application/controllers/api/frontend/v1/OtherLvPlan.php +++ b/application/controllers/api/frontend/v1/OtherLvPlan.php @@ -54,6 +54,7 @@ class OtherLvPlan extends FHCAPI_Controller $resProfileData = $this->profillib->getView($uid); $profileData = hasData($resProfileData) ? getData($resProfileData) : null; + $this->addMeta("data", $profileData->data); $viewData = [ "user_data" => [ "username" => $uid, @@ -62,6 +63,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/system/phrasesupdate.php b/system/phrasesupdate.php index 8630fe31a..1cda99fc5 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -29742,6 +29742,46 @@ array( ) ) ), + array( + 'app' => 'core', + 'category' => 'profil', + 'phrase' => 'name_title_clipboard_copy_confirmation', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Name mit Titel in die Zwischenablage kopiert.', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Full name with title copied to clipboard.', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'profil', + 'phrase' => 'name_title_copy', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Name mit Titel kopieren', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Copy full name with title', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), array( 'app' => 'core', 'category' => 'profil', @@ -60832,6 +60872,26 @@ I have been informed that I am under no obligation to consent to the transmissio ) ) ), + array( + 'app' => 'core', + 'category' => 'LvPlan', + 'phrase' => 'copy', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Kopieren', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Copy', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), // ### LvPlanStgOrg END ### // DMS-Link Phrasen Start array(