diff --git a/assets/ckeditor/plugins/PartDBLabel/PartDBLabelUI.js b/assets/ckeditor/plugins/PartDBLabel/PartDBLabelUI.js index 5dddbb01..c063d7a8 100644 --- a/assets/ckeditor/plugins/PartDBLabel/PartDBLabelUI.js +++ b/assets/ckeditor/plugins/PartDBLabel/PartDBLabelUI.js @@ -96,6 +96,8 @@ const PLACEHOLDERS = [ ['[[AMOUNT]]', 'Lot amount'], ['[[LOCATION]]', 'Storage location'], ['[[LOCATION_FULL]]', 'Storage location (Full path)'], + ['[[OWNER]]', 'Full name of the lot owner'], + ['[[OWNER_USERNAME]]', 'Username of the lot owner'], ] }, { diff --git a/assets/ckeditor/plugins/PartDBLabel/lang/de.js b/assets/ckeditor/plugins/PartDBLabel/lang/de.js index d49a26ed..c263825f 100644 --- a/assets/ckeditor/plugins/PartDBLabel/lang/de.js +++ b/assets/ckeditor/plugins/PartDBLabel/lang/de.js @@ -55,6 +55,8 @@ Object.assign( window.CKEDITOR_TRANSLATIONS[ 'de' ].dictionary, { 'Lot amount': 'Lot Menge', 'Storage location': 'Lagerort', 'Storage location (Full path)': 'Lagerort (Vollständiger Pfad)', + 'Full name of the lot owner': 'Name des Besitzers des Lots', + 'Username of the lot owner': 'Benutzername des Besitzers des Lots', 'Barcodes': 'Barcodes', diff --git a/src/Services/LabelSystem/PlaceholderProviders/PartLotProvider.php b/src/Services/LabelSystem/PlaceholderProviders/PartLotProvider.php index 3f204f32..a4fdf32a 100644 --- a/src/Services/LabelSystem/PlaceholderProviders/PartLotProvider.php +++ b/src/Services/LabelSystem/PlaceholderProviders/PartLotProvider.php @@ -102,6 +102,14 @@ final class PartLotProvider implements PlaceholderProviderInterface return $label_target->getStorageLocation() ? $label_target->getStorageLocation()->getFullPath() : ''; } + if ('[[OWNER]]' === $placeholder) { + return $label_target->getOwner() ? $label_target->getOwner()->getFullName() : ''; + } + + if ('[[OWNER_USERNAME]]' === $placeholder) { + return $label_target->getOwner() ? $label_target->getOwner()->getUsername() : ''; + } + return $this->labelTextReplacer->handlePlaceholder($placeholder, $label_target->getPart()); }