Skip to content

A free open source IT asset/license management system

add getters to 24mm D and E, remove previewtape from index

Godfrey M3efd1f9f6cd0
diff --git a/app/Http/Controllers/Api/LabelsController.php b/app/Http/Controllers/Api/LabelsController.php
index a769e19394..496cd11068 100644
--- a/app/Http/Controllers/Api/LabelsController.php
+++ b/app/Http/Controllers/Api/LabelsController.php
@@ -6,6 +6,7 @@ use App\Helpers\Helper;
use App\Http\Controllers\Controller;
use App\Http\Transformers\LabelsTransformer;
use App\Models\Labels\CustomLabels\PreviewSheetLabel;
+use App\Models\Labels\CustomLabels\PreviewTapeLabel;
use App\Models\Labels\CustomUserLabel;
use App\Models\Labels\Label;
use Illuminate\Http\JsonResponse;
@@ -25,6 +26,7 @@ class LabelsController extends Controller
$baseLabels = Label::find()
->reject(fn(Label $label) => $label instanceof PreviewSheetLabel)
+ ->reject(fn(Label $label) => $label instanceof PreviewTapeLabel)
->map(function (Label $label) {
return [
'source' => 'base',
diff --git a/app/Models/Labels/CustomLabels/CustomTapeLabel.php b/app/Models/Labels/CustomLabels/CustomTapeLabel.php
index 81ee291c4a..c0e31454ba 100644
--- a/app/Models/Labels/CustomLabels/CustomTapeLabel.php
+++ b/app/Models/Labels/CustomLabels/CustomTapeLabel.php
@@ -362,7 +362,7 @@ abstract class CustomTapeLabel extends Label
$contentMap = [
'barcode_size' => 'barcodeSize',
- 'barcode1D_v_align' => $this->getBarcode1DVAlign(),
+ 'barcode1D_v_align' => 'barcode1DVAlign',
'barcode_margin' => 'barcodeMargin',
'text_size_mod' => 'textSizeMod',
diff --git a/app/Models/Labels/Tapes/Brother/TZe_24mm_D.php b/app/Models/Labels/Tapes/Brother/TZe_24mm_D.php
index efc172d195..e164731c95 100644
--- a/app/Models/Labels/Tapes/Brother/TZe_24mm_D.php
+++ b/app/Models/Labels/Tapes/Brother/TZe_24mm_D.php
@@ -21,7 +21,52 @@ class TZe_24mm_D extends TZe_24mm
private const FIELD_MARGIN = 0.35;
private const BARCODE1D_SIZE = 3.00; // Size for the C128 barcode at bottom
+ private string $barcode1DVAlign = 'B';
+ public function getBarcodeMargin(): float
+ {
+ return self::BARCODE_MARGIN;
+ }
+
+ public function getTagSize(): float
+ {
+ return self::TAG_SIZE;
+ }
+
+ 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 getBarcode1DVAlign(): string
+ {
+ return $this->barcode1DVAlign;
+ }
public function getUnit()
{
return 'mm';
@@ -62,6 +107,28 @@ class TZe_24mm_D extends TZe_24mm
return true;
}
+ protected function getContentEditorConfig(): array
+ {
+ return [
+ 'barcode_margin' => $this->getBarcodeMargin(),
+ 'barcode1D_v_align' => $this->getBarcode1DVAlign(),
+ 'tag_font_size' => $this->getTagSize(),
+
+ '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)
diff --git a/app/Models/Labels/Tapes/Brother/TZe_24mm_E.php b/app/Models/Labels/Tapes/Brother/TZe_24mm_E.php
index 5dafbb094a..7ba47e07e7 100644
--- a/app/Models/Labels/Tapes/Brother/TZe_24mm_E.php
+++ b/app/Models/Labels/Tapes/Brother/TZe_24mm_E.php
@@ -24,6 +24,46 @@ class TZe_24mm_E extends TZe_24mm
private const BARCODE1D_SIZE = -2.25;
+ public function getBarcodeMargin(): float
+ {
+ return self::BARCODE_MARGIN;
+ }
+
+ public function getTagSize(): float
+ {
+ return self::TAG_SIZE;
+ }
+
+ 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';
@@ -69,6 +109,28 @@ class TZe_24mm_E extends TZe_24mm
return true;
}
+ protected function getContentEditorConfig(): array
+ {
+ return [
+ 'barcode_margin' => $this->getBarcodeMargin(),
+
+ 'tag_font_size' => $this->getTagSize(),
+
+ '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)