Added internal part number (IPN) as label placeholders

This fixes issue #306
This commit is contained in:
Jan Böhmer 2023-06-26 23:56:23 +02:00
parent d6500c45aa
commit c6b6616ee3
3 changed files with 6 additions and 0 deletions

View file

@ -76,6 +76,7 @@ const PLACEHOLDERS = [
['[[FOOTPRINT_FULL]]', 'Footprint (Full path)'], ['[[FOOTPRINT_FULL]]', 'Footprint (Full path)'],
['[[MASS]]', 'Mass'], ['[[MASS]]', 'Mass'],
['[[MPN]]', 'Manufacturer Product Number (MPN)'], ['[[MPN]]', 'Manufacturer Product Number (MPN)'],
['[[IPN]]', 'Internal Part Number (IPN)'],
['[[TAGS]]', 'Tags'], ['[[TAGS]]', 'Tags'],
['[[M_STATUS]]', 'Manufacturing status'], ['[[M_STATUS]]', 'Manufacturing status'],
['[[DESCRIPTION]]', 'Description'], ['[[DESCRIPTION]]', 'Description'],

View file

@ -39,6 +39,7 @@ Object.assign( window.CKEDITOR_TRANSLATIONS[ 'de' ].dictionary, {
'Footprint (Full path)': 'Footprint (Vollständiger Pfad)', 'Footprint (Full path)': 'Footprint (Vollständiger Pfad)',
'Mass': 'Gewicht', 'Mass': 'Gewicht',
'Manufacturer Product Number (MPN)': 'Hersteller Produktnummer (MPN)', 'Manufacturer Product Number (MPN)': 'Hersteller Produktnummer (MPN)',
'Internal Part Number (IPN)': 'Internal Part Number (IPN)',
'Tags': 'Tags', 'Tags': 'Tags',
'Manufacturing status': 'Herstellungsstatus', 'Manufacturing status': 'Herstellungsstatus',
'Description': 'Beschreibung', 'Description': 'Beschreibung',

View file

@ -96,6 +96,10 @@ final class PartProvider implements PlaceholderProviderInterface
return $part->getManufacturerProductNumber(); return $part->getManufacturerProductNumber();
} }
if ('[[IPN]]' === $placeholder) {
return $part->getIpn() ?? '';
}
if ('[[TAGS]]' === $placeholder) { if ('[[TAGS]]' === $placeholder) {
return $part->getTags(); return $part->getTags();
} }