diff --git a/app/View/Label.php b/app/View/Label.php index de955afff..99da44982 100644 --- a/app/View/Label.php +++ b/app/View/Label.php @@ -88,7 +88,7 @@ class Label implements View if ($template->getSupportTitle()) { $title = !empty($settings->label2_title) ? - str_ireplace(':company', $asset->company->name, $settings->label2_title) : + str_ireplace('{COMPANY}', $asset->company->name, $settings->label2_title) : $settings->qr_text; if (!empty($title)) $assetData->put('title', $title); } diff --git a/composer.json b/composer.json index bb9acd9b1..20d76a1d9 100644 --- a/composer.json +++ b/composer.json @@ -70,7 +70,7 @@ "spatie/laravel-backup": "^6.16", "symfony/polyfill-mbstring": "^1.22", "tecnickcom/tc-lib-barcode": "^1.15", - "tecnickcom/tcpdf": "^6.5.0", + "tecnickcom/tcpdf": "^6.5", "unicodeveloper/laravel-password": "^1.0", "watson/validating": "^6.1" }, diff --git a/composer.lock b/composer.lock index 46cb36476..6221937a3 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ba3150255e8c263677ad9bc203852fb0", + "content-hash": "f30d1bebf56af36eb55a56d093b54650", "packages": [ { "name": "alek13/slack", @@ -11378,6 +11378,78 @@ ], "time": "2022-06-14T09:09:40+00:00" }, + { + "name": "tecnickcom/tcpdf", + "version": "6.6.2", + "source": { + "type": "git", + "url": "https://github.com/tecnickcom/TCPDF.git", + "reference": "e3cffc9bcbc76e89e167e9eb0bbda0cab7518459" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tecnickcom/TCPDF/zipball/e3cffc9bcbc76e89e167e9eb0bbda0cab7518459", + "reference": "e3cffc9bcbc76e89e167e9eb0bbda0cab7518459", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "config", + "include", + "tcpdf.php", + "tcpdf_parser.php", + "tcpdf_import.php", + "tcpdf_barcodes_1d.php", + "tcpdf_barcodes_2d.php", + "include/tcpdf_colors.php", + "include/tcpdf_filters.php", + "include/tcpdf_font_data.php", + "include/tcpdf_fonts.php", + "include/tcpdf_images.php", + "include/tcpdf_static.php", + "include/barcodes/datamatrix.php", + "include/barcodes/pdf417.php", + "include/barcodes/qrcode.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-only" + ], + "authors": [ + { + "name": "Nicola Asuni", + "email": "info@tecnick.com", + "role": "lead" + } + ], + "description": "TCPDF is a PHP class for generating PDF documents and barcodes.", + "homepage": "http://www.tcpdf.org/", + "keywords": [ + "PDFD32000-2008", + "TCPDF", + "barcodes", + "datamatrix", + "pdf", + "pdf417", + "qrcode" + ], + "support": { + "issues": "https://github.com/tecnickcom/TCPDF/issues", + "source": "https://github.com/tecnickcom/TCPDF/tree/6.6.2" + }, + "funding": [ + { + "url": "https://www.paypal.com/cgi-bin/webscr?cmd=_donations¤cy_code=GBP&business=paypal@tecnick.com&item_name=donation%20for%20tcpdf%20project", + "type": "custom" + } + ], + "time": "2022-12-17T10:28:59+00:00" + }, { "name": "tijsverkoyen/css-to-inline-styles", "version": "2.2.4", @@ -16664,5 +16736,5 @@ "ext-pdo": "*" }, "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.0.0" } diff --git a/resources/lang/en/admin/settings/general.php b/resources/lang/en/admin/settings/general.php index 9c038a87b..a3b64996d 100644 --- a/resources/lang/en/admin/settings/general.php +++ b/resources/lang/en/admin/settings/general.php @@ -336,7 +336,7 @@ return [ 'label2_template_help' => 'Select which template to use for label generation', 'label2_title' => 'Title', 'label2_title_help' => 'The title to show on labels that support it', - 'label2_title_help_phold' => 'The placeholder :company will be replaced with the asset's company name', + 'label2_title_help_phold' => 'The placeholder {COMPANY} will be replaced with the asset's company name', 'label2_asset_logo' => 'Use Asset Logo', 'label2_asset_logo_help' => 'Use the logo of the asset's assigned company, rather than the value at :setting_name', 'label2_1d_type' => '1D Barcode Type', diff --git a/resources/views/settings/labels.blade.php b/resources/views/settings/labels.blade.php index b61794c9e..32dda8118 100644 --- a/resources/views/settings/labels.blade.php +++ b/resources/views/settings/labels.blade.php @@ -25,44 +25,48 @@ {{csrf_field()}}
-
+

{{ trans('admin/settings/general.labels') }} -

+
-
+
-{{--
has('label2_enable') ? 'error' : '' }}">--}} -{{--
--}} -{{--
+
@if ($setting->label2_enable) -
+
- {{ Form::label('label2_template', trans('admin/settings/general.label2_template')) }} @include('partials.label2-preview')
@@ -98,9 +102,9 @@
-
-
- {{ Form::label('label2_title', trans('admin/settings/general.label2_title')) }} +
+
+ {{ Form::label('label2_title', trans('admin/settings/general.label2_title'), ['class'=>'control-label']) }}
{{ Form::text('label2_title', old('label2_title', $setting->label2_title), [ 'class'=>'form-control', 'placeholder'=>$setting->qr_text, 'aria-label'=>'label2_title' ]) }} @@ -119,22 +123,24 @@
-
-
- {{ Form::label('label2_asset_logo', trans('admin/settings/general.label2_asset_logo')) }} -
-
- {{ Form::checkbox('label2_asset_logo', '1', old('label2_asset_logo', $setting->label2_asset_logo, [ 'class'=>'minimal', 'aria-label'=>'label2_asset_logo' ])) }} - {{ trans('general.yes') }} - {!! $errors->first('label2_asset_logo', '') !!} -

{!! trans('admin/settings/general.label2_asset_logo_help', ['setting_name' => trans('admin/settings/general.brand').' > '.trans('admin/settings/general.label_logo')]) !!}

+
has('label2_asset_logo') ? 'error' : '' }}"> +
+ + +

+ {!! trans('admin/settings/general.label2_asset_logo_help', ['setting_name' => trans('admin/settings/general.brand').' > '.trans('admin/settings/general.label_logo')]) !!} +

+
- +
-
- {{ Form::label('label2_1d_type', trans('admin/settings/general.label2_1d_type')) }} +
+ {{ Form::label('label2_1d_type', trans('admin/settings/general.label2_1d_type'), ['class'=>'control-label']) }}
@php @@ -153,7 +159,7 @@ {!! $errors->first('label2_1d_type', '') !!}

{{ trans('admin/settings/general.label2_1d_type_help') }}. - {!! + {!! trans('admin/settings/general.help_default_will_use', [ 'default' => trans('admin/settings/general.default'), 'setting_name' => trans('admin/settings/general.barcodes').' > '.trans('admin/settings/general.alt_barcode_type'), @@ -162,11 +168,11 @@

- +
-
- {{ Form::label('label2_2d_type', trans('admin/settings/general.label2_2d_type')) }} +
+ {{ Form::label('label2_2d_type', trans('admin/settings/general.label2_2d_type'), ['class'=>'control-label']) }}
@php @@ -182,7 +188,7 @@ {!! $errors->first('label2_2d_type', '') !!}

{{ trans('admin/settings/general.label2_2d_type_help', ['current' => $setting->barcode_type]) }}. - {!! + {!! trans('admin/settings/general.help_default_will_use', [ 'default' => trans('admin/settings/general.default'), 'setting_name' => trans('admin/settings/general.barcodes').' > '.trans('admin/settings/general.barcode_type'), @@ -191,11 +197,11 @@

- +
-
- {{ Form::label('label2_2d_target', trans('admin/settings/general.label2_2d_target')) }} +
+ {{ Form::label('label2_2d_target', trans('admin/settings/general.label2_2d_target'), ['class'=>'control-label']) }}
{{ Form::select('label2_2d_target', ['hardware_id'=>'/hardware/{id} ('.trans('admin/settings/general.default').')', 'ht_tag'=>'/ht/{asset_tag}'], old('label2_2d_target', $setting->label2_2d_target), [ 'class'=>'select2 col-md-4', 'aria-label'=>'label2_2d_target' ]) }} @@ -206,7 +212,7 @@
-
+
{{ Form::label('label2_fields', trans('admin/settings/general.label2_fields')) }}
@@ -217,7 +223,7 @@
@include('partials.bootstrap-table') - + @else {{ Form::hidden('label2_template', old('label2_template', $setting->label2_template)) }} @@ -251,9 +257,9 @@ @else -
-
- {{ Form::label('labels_per_page', trans('admin/settings/general.labels_per_page')) }} +
+
+ {{ Form::label('labels_per_page', trans('admin/settings/general.labels_per_page'), ['class'=>'control-label']) }}
{{ Form::text('labels_per_page', old('labels_per_page', $setting->labels_per_page), ['class' => 'form-control','style' => 'width: 100px;', 'aria-label'=>'labels_per_page']) }} @@ -261,9 +267,9 @@
-
-
- {{ Form::label('labels_fontsize', trans('admin/settings/general.labels_fontsize')) }} +
+
+ {{ Form::label('labels_fontsize', trans('admin/settings/general.labels_fontsize'), ['class'=>'control-label']) }}
@@ -276,9 +282,9 @@
-
-
- {{ Form::label('labels_width', trans('admin/settings/general.label_dimensions')) }} +
+
+ {{ Form::label('labels_width', trans('admin/settings/general.label_dimensions'), ['class'=>'control-label']) }}
@@ -298,8 +304,8 @@
-
-
+
+
{{ Form::label('labels_display_sgutter', trans('admin/settings/general.label_gutters')) }}
@@ -320,8 +326,8 @@
-
-
+
+
{{ Form::label('labels_pmargin_top', trans('admin/settings/general.page_padding')) }}
@@ -351,9 +357,9 @@
-
-
- {{ Form::label('labels_pagewidth', trans('admin/settings/general.page_dimensions')) }} +
+
+ {{ Form::label('labels_pagewidth', trans('admin/settings/general.page_dimensions'), ['class'=>'control-label']) }}
@@ -374,8 +380,8 @@
-
- {{ Form::label('labels_display', trans('admin/settings/general.label_fields')) }} +
+ {{ Form::label('labels_display', trans('admin/settings/general.label_fields'), ['class' => 'control-label']) }}