Merge branch 'feature/78128-quick-copy-full-name-and-title'

This commit is contained in:
Harald Bamberger
2026-08-18 17:39:44 +02:00
4 changed files with 114 additions and 8 deletions
@@ -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,
],
];
+27 -8
View File
@@ -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*/ `
<div class="d-flex flex-column h-100">
<h2>
<div class="d-flex flex-row justify-content-between align-items-center">
@@ -238,8 +254,11 @@ export default {
{{ $p.t('lehre/stundenplan') + (studiensemester_kurzbz ? " " + studiensemester_kurzbz : "") }}
</span>
<div @click="this.$router.push({name: 'ProfilView', params: {uid: propsViewData.otherUid}})" type="button" class="d-flex flex-row align-items-center gap-3">
<span v-if="otherPersonData.fullName?.length">
{{ otherPersonData.fullName }}
<span v-if="otherPersonData.fullNameWithTitle?.length">
{{ otherPersonData.fullNameWithTitle }}
<span @click.stop="copyFullNameWithTitleToClipboard()" :title="$p.t('LvPlan/copy')" class="fs-4 h-100">
<i class="fa-regular fa-copy"></i>
</span>
</span>
<img v-if="otherPersonData.photo?.length" alt="profile picture" class=" img-thumbnail " style=" max-height:60px; " :src="get_image_base64_src"/>
</div>
@@ -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*/ `
<div class="card h-100">
@@ -124,6 +139,16 @@ export default {
<span class="form-underline-content">{{wert?wert:'-'}} </span>
</div>
</div>
<a
@click="copyFullNameWithTitleToClipboard()"
href="#"
class="col-12 fhc-link-color d-flex flex-row gap-2 align-items-center justify-content-center mt-3"
>
<span>
<i class="fa-regular fa-copy ms-2 text-decoration-none"></i>
</span>
<span>{{ $p.t("profil/name_title_copy") }}</span>
</a>
</div>
</div>
</div>
+60
View File
@@ -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',
@@ -60852,6 +60892,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(