A free open source IT asset/license management system
adds 24mm B and C getters
Godfrey M424b5f65ec4c
diff --git a/app/Models/Labels/CustomLabels/CustomTapeLabel.php b/app/Models/Labels/CustomLabels/CustomTapeLabel.phpindex 0e5ce0b97d..81ee291c4a 100644--- a/app/Models/Labels/CustomLabels/CustomTapeLabel.php+++ b/app/Models/Labels/CustomLabels/CustomTapeLabel.php@@ -285,11 +285,16 @@ abstract class CustomTapeLabel extends Label'barcode_size' => $this->getBarcodeSize(),'barcode_margin' => $this->getBarcodeMargin(),'barcode1D_v_align' => $this->getBarcode1DVAlign(),- 'text_size_mod' => $this->getTextSizeMod(),+ 'text_size_mod' => $this->getTextSizeMod(), // needs to be combined with field size'tag_font_size' => $this->getTagSize(),+ 'field_label_font_size' => $this->getFieldSize(),'field_value_font_size' => $this->getFieldSize(),'tag_alignment' => $this->getTagAlignment(),- 'field_alignment' => $this->getFieldAlignment(),+// 'field_alignment' => $this->getFieldAlignment(),+ 'logo_max_width' => $this->getLogoMaxWidth(),+ 'logo_margin' => $this->getLogoMargin(),+ 'logo_h_align' => $this->getLogoHAlign(),+ 'logo_v_align' => $this->getLogoVAlign(),];}@@ -386,6 +391,19 @@ abstract class CustomTapeLabel extends Label}}+ $stringContentMap = [+ 'barcode2D_h_align' => 'barcode2DHAlign',+ 'barcode2D_v_align' => 'barcode2DVAlign',+ 'logo_h_align' => 'logoHAlign',+ 'logo_v_align' => 'logoVAlign',+ 'tag_alignment' => 'tagAlignment',+ ];++ foreach ($stringContentMap as $key => $property) {+ if (array_key_exists($key, $content)) {+ $this->{$property} = (string)$content[$key];+ }+ }return $this;}@@ -432,6 +450,9 @@ abstract class CustomTapeLabel extends Label$this->labelMargin = isset($content['field_label_margin']) ? (float)$content['field_label_margin'] : $this->labelMargin;$this->fieldMargin = isset($content['field_value_margin']) ? (float)$content['field_value_margin'] : $this->fieldMargin;$this->textRenderMode = isset($content['text_render_mode']) ? (string)$content['text_render_mode'] : $this->textRenderMode;+ $this->logoMargin = isset($content['logo_margin']) ? (float)$content['logo_margin'] : $this->logoMargin;+ $this->logoHAlign = isset($content['logo_h_align']) ? (string)$content['logo_h_align'] : $this->logoHAlign;+ $this->logoVAlign = isset($content['logo_v_align']) ? (string)$content['logo_v_align'] : $this->logoVAlign;}public function write($pdf, $record)diff --git a/app/Models/Labels/Tapes/Brother/TZe_24mm_B.php b/app/Models/Labels/Tapes/Brother/TZe_24mm_B.phpindex e3089ee77c..97ac63b202 100644--- a/app/Models/Labels/Tapes/Brother/TZe_24mm_B.php+++ b/app/Models/Labels/Tapes/Brother/TZe_24mm_B.php@@ -24,6 +24,55 @@ class TZe_24mm_B extends TZe_24mmprivate const FIELD_MARGIN = 0.15;+ public function getBarcodeMargin(): float+ {+ return self::BARCODE_MARGIN;+ }++ public function getTagSize(): float+ {+ return self::TAG_SIZE;+ }++ public function getLogoMaxWidth(): float+ {+ return self::LOGO_MAX_WIDTH;+ }++ public function getLogoMargin(): float+ {+ return self::LOGO_MARGIN;+ }++ public function getTitleSize(): float+ {+ return self::TITLE_SIZE;+ }++ public function getTitleMargin(): float+ {+ return self::TITLE_MARGIN;+ }++ public function getLabelSize(): float+ {+ return self::LABEL_SIZE;+ }++ public function getLabelMargin(): float+ {+ return self::LABEL_MARGIN;+ }++ public function getFieldSize(): float+ {+ return self::FIELD_SIZE;+ }++ public function getFieldMargin(): float+ {+ return self::FIELD_MARGIN;+ }public function getUnit(){return 'mm';@@ -66,6 +115,30 @@ class TZe_24mm_B extends TZe_24mmpublic function preparePDF($pdf) {}+ protected function getContentEditorConfig(): array+ {+ return [+ 'barcode_margin' => $this->getBarcodeMargin(),++ 'tag_font_size' => $this->getTagSize(),++ 'logo_max_width' => $this->getLogoMaxWidth(),+ 'logo_margin' => $this->getLogoMargin(),++ 'title_font_size' => $this->getTitleSize(),+ 'title_margin' => $this->getTitleMargin(),++ 'field_label_font_size' => $this->getLabelSize(),+ 'field_label_margin' => $this->getLabelMargin(),++ 'field_value_font_size' => $this->getFieldSize(),+ 'field_value_margin' => $this->getFieldMargin(),++ 'tag_alignment' => 'C',+ 'logo_h_align' => 'R',+ 'text_render_mode' => 'block',+ ];+ }public function write($pdf, $record){$pa = $this->getPrintableArea();diff --git a/app/Models/Labels/Tapes/Brother/TZe_24mm_C.php b/app/Models/Labels/Tapes/Brother/TZe_24mm_C.phpindex fbd541036e..ba24093655 100644--- a/app/Models/Labels/Tapes/Brother/TZe_24mm_C.php+++ b/app/Models/Labels/Tapes/Brother/TZe_24mm_C.php@@ -24,6 +24,56 @@ class TZe_24mm_C extends TZe_24mmprivate const FIELD_MARGIN = 0.15;+ public function getBarcodeMargin(): float+ {+ return self::BARCODE_MARGIN;+ }++ public function getTagSize(): float+ {+ return self::TAG_SIZE;+ }++ public function getLogoMaxWidth(): float+ {+ return self::LOGO_MAX_WIDTH;+ }++ public function getLogoMargin(): float+ {+ return self::LOGO_MARGIN;+ }++ public function getTitleSize(): float+ {+ return self::TITLE_SIZE;+ }++ public function getTitleMargin(): float+ {+ return self::TITLE_MARGIN;+ }++ public function getLabelSize(): float+ {+ return self::LABEL_SIZE;+ }++ public function getLabelMargin(): float+ {+ return self::LABEL_MARGIN;+ }++ public function getFieldSize(): float+ {+ return self::FIELD_SIZE;+ }++ public function getFieldMargin(): float+ {+ return self::FIELD_MARGIN;+ }+public function getUnit(){return 'mm';@@ -64,6 +114,30 @@ class TZe_24mm_C extends TZe_24mmreturn false;}+ protected function getContentEditorConfig(): array+ {+ return [+ 'barcode_margin' => $this->getBarcodeMargin(),++ 'tag_font_size' => $this->getTagSize(),++ 'logo_max_width' => $this->getLogoMaxWidth(),+ 'logo_margin' => $this->getLogoMargin(),++ 'title_font_size' => $this->getTitleSize(),+ 'title_margin' => $this->getTitleMargin(),++ 'field_label_font_size' => $this->getLabelSize(),+ 'field_label_margin' => $this->getLabelMargin(),++ 'field_value_font_size' => $this->getFieldSize(),+ 'field_value_margin' => $this->getFieldMargin(),++ 'tag_alignment' => 'C',+ 'logo_h_align' => 'R',+ 'text_render_mode' => 'block',+ ];+ }public function preparePDF($pdf) {}public function write($pdf, $record)