diff --git a/app.json b/app.json index 24d874114..a3f407adf 100644 --- a/app.json +++ b/app.json @@ -26,6 +26,10 @@ "description": "URL where your Snipe-IT install will be available at.", "value": "https://your-app-name.herokuapp.com" }, + "LABEL_URL": { + "description": "Labels", + "value": "https://your-app-name.herokuapp.com" + }, "APP_TIMEZONE": { "description": "Which timezone do you want to use for your install? (http://php.net/manual/en/timezones.php)", "value": "UTC" diff --git a/app/View/Label.php b/app/View/Label.php index f8d2b48ac..8e64aa46d 100644 --- a/app/View/Label.php +++ b/app/View/Label.php @@ -142,6 +142,9 @@ class Label implements View case 'location': $barcode2DTarget = route('locations.show', $asset->location_id); break; + case 'custom_url_hardware_id': + $barcode2DTarget = route('hardware.show', $asset); + break; case 'hardware_id': default: $barcode2DTarget = route('hardware.show', $asset); diff --git a/config/app.php b/config/app.php index 9de088089..1e3c60bcb 100755 --- a/config/app.php +++ b/config/app.php @@ -74,6 +74,7 @@ return [ */ 'url' => env('APP_URL', 'http://localhost'), + 'label_url' => env('LABEL_URL', 'http://localhost'), /* |-------------------------------------------------------------------------- diff --git a/resources/views/hardware/edit.blade.php b/resources/views/hardware/edit.blade.php index b77443ae2..1cf6e556b 100755 --- a/resources/views/hardware/edit.blade.php +++ b/resources/views/hardware/edit.blade.php @@ -217,7 +217,7 @@ $.ajax({ type: 'GET', - url: "{{ config('app.url') }}/models/" + modelid + "/custom_fields", + url: "{{ config('app.label_url') }}/models/" + modelid + "/custom_fields", headers: { "X-Requested-With": 'XMLHttpRequest', "X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content') @@ -260,7 +260,7 @@ if (status_id != '') { $(".status_spinner").css("display", "inline"); $.ajax({ - url: "{{config('app.url') }}/api/v1/statuslabels/" + status_id + "/deployable", + url: "{{config('app.label_url') }}/api/v1/statuslabels/" + status_id + "/deployable", headers: { "X-Requested-With": 'XMLHttpRequest', "X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content') diff --git a/resources/views/hardware/labels.blade.php b/resources/views/hardware/labels.blade.php index 0d675d3be..1e34bedaa 100644 --- a/resources/views/hardware/labels.blade.php +++ b/resources/views/hardware/labels.blade.php @@ -112,7 +112,7 @@ $qr_size = ($settings->alt_barcode_enabled=='1') && ($settings->label2_1d_type!= @if ($settings->qr_code=='1')
- +
@endif @@ -158,7 +158,7 @@ $qr_size = ($settings->alt_barcode_enabled=='1') && ($settings->label2_1d_type!= @if ((($settings->alt_barcode_enabled=='1') && $settings->label2_1d_type!=''))
- +
@endif diff --git a/resources/views/partials/bootstrap-table.blade.php b/resources/views/partials/bootstrap-table.blade.php index 0c514cd37..26b34b792 100644 --- a/resources/views/partials/bootstrap-table.blade.php +++ b/resources/views/partials/bootstrap-table.blade.php @@ -276,7 +276,7 @@ function genericRowLinkFormatter(destination) { return function (value,row) { if (value) { - return '' + value + ''; + return '' + value + ''; } }; } @@ -318,7 +318,7 @@ text_help = ''; } - return ' ' + value.name + ' ' + text_help + ' '; + return ' ' + value.name + ' ' + text_help + ' '; } else if ((value) && (value.name)) { // Add some overrides for any funny urls we have @@ -328,7 +328,7 @@ var dpolymorphicItemFormatterest = 'fields/'; } - return '' + value.name + ''; + return '' + value.name + ''; } }; } @@ -341,7 +341,7 @@ function hardwareAuditFormatter(value, row) { - return '{{ trans('general.audit') }}'; + return '{{ trans('general.audit') }}'; } diff --git a/resources/views/settings/labels.blade.php b/resources/views/settings/labels.blade.php index 6b3442420..f0c00bd58 100644 --- a/resources/views/settings/labels.blade.php +++ b/resources/views/settings/labels.blade.php @@ -303,6 +303,7 @@ id="label2_2d_target" :options="['hardware_id'=>'/hardware/{id} ('.trans('admin/settings/general.default').')', 'ht_tag'=>'/ht/{asset_tag}', + 'custom_url_hardware_id'=>'/hardware/{id}', 'location' => '/location/{location_id}', ]" :selected="old('label2_2d_target', $setting->label2_2d_target)" diff --git a/resources/views/statuslabels/index.blade.php b/resources/views/statuslabels/index.blade.php index 65771389c..26e9b2713 100755 --- a/resources/views/statuslabels/index.blade.php +++ b/resources/views/statuslabels/index.blade.php @@ -91,7 +91,7 @@ function statuslabelsAssetLinkFormatter(value, row) { if ((row) && (row.name)) { - return ' ' + row.name + ''; + return ' ' + row.name + ''; } }