Skip to content

Commit b9ac5a0

Browse files
committed
Feature: Added asset ID option to 2D barcode in label generation
1 parent a75cfa2 commit b9ac5a0

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

app/View/Label.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ public function render(callable $callback = null)
127127
case 'ht_tag':
128128
$barcode2DTarget = route('ht/assetTag', $asset->asset_tag);
129129
break;
130+
case 'plain_asset_id':
131+
$barcode2DTarget = (string) $asset->id;
132+
break;
130133
case 'plain_asset_tag':
131134
$barcode2DTarget = $asset->asset_tag;
132135
break;

resources/lang/en-US/admin/settings/general.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,7 @@
366366
'help_asterisk_bold' => 'Text entered as <code>**text**</code> will be displayed as bold',
367367
'help_blank_to_use' => 'Leave blank to use the value from <code>:setting_name</code>',
368368
'help_default_will_use' => '<code>:default</code> will use the value from <code>:setting_name</code>. <br>Note that the value of the barcodes must comply with the respective barcode spec in order to be successfully generated. Please see <a href="https://snipe-it.readme.io/docs/barcodes">the documentation <i class="fa fa-external-link"></i></a> for more details. ',
369+
'asset_id' => 'Asset ID',
369370
'data' => 'Data',
370371
'default' => 'Default',
371372
'none' => 'None',

resources/views/settings/labels.blade.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ class="table table-striped snipe-table"
207207
{{ Form::select('label2_2d_target', [
208208
'hardware_id' => trans('general.url') .': /hardware/{id} ('.trans('admin/settings/general.default').')',
209209
'ht_tag' => trans('general.url') .': /ht/{asset_tag}',
210+
'plain_asset_id' => trans('admin/settings/general.data') .': '. trans('admin/settings/general.asset_id') .' {id}',
210211
'plain_asset_tag' => trans('admin/settings/general.data') .': '. trans('general.asset_tag') .' {asset_tag}',
211212
'plain_serial_number' => trans('admin/settings/general.data') .': '. trans('general.serial_number') .' {serial}',
212213
], old('label2_2d_target', $setting->label2_2d_target), [ 'class'=>'select2 col-md-4', 'aria-label'=>'label2_2d_target' ]) }}

0 commit comments

Comments
 (0)