Skip to content

Commit 7e34535

Browse files
Added Datamatrix and C93 label twigs (Part-DB#931)
* Added Datamatrix and C93 label twigs * Added new barcode placeholders to ckeditor plugin --------- Co-authored-by: Jan Böhmer <[email protected]>
1 parent 0bb831f commit 7e34535

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

assets/ckeditor/plugins/PartDBLabel/PartDBLabelUI.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ const PLACEHOLDERS = [
128128
['[[BARCODE_QR]]', 'QR code linking to this element'],
129129
['[[BARCODE_C128]]', 'Code 128 barcode linking to this element'],
130130
['[[BARCODE_C39]]', 'Code 39 barcode linking to this element'],
131+
['[[BARCODE_C93]]', 'Code 93 barcode linking to this element'],
132+
['[[BARCODE_DATAMATRIX]]', 'Datamatrix code linking to this element'],
131133
]
132134
},
133135
{

assets/ckeditor/plugins/PartDBLabel/lang/de.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ Object.assign( window.CKEDITOR_TRANSLATIONS[ 'de' ].dictionary, {
6969
'QR code linking to this element': 'QR Code verknüpft mit diesem Element',
7070
'Code 128 barcode linking to this element': 'Code 128 Barcode verknüpft mit diesem Element',
7171
'Code 39 barcode linking to this element': 'Code 39 Barcode verknüpft mit diesem Element',
72+
'Code 93 barcode linking to this element': 'Code 93 Barcode verknüpft mit diesem Element',
73+
'Datamatrix code linking to this element': 'Datamatrix Code verknüpft mit diesem Element',
7274

7375
'Location ID': 'Lagerort ID',
7476
'Name': 'Name',

src/Services/LabelSystem/PlaceholderProviders/BarcodeProvider.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,24 @@ public function replace(string $placeholder, object $label_target, array $option
6363
return $this->barcodeGenerator->generateHTMLBarcode($label_options, $label_target);
6464
}
6565

66+
if ('[[BARCODE_DATAMATRIX]]' === $placeholder) {
67+
$label_options = new LabelOptions();
68+
$label_options->setBarcodeType(BarcodeType::DATAMATRIX);
69+
return $this->barcodeGenerator->generateHTMLBarcode($label_options, $label_target);
70+
}
71+
6672
if ('[[BARCODE_C39]]' === $placeholder) {
6773
$label_options = new LabelOptions();
6874
$label_options->setBarcodeType(BarcodeType::CODE39);
6975
return $this->barcodeGenerator->generateHTMLBarcode($label_options, $label_target);
7076
}
7177

78+
if ('[[BARCODE_C93]]' === $placeholder) {
79+
$label_options = new LabelOptions();
80+
$label_options->setBarcodeType(BarcodeType::CODE93);
81+
return $this->barcodeGenerator->generateHTMLBarcode($label_options, $label_target);
82+
}
83+
7284
if ('[[BARCODE_C128]]' === $placeholder) {
7385
$label_options = new LabelOptions();
7486
$label_options->setBarcodeType(BarcodeType::CODE128);

0 commit comments

Comments
 (0)