Skip to content

A free open source IT asset/license management system

adds methods to _5267_A, _5520_A

Godfrey Mb3b57ff28b51
diff --git a/app/Models/Labels/Sheets/Avery/_5267_A.php b/app/Models/Labels/Sheets/Avery/_5267_A.php
index d1742a486f..cca502e38a 100644
--- a/app/Models/Labels/Sheets/Avery/_5267_A.php
+++ b/app/Models/Labels/Sheets/Avery/_5267_A.php
@@ -16,6 +16,36 @@ class _5267_A extends _5267
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 getFieldSize()
+ {
+ return self::FIELD_SIZE;
+ }
+
+ public function getFieldMargin()
+ {
+ return self::FIELD_MARGIN;
+ }
+
public function getUnit()
{
return 'in';
@@ -71,6 +101,30 @@ class _5267_A extends _5267
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(),
+ '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_A.php b/app/Models/Labels/Sheets/Avery/_5520_A.php
index e58566b681..40f1c3f5a0 100644
--- a/app/Models/Labels/Sheets/Avery/_5520_A.php
+++ b/app/Models/Labels/Sheets/Avery/_5520_A.php
@@ -20,6 +20,46 @@ class _5520_A extends _5520
private const FIELD_MARGIN = 0.012;
+ 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';
@@ -75,6 +115,32 @@ class _5520_A extends _5520
return true;
}
+ 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(),
+ ];
+ }
+
+ 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(),
+ ];
+ }
+
public function preparePDF($pdf) {}
public function write($pdf, $record)
diff --git a/routes/web.php b/routes/web.php
index 0d3653b918..bd08a8b532 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -33,7 +33,7 @@ use App\Livewire\Importer;
use App\Models\ReportTemplate;
use Illuminate\Support\Facades\Route;
use Tabuna\Breadcrumbs\Trail;
-use App\Models\Labels\Sheets\Avery\_3490_A;
+use App\Models\Labels\Sheets\Avery\_5520_A;
Route::group(['middleware' => 'auth'], function () {
/*
@@ -571,7 +571,7 @@ Route::group(['prefix' => 'reports', 'middleware' => ['auth']], function () {
->name('report-templates.destroy');
});
Route::get('/debug/label', function () {
- $label = new _3490_A();
+ $label = new _5520_A();
dd($label->toEditorConfig());
});