Skip to content

A free open source IT asset/license management system

adds methods to _5520B, L4736_A

Godfrey Mfbea93ed454f
diff --git a/app/Models/Labels/Sheets/Avery/L4736_A.php b/app/Models/Labels/Sheets/Avery/L4736_A.php
index 13ccabf71e..4690615bbe 100644
--- a/app/Models/Labels/Sheets/Avery/L4736_A.php
+++ b/app/Models/Labels/Sheets/Avery/L4736_A.php
@@ -22,6 +22,46 @@ class L4736_A extends L4736
private const FIELD_MARGIN = 0.20;
+ public function getBarcodeMargin()
+ {
+ return self::BARCODE_MARGIN;
+ }
+
+ public function getTagSize()
+ {
+ return self::TAG_SIZE;
+ }
+
+ public function getTitleSize()
+ {
+ return self::TITLE_SIZE;
+ }
+
+ public function getTitleMargin()
+ {
+ return self::TITLE_MARGIN;
+ }
+
+ public function getLabelSize()
+ {
+ return self::LABEL_SIZE;
+ }
+
+ public function getLabelMargin()
+ {
+ return self::LABEL_MARGIN;
+ }
+
+ public function getFieldSize()
+ {
+ return self::FIELD_SIZE;
+ }
+
+ public function getFieldMargin()
+ {
+ return self::FIELD_MARGIN;
+ }
+
public function getUnit()
{
return 'mm';
@@ -77,6 +117,32 @@ class L4736_A extends L4736
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(),
+ ];
+ }
+
+ protected function getSupportsEditorConfig(): array
+ {
+ return [
+ 'asset_tag' => $this->getSupportAssetTag(),
+ 'barcode_1d' => $this->getSupport1DBarcode(),
+ 'barcode_2d' => $this->getSupport2DBarcode(),
+ 'fields' => $this->getSupportFields(),
+ 'logo' => $this->getSupportLogo(),
+ 'title' => $this->getSupportTitle(),
+ ];
+ }
+
public function preparePDF($pdf) {}
public function write($pdf, $record)
diff --git a/app/Models/Labels/Sheets/Avery/_5520_B.php b/app/Models/Labels/Sheets/Avery/_5520_B.php
index ea35a9e750..1762e5f864 100644
--- a/app/Models/Labels/Sheets/Avery/_5520_B.php
+++ b/app/Models/Labels/Sheets/Avery/_5520_B.php
@@ -22,6 +22,50 @@ class _5520_B extends _5520
private const FIELD_MARGIN = 0.012;
+ public function getBarcodeSize()
+ {
+ return self::BARCODE_SIZE;
+ }
+
+ public function getBarcodeMargin()
+ {
+ return self::BARCODE_MARGIN;
+ }
+
+ public function getTagSize()
+ {
+ return self::TAG_SIZE;
+ }
+
+ public function getTitleSize()
+ {
+ return self::TITLE_SIZE;
+ }
+
+ public function getTitleMargin()
+ {
+ return self::TITLE_MARGIN;
+ }
+
+ public function getLabelSize()
+ {
+ return self::LABEL_SIZE;
+ }
+
+ public function getLabelMargin()
+ {
+ return self::LABEL_MARGIN;
+ }
+
+ public function getFieldSize()
+ {
+ return self::FIELD_SIZE;
+ }
+
+ public function getFieldMargin()
+ {
+ return self::FIELD_MARGIN;
+ }
public function getUnit()
{
return 'in';
@@ -77,6 +121,33 @@ class _5520_B extends _5520
return true;
}
+ protected function getContentEditorConfig(): array
+ {
+ return [
+ 'barcode_size' => $this->getBarcodeSize(),
+ '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(),
+ ];
+ }
+
+ protected function getSupportsEditorConfig(): array
+ {
+ return [
+ 'asset_tag' => $this->getSupportAssetTag(),
+ 'barcode_1d' => $this->getSupport1DBarcode(),
+ 'barcode_2d' => $this->getSupport2DBarcode(),
+ 'fields' => $this->getSupportFields(),
+ 'logo' => $this->getSupportLogo(),
+ 'title' => $this->getSupportTitle(),
+ ];
+ }
+
public function preparePDF($pdf) {}
public function write($pdf, $record)
diff --git a/routes/web.php b/routes/web.php
index bd08a8b532..4eea1244bc 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -33,7 +33,6 @@ use App\Livewire\Importer;
use App\Models\ReportTemplate;
use Illuminate\Support\Facades\Route;
use Tabuna\Breadcrumbs\Trail;
-use App\Models\Labels\Sheets\Avery\_5520_A;
Route::group(['middleware' => 'auth'], function () {
/*
@@ -571,7 +570,7 @@ Route::group(['prefix' => 'reports', 'middleware' => ['auth']], function () {
->name('report-templates.destroy');
});
Route::get('/debug/label', function () {
- $label = new _5520_A();
+ $label = new \App\Models\Labels\Sheets\Avery\L4736_A();
dd($label->toEditorConfig());
});