Merge remote-tracking branch 'origin/develop'

This commit is contained in:
snipe 2023-08-15 20:31:00 +01:00
commit 06ed8b2f2d
5 changed files with 143 additions and 65 deletions

View file

@ -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);
}

View file

@ -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"
},

76
composer.lock generated
View file

@ -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&currency_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"
}

View file

@ -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 <code>&colon;company</code> will be replaced with the asset&apos;s company name',
'label2_title_help_phold' => 'The placeholder <code>{COMPANY}</code> will be replaced with the asset&apos;s company name',
'label2_asset_logo' => 'Use Asset Logo',
'label2_asset_logo_help' => 'Use the logo of the asset&apos;s assigned company, rather than the value at <code>:setting_name</code>',
'label2_1d_type' => '1D Barcode Type',

View file

@ -25,44 +25,48 @@
{{csrf_field()}}
<div class="row">
<div class="col-sm-10 col-sm-offset-1 col-md-8 col-md-offset-2">
<div class="col-sm-10 col-sm-offset-1 col-md-10">
<div class="panel box box-default">
<div class="box-header with-border">
<h2 class="box-title">
<i class="fas fa-tags"></i> {{ trans('admin/settings/general.labels') }}
</h4>
</h2>
</div>
<div class="box-body">
<div class="col-md-11 col-md-offset-1">
<div class="col-md-12">
<!-- New Label Engine -->
{{-- <div class="form-group" {{ $errors->has('label2_enable') ? 'error' : '' }}">--}}
{{-- <div class="col-md-7 col-md-offset-3">--}}
{{-- <label for="label2_enable" class="form-control">--}}
{{-- <input type="checkbox" value="1" name="label2_enable" {{ (old('label2_enable', $setting->label2_enable)) == '1' ? ' checked="checked"' : '' }} aria-label="label2_enable">--}}
{{-- {{ Form::label('label2_enable', trans('admin/settings/general.label2_enable')) }}--}}
<div class="form-group" {{ $errors->has('label2_enable') ? 'error' : '' }}">
{{-- </label>--}}
{{-- {!! $errors->first('label2_enable', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}--}}
{{-- <p class="help-block">--}}
{{-- {!! trans('admin/settings/general.label2_enable_help') !!}--}}
{{-- </p>--}}
<div class="col-md-7 col-md-offset-3">
{{-- </div>--}}
{{-- </div>--}}
<label class="form-control">
<input type="checkbox" value="1" name="label2_enable"{{ ((old('label2_enable') == '1') || ($setting->label2_enable) == '1') ? ' checked="checked"' : '' }} aria-label="label2_enable">
{{ Form::label('label2_enable', trans('admin/settings/general.label2_enable')) }}
</label>
{!! $errors->first('label2_enable', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
<p class="help-block">
{!! trans('admin/settings/general.label2_enable_help') !!}
</p>
</div>
</div>
@if ($setting->label2_enable)
<!-- New Settings -->
<!-- Template -->
<div class="form-group {{ $errors->has('label2_template') ? 'error' : '' }}">
<div class="form-group{{ $errors->has('label2_template') ? ' has-error' : '' }}">
<div class="col-md-3">
{{ Form::label('label2_template', trans('admin/settings/general.label2_template')) }}
@include('partials.label2-preview')
</div>
<div class="col-md-9">
@ -98,9 +102,9 @@
</div>
<!-- Title -->
<div class="form-group {{ $errors->has('label2_title') ? 'error' : '' }}">
<div class="col-md-3">
{{ Form::label('label2_title', trans('admin/settings/general.label2_title')) }}
<div class="form-group{{ $errors->has('label2_title') ? ' has-error' : '' }}">
<div class="col-md-3 text-right">
{{ Form::label('label2_title', trans('admin/settings/general.label2_title'), ['class'=>'control-label']) }}
</div>
<div class="col-md-9">
{{ 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 @@
</div>
<!-- Use Asset Logo -->
<div class="form-group {{ $errors->has('label2_asset_logo') ? 'error' : '' }}">
<div class="col-md-3">
{{ Form::label('label2_asset_logo', trans('admin/settings/general.label2_asset_logo')) }}
</div>
<div class="col-md-9">
{{ 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', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
<p class="help-block">{!! trans('admin/settings/general.label2_asset_logo_help', ['setting_name' => trans('admin/settings/general.brand').' &gt; '.trans('admin/settings/general.label_logo')]) !!}</p>
<div class="form-group" {{ $errors->has('label2_asset_logo') ? 'error' : '' }}">
<div class="col-md-7 col-md-offset-3">
<label class="form-control">
<input type="checkbox" value="1" name="label2_asset_logo"{{ ((old('label2_asset_logo') == '1') || ($setting->label2_asset_logo) == '1') ? ' checked="checked"' : '' }} aria-label="label2_asset_logo">
{{ trans('general.yes') }}
</label>
<p class="help-block">
{!! trans('admin/settings/general.label2_asset_logo_help', ['setting_name' => trans('admin/settings/general.brand').' &gt; '.trans('admin/settings/general.label_logo')]) !!}
</p>
</div>
</div>
<!-- 1D Barcode Type -->
<div class="form-group{{ $errors->has('label2_1d_type') ? ' has-error' : '' }}">
<div class="col-md-3">
{{ Form::label('label2_1d_type', trans('admin/settings/general.label2_1d_type')) }}
<div class="col-md-3 text-right">
{{ Form::label('label2_1d_type', trans('admin/settings/general.label2_1d_type'), ['class'=>'control-label']) }}
</div>
<div class="col-md-9">
@php
@ -153,7 +159,7 @@
{!! $errors->first('label2_1d_type', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
<p class="help-block">
{{ 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').' &gt; '.trans('admin/settings/general.alt_barcode_type'),
@ -162,11 +168,11 @@
</p>
</div>
</div>
<!-- 2D Barcode Type -->
<div class="form-group{{ $errors->has('label2_2d_type') ? ' has-error' : '' }}">
<div class="col-md-3">
{{ Form::label('label2_2d_type', trans('admin/settings/general.label2_2d_type')) }}
<div class="col-md-3 text-right">
{{ Form::label('label2_2d_type', trans('admin/settings/general.label2_2d_type'), ['class'=>'control-label']) }}
</div>
<div class="col-md-9">
@php
@ -182,7 +188,7 @@
{!! $errors->first('label2_2d_type', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
<p class="help-block">
{{ 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').' &gt; '.trans('admin/settings/general.barcode_type'),
@ -191,11 +197,11 @@
</p>
</div>
</div>
<!-- 2D Barcode Target -->
<div class="form-group{{ $errors->has('label2_2d_target') ? ' has-error' : '' }}">
<div class="col-md-3">
{{ Form::label('label2_2d_target', trans('admin/settings/general.label2_2d_target')) }}
<div class="col-md-3 text-right">
{{ Form::label('label2_2d_target', trans('admin/settings/general.label2_2d_target'), ['class'=>'control-label']) }}
</div>
<div class="col-md-9">
{{ 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 @@
<!-- Fields -->
<div class="form-group {{ $errors->has('label2_fields') ? 'error' : '' }}">
<div class="col-md-3">
<div class="col-md-3 text-right">
{{ Form::label('label2_fields', trans('admin/settings/general.label2_fields')) }}
</div>
<div class="col-md-9">
@ -217,7 +223,7 @@
</div>
@include('partials.bootstrap-table')
@else
<!-- Hidden version of new settings -->
{{ Form::hidden('label2_template', old('label2_template', $setting->label2_template)) }}
@ -251,9 +257,9 @@
@else
<!-- Legacy settings -->
<div class="form-group {{ $errors->has('labels_per_page') ? 'error' : '' }}">
<div class="col-md-3">
{{ Form::label('labels_per_page', trans('admin/settings/general.labels_per_page')) }}
<div class="form-group{{ $errors->has('labels_per_page') ? ' has-error' : '' }}">
<div class="col-md-3 text-right">
{{ Form::label('labels_per_page', trans('admin/settings/general.labels_per_page'), ['class'=>'control-label']) }}
</div>
<div class="col-md-9">
{{ 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 @@
</div>
</div>
<div class="form-group {{ $errors->has('labels_fontsize') ? 'error' : '' }}">
<div class="col-md-3">
{{ Form::label('labels_fontsize', trans('admin/settings/general.labels_fontsize')) }}
<div class="form-group{{ $errors->has('labels_fontsize') ? ' has-error' : '' }}">
<div class="col-md-3 text-right">
{{ Form::label('labels_fontsize', trans('admin/settings/general.labels_fontsize'), ['class'=>'control-label']) }}
</div>
<div class="col-md-2">
<div class="input-group">
@ -276,9 +282,9 @@
</div>
</div>
<div class="form-group {{ $errors->has('labels_width') ? 'error' : '' }}">
<div class="col-md-3">
{{ Form::label('labels_width', trans('admin/settings/general.label_dimensions')) }}
<div class="form-group{{ $errors->has('labels_width') ? ' has-error' : '' }}">
<div class="col-md-3 text-right">
{{ Form::label('labels_width', trans('admin/settings/general.label_dimensions'), ['class'=>'control-label']) }}
</div>
<div class="col-md-3">
<div class="input-group">
@ -298,8 +304,8 @@
</div>
</div>
<div class="form-group {{ $errors->has('labels_display_sgutter') ? 'error' : '' }}">
<div class="col-md-3">
<div class="form-group{{ $errors->has('labels_display_sgutter') ? ' has-error' : '' }}">
<div class="col-md-3 text-right">
{{ Form::label('labels_display_sgutter', trans('admin/settings/general.label_gutters')) }}
</div>
<div class="col-md-3">
@ -320,8 +326,8 @@
</div>
</div>
<div class="form-group {{ $errors->has('labels_pmargin_top') ? 'error' : '' }}">
<div class="col-md-3">
<div class="form-group{{ $errors->has('labels_pmargin_top') ? ' has-error' : '' }}">
<div class="col-md-3 text-right">
{{ Form::label('labels_pmargin_top', trans('admin/settings/general.page_padding')) }}
</div>
<div class="col-md-3">
@ -351,9 +357,9 @@
</div>
</div>
<div class="form-group {{ (($errors->has('labels_pageheight')) || $errors->has('labels_pagewidth')) ? 'error' : '' }}">
<div class="col-md-3">
{{ Form::label('labels_pagewidth', trans('admin/settings/general.page_dimensions')) }}
<div class="form-group{{ (($errors->has('labels_pageheight')) || $errors->has('labels_pagewidth')) ? ' has-error' : '' }}">
<div class="col-md-3 text-right">
{{ Form::label('labels_pagewidth', trans('admin/settings/general.page_dimensions'), ['class'=>'control-label']) }}
</div>
<div class="col-md-3">
<div class="input-group">
@ -374,8 +380,8 @@
</div>
<div class="form-group">
<div class="col-md-3">
{{ Form::label('labels_display', trans('admin/settings/general.label_fields')) }}
<div class="col-md-3 text-right">
{{ Form::label('labels_display', trans('admin/settings/general.label_fields'), ['class' => 'control-label']) }}
</div>
<div class="col-md-9">
<label class="form-control">