A free open source IT asset/license management system
Merge branch 'develop' into feature/custom-data-options-for-2d-barcode
Nebel9f0581275bb6
diff --cc app/View/Label.phpindex 8a192543b1,c28b8a9594..bafe97ffef--- a/app/View/Label.php+++ b/app/View/Label.php@@@ -115,38 -115,25 +115,37 @@@ class Label implements Vie]);}}- }--- if ($template->getSupport2DBarcode()) {- $barcode2DType = $settings->label2_2d_type;- if (($barcode2DType != 'none') && (!is_null($barcode2DType))) {- switch ($settings->label2_2d_target) {- case 'ht_tag':- $barcode2DTarget = route('ht/assetTag', $asset->asset_tag);- break;- case 'hardware_id':- default:- $barcode2DTarget = route('hardware.show', ['hardware' => $asset->id]);- break;+++ if ($template->getSupport2DBarcode()) {+ $barcode2DType = $settings->label2_2d_type;+ $barcode2DType = ($barcode2DType == 'default') ?+ $settings->barcode_type :+ $barcode2DType;+ if (($barcode2DType != 'none') && (!is_null($barcode2DType))) {+ switch ($settings->label2_2d_target) {+ case 'ht_tag':+ $barcode2DTarget = route('ht/assetTag', $asset->asset_tag);+ break;+ case 'plain_asset_id':+ $barcode2DTarget = (string) $asset->id;+ break;+ case 'plain_asset_tag':+ $barcode2DTarget = $asset->asset_tag;+ break;+ case 'plain_serial_number':+ $barcode2DTarget = $asset->serial;+ break;+ case 'hardware_id':+ default:+ $barcode2DTarget = route('hardware.show', ['hardware' => $asset->id]);+ break;+ }+ $assetData->put('barcode2d', (object)[+ 'type' => $barcode2DType,+ 'content' => $barcode2DTarget,+ ]);}- $assetData->put('barcode2d', (object)[- 'type' => $barcode2DType,- 'content' => $barcode2DTarget,- ]);}- }$fields = $fieldDefinitions->map(fn($field) => $field->toArray($asset))diff --cc resources/views/settings/labels.blade.phpindex 1f56bc52b5,4c01c2177d..fa8c5dc858--- a/resources/views/settings/labels.blade.php+++ b/resources/views/settings/labels.blade.php@@@ -138,66 -138,135 +138,139 @@@</div></div>-+ @endif+ @if($setting->label2_enable == 0)+ @if ($is_gd_installed)+ <!-- barcode -->+ <div class="form-group">-+ <div class="col-md-9 col-md-offset-3">+ <label class="form-control">+ {{ Form::checkbox('alt_barcode_enabled', '1', old('alt_barcode_enabled', $setting->alt_barcode_enabled),array( 'aria-label'=>'alt_barcode_enabled')) }}+ {{ trans('admin/settings/general.display_alt_barcode') }}+ </label>+ </div>+ </div>+ @endif+ @endif- <!-- 1D Barcode Type -->- <div class="form-group{{ $errors->has('label2_1d_type') ? ' has-error' : '' }}">- <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-7">- @php- $select1DValues = [- 'C128' => 'C128',- 'C39' => 'C39',- 'EAN5' => 'EAN5',- 'EAN13' => 'EAN13',- 'UPCA' => 'UPCA',- 'UPCE' => 'UPCE',- 'none' => trans('admin/settings/general.none'),- ];- @endphp- {{ Form::select('label2_1d_type', $select1DValues, old('label2_1d_type', $setting->label2_1d_type), [ 'class'=>'select2 col-md-4', 'aria-label'=>'label2_1d_type' ]) }}- {!! $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')- !!}- </p>- </div>+++ <!-- 1D Barcode Type -->+ <div class="form-group{{ $errors->has('label2_1d_type') ? ' has-error' : '' }}">+ <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-7">+ @php+ $select1DValues = [+ 'C128' => 'C128',+ 'C39' => 'C39',+ 'EAN5' => 'EAN5',+ 'EAN13' => 'EAN13',+ 'UPCA' => 'UPCA',+ 'UPCE' => 'UPCE',+ 'none' => trans('admin/settings/general.none'),+ ];+ @endphp+ {{ Form::select('label2_1d_type', $select1DValues, old('label2_1d_type', $setting->label2_1d_type), [ 'class'=>'select2 col-md-4', 'aria-label'=>'label2_1d_type' ]) }}+ {!! $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').' > '.trans('admin/settings/general.alt_barcode_type'),+ ])+ !!}+ </p>+ </div>+ </div>+++ @if($setting->label2_enable == 0)- <!-- 2D Barcode Type -->- <div class="form-group{{ $errors->has('label2_2d_type') ? ' has-error' : '' }}">- <div class="col-md-3 text-right">- {{ Form::label('label2_2d_type', trans('admin/settings/general.label2_2d_type'), ['class'=>'control-label']) }}+ <!-- qr code -->+ <div class="form-group">+ <div class="col-md-9 col-md-offset-3">+ <label class="form-control">+ {{ Form::checkbox('qr_code', '1', old('qr_code', $setting->qr_code),array('aria-label'=>'qr_code')) }}+ {{ trans('admin/settings/general.display_qr') }}+ </label>+ </div>+ </div>+ @endif+ <!-- 2D Barcode Type -->+ <div class="form-group{{ $errors->has('label2_2d_type') ? ' has-error' : '' }}">+ <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-7">+ @php+ $select2DValues = [+ 'QRCODE' => 'QRCODE',+ ];+ if ($setting->label2_enable == 1) {+ $select2DValues['PDF417'] = 'PDF417';+ }+ $select2DValues = array_merge($select2DValues, [+ 'DATAMATRIX' => 'DATAMATRIX',+ 'none' => trans('admin/settings/general.none'),+ ]);+ @endphp+ {{ Form::select('label2_2d_type', $select2DValues, old('label2_2d_type', $setting->label2_2d_type), [ 'class'=>'select2 col-md-4', 'aria-label'=>'label2_2d_type' ]) }}+ {!! $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')+ !!}+ </p>+ </div></div>- <div class="col-md-7">- @php- $select2DValues = [- 'QRCODE' => 'QRCODE',- 'DATAMATRIX' => 'DATAMATRIX',- 'PDF417' => 'PDF417',- 'none' => trans('admin/settings/general.none'),- ];- @endphp- {{ Form::select('label2_2d_type', $select2DValues, old('label2_2d_type', $setting->label2_2d_type), [ 'class'=>'select2 col-md-4', 'aria-label'=>'label2_2d_type' ]) }}- {!! $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').' > '.trans('admin/settings/general.barcode_type'),- ])- !!}- </p>++ @if($setting->label2_enable == 0)+ <!-- QR Text -->+ <div class="form-group{{ $errors->has('qr_text') ? ' has-error' : '' }}">+ <div class="col-md-3 text-right">+ {{ Form::label('qr_text', trans('admin/settings/general.qr_text'), ['class'=>'control-label']) }}+ </div>+ <div class="col-md-7">+ @if ($setting->qr_code == 1)+ {{ Form::text('qr_text', old('qr_text', $setting->qr_text), array(+ 'class' => 'form-control',+ 'placeholder' => 'Property of Your Company',+ 'rel' => 'txtTooltip',+ 'title' =>'Extra text that you would like to display on your labels.',+ 'data-toggle' =>'tooltip',+ 'data-placement'=>'top'+ )) }}+ @else+ {{ Form::text('qr_text', old('qr_text', $setting->qr_text), array(+ 'class' => 'form-control',+ 'disabled' => 'disabled',+ 'placeholder' => 'Property of Your Company'+ )) }}+ <p class="help-block">{{ trans('admin/settings/general.qr_help') }}</p>+ @endif+ {!! $errors->first('qr_text', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}+ </div></div>- </div>+ <!-- Nuke barcode cache -->+ <div class="form-group">+ <div class="col-md-3 text-right">+ {{ Form::label('purge_barcodes', 'Purge Barcodes', ['class'=>'control-label']) }}+ </div>+ <div class="col-md-7">+ <a class="btn btn-default btn-sm pull-left" id="purgebarcodes" style="margin-right: 10px;">+ {{ trans('admin/settings/general.barcode_delete_cache') }}+ </a>+ <span id="purgebarcodesicon"></span>+ <span id="purgebarcodesresult"></span>+ <span id="purgebarcodesstatus"></span>+ {!! $errors->first('purgebarcodes', '<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.barcodes_help') }}</p>+ </div>+ </div>+ @endif+ @if ($setting->label2_enable)<!-- 2D Barcode Target --><div class="form-group{{ $errors->has('label2_2d_target') ? ' has-error' : '' }}"><div class="col-md-3 text-right">