Skip to content

A free open source IT asset/license management system

Merge branch 'develop' into Label_customization

Godfrey Md739edc9e8dd
diff --cc app/Models/Labels/DefaultLabel.php
index 907e7045cf,732bf0a340..d77eff261e
--- a/app/Models/Labels/DefaultLabel.php
+++ b/app/Models/Labels/DefaultLabel.php
@@@ -228,34 -193,6 +228,32 @@@ class DefaultLabel extends RectangleShe
return true;
}
+ protected function getContentEditorConfig(): array
+ {
+ return [
+ 'text_font_size' => $this->getTextSize(),
+ 'text_margin' => $this->getTextMargin(),
+ 'barcode_1d_size' => $this->getBarcode1DSize(),
+ 'barcode_2d_size' => $this->getBarcode2DSize(),
+ 'barcode_2d_margin' => $this->getBarcode2DMargin(),
+ 'logo_width' => $this->getLogoSize()[0],
+ 'logo_height' => $this->getLogoSize()[1],
+ 'logo_margin' => $this->getLogoMargin(),
+ ];
+ }
+
+ 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 --cc app/Models/Labels/Sheets/Avery/L4736_A.php
index c38fed86fe,28ba55830c..44f0bd81cd
--- a/app/Models/Labels/Sheets/Avery/L4736_A.php
+++ b/app/Models/Labels/Sheets/Avery/L4736_A.php
@@@ -117,37 -73,6 +117,35 @@@ class L4736_A extends L473
return true;
}
+ protected function getContentEditorConfig(): array
+ {
+ return [
+ 'barcode_margin' => $this->getBarcodeMargin(),
+ 'barcode_2d_size' => 15,
+ 'tag_font_size' => $this->getTagSize(),
+ 'title_font_size' => $this->getTitleSize(),
+ 'title_margin' => $this->getTitleMargin(),
+ 'title_position' => 'top',
+ 'title_offset_x' => 7,
+ 'field_label_font_size' => 1.8,
+ 'field_label_margin' => $this->getLabelMargin(),
+ 'field_value_font_size' => 2.8,
+ '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)
{
$pa = $this->getLabelPrintableArea();
diff --cc app/Models/Labels/Tapes/Brother/TZe_18mm_A.php
index 1128e0fec7,cd113ca952..56f829ac68
--- a/app/Models/Labels/Tapes/Brother/TZe_18mm_A.php
+++ b/app/Models/Labels/Tapes/Brother/TZe_18mm_A.php
@@@ -64,21 -50,6 +64,19 @@@ class TZe_18mm_A extends TZe_18m
return false;
}
+ protected function getContentEditorConfig(): array
+ {
+ return [
+ 'barcode_size' => $this->getBarcodeSize(),
+ 'barcode_margin' => $this->getBarcodeMargin(),
+ 'text_size_mod' => $this->getTextSizeMod(),
+ 'tag_font_size' => 5.5,
+ 'field_value_font_size' => 5.5,
+ 'field_label_font_size' => 0.1,
+ 'tag_offset_y' => -3,
+ ];
+ }
+
- public function preparePDF($pdf) {}
-
public function write($pdf, $record)
{
$pa = $this->getPrintableArea();
diff --cc app/Models/Labels/Tapes/Brother/TZe_241.php
index 564c8b5215,1abbf3e099..d17b69a6bc
--- a/app/Models/Labels/Tapes/Brother/TZe_241.php
+++ b/app/Models/Labels/Tapes/Brother/TZe_241.php
@@@ -54,40 -52,6 +54,39 @@@ class TZe_241 extends TZe_18m
return false;
}
+ 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;
+ }
+
+ protected function getContentEditorConfig(): array
+ {
+ return [
+ 'field_label_font_size' => 4,
+ 'field_label_margin' => $this->getLabelMargin(),
+
+ 'field_value_font_size' => 4,
+ 'field_value_margin' => -2.2,
+
+ 'text_render_mode' => 'block',
+ ];
+ }
- public function preparePDF($pdf) {}
+
public function write($pdf, $record)
{
$pa = $this->getPrintableArea();
diff --cc app/Models/Labels/Tapes/Brother/TZe_24mm_A.php
index aebe626664,0cdeb79e70..3fedb3fafc
--- a/app/Models/Labels/Tapes/Brother/TZe_24mm_A.php
+++ b/app/Models/Labels/Tapes/Brother/TZe_24mm_A.php
@@@ -99,33 -60,6 +99,32 @@@ class TZe_24mm_A extends TZe_24m
return true;
}
+ public function getTextRenderMode(): string
+ {
+ return 'vertical_stack';
+ }
+
+ protected function getContentEditorConfig(): array
+ {
+ return [
+ 'barcode_margin' => $this->getBarcodeMargin(),
+ 'barcode_2d_size' => 15,
+
+ 'tag_font_size' => $this->getTagSize(),
+ 'tag_offset_x' => 2,
+
+ '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(),
+ 'text_render_mode' => $this->getTextRenderMode(),
+ ];
+ }
- public function preparePDF($pdf) {}
+
public function write($pdf, $record)
{
$pa = $this->getPrintableArea();
diff --cc app/Models/Labels/Tapes/Brother/TZe_24mm_B.php
index 08268d5177,0119d5ba41..3dba28c04a
--- a/app/Models/Labels/Tapes/Brother/TZe_24mm_B.php
+++ b/app/Models/Labels/Tapes/Brother/TZe_24mm_B.php
@@@ -113,34 -64,6 +113,32 @@@ class TZe_24mm_B extends TZe_24m
return true;
}
- public function preparePDF($pdf) {}
-
+ protected function getContentEditorConfig(): array
+ {
+ return [
+ 'barcode_margin' => $this->getBarcodeMargin(),
+ 'barcode_2d_size' => 14,
+
+ 'tag_font_size' => $this->getTagSize(),
+ 'tag_offset_x' => 2,
+
+ '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' => 'L',
+ 'logo_h_align' => 'R',
+ 'text_render_mode' => 'vertical_stack',
+ ];
+ }
public function write($pdf, $record)
{
$pa = $this->getPrintableArea();
diff --cc app/Models/Labels/Tapes/Brother/TZe_24mm_C.php
index 4e0d415cd6,cbc61a2032..502fd372dc
--- a/app/Models/Labels/Tapes/Brother/TZe_24mm_C.php
+++ b/app/Models/Labels/Tapes/Brother/TZe_24mm_C.php
@@@ -114,33 -52,6 +114,32 @@@ class TZe_24mm_C extends TZe_24m
return false;
}
+ protected function getContentEditorConfig(): array
+ {
+ return [
+ 'barcode_margin' => $this->getBarcodeMargin(),
+ 'barcode_2d_size' => 12,
+
+ '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' => 'L',
+ 'logo_h_align' => 'R',
+ 'text_render_mode' => 'block',
+ ];
+ }
- public function preparePDF($pdf) {}
+
public function write($pdf, $record)
{
$pa = $this->getPrintableArea();
diff --cc app/Models/Labels/Tapes/Brother/TZe_24mm_D.php
index 46a000d63c,fad17c6c66..b428ffa13b
--- a/app/Models/Labels/Tapes/Brother/TZe_24mm_D.php
+++ b/app/Models/Labels/Tapes/Brother/TZe_24mm_D.php
@@@ -107,36 -60,6 +107,34 @@@ class TZe_24mm_D extends TZe_24m
return true;
}
+ protected function getContentEditorConfig(): array
+ {
+ return [
+ 'barcode_size' => 3,
+ 'barcode_2d_size' => 11,
+ 'barcode_margin' => .4,
+ 'barcode1D_v_align' => $this->getBarcode1DVAlign(),
+ 'tag_font_size' => $this->getTagSize(),
+ 'tag_font' => 'freemono',
+
+ 'title_font_size' => $this->getTitleSize(),
+ 'title_margin' => $this->getTitleMargin(),
+ 'title_font' => 'freemono',
+
+ 'field_label_font_size' => $this->getLabelSize(),
+ 'field_label_margin' => $this->getLabelMargin(),
+ 'field_label_font' => 'freemono',
+
+ 'field_value_font_size' => $this->getFieldSize(),
+ 'field_value_margin' => $this->getFieldMargin(),
+ 'field_value_font' => 'freemono',
+
+ 'tag_alignment' => 'L',
+ 'logo_h_align' => 'R',
+ 'text_render_mode' => 'block',
+ ];
+ }
+
- public function preparePDF($pdf) {}
-
public function write($pdf, $record)
{
$pa = $this->getPrintableArea();
diff --cc app/Models/Labels/Tapes/Brother/TZe_24mm_E.php
index 3996505804,6377443a96..9f38ec6904
--- a/app/Models/Labels/Tapes/Brother/TZe_24mm_E.php
+++ b/app/Models/Labels/Tapes/Brother/TZe_24mm_E.php
@@@ -109,41 -67,6 +109,39 @@@ class TZe_24mm_E extends TZe_24m
return true;
}
+ protected function getContentEditorConfig(): array
+ {
+ return [
+ 'barcode_margin' => $this->getBarcodeMargin(),
+ 'barcode1D_placement' => 'text_column',
+ 'barcode_size' => 2,
+ 'barcode2D_h_align' => 'L',
+ 'barcode2D_v_align' => 'T',
+
+ 'tag_font_size' => $this->getTagSize(),
+
+ 'title_font_size' => $this->getTitleSize(),
+ 'title_margin' => .5,
+ 'title_font' => 'freesans',
+
+ 'field_label_font_size' => 2,
+ 'field_label_margin' => $this->getLabelMargin(),
+ 'field_label_font' => 'freesans',
+
+ 'field_value_font_size' => 1.8,
+ 'field_value_margin' => -1.85,
+ 'field_value_font' => 'freemono',
+
+ 'tag_offset_y' => 2.5,
+ 'tag_alignment' => 'L',
+ 'tag_position_mode' => 'under_barcode',
+ 'tag_font' => 'freesans',
+ 'logo_h_align' => 'R',
+ 'text_render_mode' => 'block',
+ 'text_area_offset_y' => 2.0,
+ ];
+ }
+
- public function preparePDF($pdf) {}
-
public function write($pdf, $record)
{
$pa = $this->getPrintableArea();
diff --cc app/Models/Labels/Tapes/Brother/TZe_62mm_Landscape_A.php
index 3d78aac705,92c6ff632c..47d3e13765
--- a/app/Models/Labels/Tapes/Brother/TZe_62mm_Landscape_A.php
+++ b/app/Models/Labels/Tapes/Brother/TZe_62mm_Landscape_A.php
@@@ -70,114 -70,6 +70,106 @@@ class TZe_62mm_Landscape_A extends TZe_
private const FIELD_MARGIN = 0.10;
+ public function getBarcodeSize(): float
+ {
+ return self::BARCODE1D_HEIGHT;
+ }
+
+ public function getBarcodeMargin(): float
+ {
+ return self::BARCODE1D_MARGIN;
+ }
+
+ public function get2DBarcodeSize(): float
+ {
+ return self::BARCODE2D_SIZE;
+ }
+
+ public function getBarcode2DMargin(): float
+ {
+ return self::BARCODE2D_MARGIN;
+ }
+
+ public function getTagSize(): float
+ {
+ return self::TAG_SIZE;
+ }
+
+ public function getLogoMaxHeight(): float
+ {
+ return self::LOGO_HEIGHT;
+ }
+
+ 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 getRotation()
- // {
- // return 90;
- // }
-
-
-
+ protected function getContentEditorConfig(): array
+ {
+ return [
+ 'barcode_size' => $this->getBarcodeSize(),
+ 'barcode_margin' => $this->getBarcodeMargin(),
+ 'barcode1D_v_align' => 'T',
+
+ 'barcode_2d_size' => $this->get2DBarcodeSize(),
+ 'barcode_2d_margin' => $this->getBarcode2DMargin(),
+ 'barcode2D_h_align' => 'L',
+ 'barcode2D_v_align' => 'T',
+
+ 'tag_font_size' => $this->getTagSize(),
+ 'tag_alignment' => 'C',
+ 'tag_position_mode' => 'under_barcode',
+
+ 'logo_max_height' => $this->getLogoMaxHeight(),
+ 'logo_margin' => $this->getLogoMargin(),
+ 'logo_h_align' => 'L',
+ 'logo_v_align' => 'T',
+ "logo_placement" => 'text_column',
+
+ '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(),
+
+ 'text_render_mode' => 'block',
+ ];
+ }
- public function preparePDF($pdf) {}
+
public function write($pdf, $record)
{
$pa = $this->getPrintableArea();
diff --cc app/Models/Labels/Tapes/Dymo/LabelWriter_11354.php
index 029e1a00ee,9eaf6898e2..680d123ef1
--- a/app/Models/Labels/Tapes/Dymo/LabelWriter_11354.php
+++ b/app/Models/Labels/Tapes/Dymo/LabelWriter_11354.php
@@@ -69,84 -67,6 +69,83 @@@ class LabelWriter_11354 extends LabelWr
return true;
}
+ public function getBarcodeSize(): float
+ {
+ return self::BARCODE1D_HEIGHT;
+ }
+
+ 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;
+ }
+
+ protected function getContentEditorConfig(): array
+ {
+ return [
+ 'barcode_size' => $this->getBarcodeSize(),
+ 'barcode_margin' => $this->getBarcodeMargin(),
+ 'barcode1D_v_align' => 'T',
+
+ 'barcode_2d_size' => 19.0,
+ 'barcode2D_h_align' => 'L',
+ 'barcode2D_v_align' => 'T',
+
+ 'tag_font_size' => $this->getTagSize(),
+ 'tag_alignment' => 'C',
+ 'tag_position_mode' => 'under_barcode',
+ 'tag_font' => 'freesans',
+
+ 'title_font_size' => 3.8,
+ 'title_margin' => $this->getTitleMargin(),
+ 'title_font' => 'freesans',
+
+ 'field_label_font_size' => $this->getLabelSize(),
+ 'field_label_margin' => $this->getLabelMargin(),
+ 'field_label_font' => 'freesans',
+
+ 'field_value_font_size' => $this->getFieldSize(),
+ 'field_value_margin' => $this->getFieldMargin(),
+ 'field_value_font' => 'freemono',
+
+ 'text_render_mode' => 'block',
+ ];
+ }
- public function preparePDF($pdf) {}
+
public function write($pdf, $record)
{
$pa = $this->getPrintableArea();
diff --cc app/Models/Labels/Tapes/Dymo/LabelWriter_2112284.php
index 31a712ef80,181cc2cd93..b1e9d04012
--- a/app/Models/Labels/Tapes/Dymo/LabelWriter_2112284.php
+++ b/app/Models/Labels/Tapes/Dymo/LabelWriter_2112284.php
@@@ -68,48 -67,6 +69,45 @@@ class LabelWriter_2112284 extends Label
return true;
}
+ protected function getContentEditorConfig(): array
+ {
+ return [
+
+ 'barcode_size' => self::TAG_SIZE,
+ 'barcode_margin' => self::BARCODE_MARGIN,
+
+ 'barcode1D_v_align' => 'B',
+ 'barcode1D_placement' => 'text_column',
+
+
+ 'barcode_2d_size' => $this->getPrintableArea()->h - self::TAG_SIZE,
+ 'barcode2D_h_align' => 'L',
+ 'barcode2D_v_align' => 'T',
+
+
+ 'tag_font_size' => self::TAG_SIZE,
+ 'tag_alignment' => 'C',
+ 'tag_position_mode' => 'under_barcode',
+ 'tag_font' => 'freesans',
+
+
+ 'title_font_size' => self::TITLE_SIZE,
+ 'title_margin' => self::TITLE_MARGIN,
+ 'title_font' => 'freesans',
+
+
+ 'field_label_font_size' => self::LABEL_SIZE,
+ 'field_label_margin' => self::LABEL_MARGIN,
+ 'field_label_font' => 'freesans',
+
+ 'field_value_font_size' => self::FIELD_SIZE,
+ 'field_value_margin' => self::FIELD_MARGIN,
+ 'field_value_font' => 'freemono',
+
+ 'text_render_mode' => 'block',
+ ];
+ }
- public function preparePDF($pdf)
- {
- }
+
public function write($pdf, $record)
{
$pa = $this->getPrintableArea();
diff --cc app/Models/Labels/Tapes/Dymo/LabelWriter_30252.php
index c680210ba6,9e3641ded1..7a17e82fc7
--- a/app/Models/Labels/Tapes/Dymo/LabelWriter_30252.php
+++ b/app/Models/Labels/Tapes/Dymo/LabelWriter_30252.php
@@@ -60,42 -60,6 +60,40 @@@ class LabelWriter_30252 extends LabelWr
return true;
}
+ protected function getContentEditorConfig(): array
+ {
+ return [
+ 'barcode_size' => self::TAG_SIZE,
+ 'barcode_margin' => self::BARCODE_MARGIN,
+
+ 'barcode1D_v_align' => 'B',
+ 'barcode1D_placement' => 'text_column',
+
+ 'barcode_2d_size' => $this->getPrintableArea()->h - self::TAG_SIZE,
+ 'barcode2D_h_align' => 'L',
+ 'barcode2D_v_align' => 'T',
+
+ 'tag_font_size' => self::TAG_SIZE,
+ 'tag_alignment' => 'C',
+ 'tag_position_mode' => 'under_barcode',
+ 'tag_font' => 'freemono',
+
+ 'title_font_size' => self::TITLE_SIZE,
+ 'title_margin' => self::TITLE_MARGIN,
+ 'title_font' => 'freesans',
+
+ 'field_label_font_size' => self::LABEL_SIZE,
+ 'field_label_margin' => self::LABEL_MARGIN,
+ 'field_label_font' => 'freesans',
+
+ 'field_value_font_size' => self::FIELD_SIZE,
+ 'field_value_margin' => self::FIELD_MARGIN,
+ 'field_value_font' => 'freemono',
+
+ 'text_render_mode' => 'vertical_stack',
+ ];
+ }
+
- public function preparePDF($pdf) {}
-
public function write($pdf, $record)
{
$pa = $this->getPrintableArea();
diff --cc app/Models/Labels/Tapes/Generic/Continuous_53mm_A.php
index 0b0d023871,6a57b393bf..9dc8cf3dac
--- a/app/Models/Labels/Tapes/Generic/Continuous_53mm_A.php
+++ b/app/Models/Labels/Tapes/Generic/Continuous_53mm_A.php
@@@ -39,65 -41,7 +41,65 @@@ class Continuous_53mm_A extends Continu
return true;
}
+ public function getBarcodeMargin(): float
+ {
+ return $this->barcodeMargin;
+ }
+
+ public function getTitleSize(): float
+ {
+ return $this->titleSize;
+ }
+
+ public function getTitleMargin(): float
+ {
+ return $this->titleMargin;
+ }
+
+ public function getLabelSize(): float
+ {
+ return $this->labelSize;
+ }
+
+ public function getLabelMargin(): float
+ {
+ return $this->labelMargin;
+ }
+
+ public function getFieldSize(): float
+ {
+ return $this->fieldSize;
+ }
+
+ public function getFieldMargin(): float
+ {
+ return $this->fieldMargin;
+ }
+
+ protected function getContentEditorConfig(): array
+ {
+ return [
+ 'barcode_2d_size' => 32.0,
+ 'barcode2D_v_align' => 'T',
+ 'barcode2D_placement' => 'stacked',
+
+ 'barcode_margin' => $this->barcodeMargin,
+
+ 'title_font_size' => $this->titleSize,
+ 'title_margin' => $this->titleMargin,
+ 'title_offset_x' => 8,
+
+ 'field_label_font_size' => $this->labelSize,
+ 'field_label_margin' => $this->labelMargin,
+
+ 'field_value_font_size' => $this->fieldSize,
+ 'field_value_margin' => $this->fieldMargin,
+
+ 'text_render_mode' => 'vertical_stack',
+ ];
+ }
+
- public function preparePDF($pdf)
+ public function preparePDF(TCPDF $pdf): void
{
$pdf->SetAutoPageBreak(false);
}
diff --cc app/Models/Labels/Tapes/Generic/Continuous_Landscape_0_59in_A.php
index 7fb67dd7c6,24e3d26600..3e4af60ead
--- a/app/Models/Labels/Tapes/Generic/Continuous_Landscape_0_59in_A.php
+++ b/app/Models/Labels/Tapes/Generic/Continuous_Landscape_0_59in_A.php
@@@ -39,62 -41,7 +41,62 @@@ class Continuous_Landscape_0_59in_A ext
return false;
}
- public function preparePDF(TCPDF $pdf): void
+ public function getBarcodeMargin(): float
+ {
+ return $this->barcodeMargin;
+ }
+
+ public function getLabelSize(): float
+ {
+ return $this->labelSize;
+ }
+
+ public function getLabelMargin(): float
+ {
+ return $this->labelMargin;
+ }
+
+ public function getFieldSize(): float
+ {
+ return $this->fieldSize;
+ }
+
+ public function getFieldMargin(): float
+ {
+ return $this->fieldMargin;
+ }
+
+ public function getWidth(): float
+ {
+ return 2.0;
+ }
+
+ public function getHeight(): float
+ {
+ return .59;
+ }
+
+ protected function getContentEditorConfig(): array
+ {
+ return [
+ 'barcode_2d_size' => 12.0,
+ 'barcode2D_h_align' => 'L',
+ 'barcode2D_v_align' => 'T',
+
+ 'barcode_margin' => $this->getBarcodeMargin(),
+
+ 'field_label_font_size' => $this->getLabelSize(),
+ 'field_label_margin' => $this->getLabelMargin(),
+
+ 'field_value_font_size' => $this->getFieldSize(),
+ 'field_value_margin' => $this->getFieldMargin(),
+
+ 'text_render_mode' => 'vertical_stack',
+ ];
+ }
+
+
- public function preparePDF($pdf)
++ public function preparePDF(TCPDF $pdf) : void
{
$pdf->SetAutoPageBreak(false);
}
diff --cc app/Models/Labels/Tapes/Generic/Tape_53mm_A.php
index ee563f43e8,277fa522b7..780f03b124
--- a/app/Models/Labels/Tapes/Generic/Tape_53mm_A.php
+++ b/app/Models/Labels/Tapes/Generic/Tape_53mm_A.php
@@@ -44,64 -46,7 +46,64 @@@ class Tape_53mm_A extends Tape_53m
return true;
}
+ public function getBarcodeMargin(): float
+ {
+ return $this->barcodeMargin;
+ }
+
+ public function getTitleSize(): float
+ {
+ return $this->titleSize;
+ }
+
+ public function getTitleMargin(): float
+ {
+ return $this->titleMargin;
+ }
+
+ public function getLabelSize(): float
+ {
+ return $this->labelSize;
+ }
+
+ public function getLabelMargin(): float
+ {
+ return $this->labelMargin;
+ }
+
+ public function getFieldSize(): float
+ {
+ return $this->fieldSize;
+ }
+
+ public function getFieldMargin(): float
+ {
+ return $this->fieldMargin;
+ }
+
+ protected function getContentEditorConfig(): array
+ {
+ return [
+ 'barcode_2d_size' => 27.0,
+ 'barcode2D_v_align' => 'T',
+ 'barcode2D_placement' => 'stacked',
+
+ 'barcode_margin' => $this->getBarcodeMargin(),
+
+ 'title_font_size' => $this->getTitleSize(),
+ 'title_margin' => $this->getTitleMargin(),
+ 'title_offset_x' => '7',
+
+ 'field_label_font_size' => $this->getLabelSize(),
+ 'field_label_margin' => $this->getLabelMargin(),
+
+ 'field_value_font_size' => $this->getFieldSize(),
+ 'field_value_margin' => $this->getFieldMargin(),
+
+ 'text_render_mode' => 'vertical_stack',
+ ];
+ }
- public function preparePDF($pdf)
+ public function preparePDF(TCPDF $pdf): void
{
$pdf->SetAutoPageBreak(false);
}
diff --cc resources/assets/js/snipeit.js
index 5be1046894,b0665aec37..ea1f9a04e9
--- a/resources/assets/js/snipeit.js
+++ b/resources/assets/js/snipeit.js
@@@ -280,8 -280,61 +280,61 @@@ $(function ()
$modal.modal('show');
});
+ // Request-item modal (on /account/requestable-assets). Trigger
+ // buttons carry data-request-url + data-item-name + data-current-qty
+ // so the modal can post to the correct endpoint and reset its
+ // qty/date fields between opens. Cancel case (the item is already
+ // requested by this user) POSTs synchronously via a small inline
+ // form on the row instead of routing through this modal, so a
+ // requested row never opens it.
+ $el.on('click', '.request-item', function () {
+ var $btn = $(this);
+ var $modal = $('#requestItemModal');
+ var $form = $('#requestItemForm');
+
+ $form.attr('action', $btn.data('request-url'));
+ $modal.find('.request-item-name').text($btn.data('item-name') || '');
+
+ var currentQty = parseInt($btn.data('current-qty'), 10);
+ $modal.find('#requestItemQuantity').val(!isNaN(currentQty) && currentQty > 0 ? currentQty : 1);
+
+ // Hide the qty row for types where qty is meaningless.
+ // Assets are 1:1 (you request THE asset, not N of it).
+ // Licenses are one-seat-per-request by convention (nobody
+ // realistically asks for 3 seats of Photoshop for
+ // themselves). The input stays in the DOM with value=1 so
+ // the POST shape stays uniform across every requestable
+ // type; only the row is display:none.
+ var itemType = ($btn.data('item-type') || '').toString().toLowerCase();
+ var hidesQty = itemType === 'asset' || itemType === 'license';
+ $modal.find('#requestItemQuantityRow').toggle(!hidesQty);
+ if (hidesQty) {
+ $modal.find('#requestItemQuantity').val(1);
+ }
+
+ // Reset dates + notes every open so state left in the modal
+ // by an earlier click can't leak into the next request.
+ $modal.find('#requestItemStartDate').val('');
+ $modal.find('#requestItemEndDate').val('');
+ $modal.find('#requestItemNotes').val('');
+
+ // Snapshot the tab the requester is on so the controller can
+ // restore it on the post-submit redirect. Walks up to the
+ // enclosing .tab-pane and reads its id; the assets tab uses
+ // an API-backed row-formatter that emits the same
+ // data-active-tab attr on its request button (see
+ // assetRequestActionsFormatter) so this handler works there
+ // too without needing the DOM parent.
+ var explicitTab = $btn.data('active-tab');
+ var $tabPane = $btn.closest('.tab-pane');
+ var activeTab = explicitTab || ($tabPane.length ? $tabPane.attr('id') : '');
+ $modal.find('#requestItemActiveTab').val(activeTab || '');
+
+ $modal.modal('show');
+ });
+
// confirm delete modal
- $el.on('click', '.delete-asset', function (evnt) {
+ $el.on('click', '.delete-asset, .delete-custom-label', function (evnt) {
var $context = $(this);
var $dataConfirmModal = $('#dataConfirmModal');
// Anchors keep the URL in href; buttons keep it in data-href