QR Codes: Added QR codes for non-assets

This commit is contained in:
snipe
2026-06-08 16:19:21 +01:00
parent 8f98c8a862
commit b5ec9e080d
25 changed files with 114 additions and 17 deletions
+1 -1
View File
@@ -66,7 +66,7 @@
<x-page-column class="col-md-3">
<x-box class="side-box expanded">
<x-info-panel :infoPanelObj="$accessory" img_path="{{ app('accessories_upload_url') }}">
<x-info-panel :infoPanelObj="$accessory" img_path="{{ app('accessories_upload_url') }}" :qr_code_url="route('qr_code/common', ['object_type' => 'accessories', 'id' => $accessory->id])">
<x-slot:buttons>
<x-button.edit :item="$accessory" :route="route('accessories.edit', $accessory->id)"/>
<x-button.clone :item="$accessory" :route="route('clone/accessories', $accessory->id)"/>
@@ -1,6 +1,7 @@
@props([
'infoPanelObj' => null,
'img_path' => null,
'qr_code_url' => null,
'snipeSettings' => \App\Models\Setting::getSettings()
])
@@ -589,6 +590,12 @@
{{ $after_list }}
@endif
@if ($qr_code_url && $snipeSettings->isQrEnabled())
<div class="col-md-12 text-center asset-qr-img" style="padding-top: 15px;">
<img src="{{ $qr_code_url }}" class="img-thumbnail" style="height: 150px; width: 150px; margin-right: 10px;" alt="QR code for {{ $infoPanelObj->name }}">
</div>
@endif
</div>
<!-- end side info-box -->
+1 -1
View File
@@ -75,7 +75,7 @@
</x-page-column>
<x-page-column class="col-md-3">
<x-box class="side-box expanded">
<x-info-panel :infoPanelObj="$company" img_path="{{ app('companies_upload_url') }}">
<x-info-panel :infoPanelObj="$company" img_path="{{ app('companies_upload_url') }}" :qr_code_url="route('qr_code/common', ['object_type' => 'companies', 'id' => $company->id])">
<x-slot:buttons>
<x-button.edit :item="$company" :route="route('companies.edit', $company->id)" />
+1 -1
View File
@@ -61,7 +61,7 @@
<x-page-column class="col-md-3">
<x-box class="side-box expanded">
<x-info-panel :infoPanelObj="$snipe_component" img_path="{{ app('components_upload_url') }}">
<x-info-panel :infoPanelObj="$snipe_component" img_path="{{ app('components_upload_url') }}" :qr_code_url="route('qr_code/common', ['object_type' => 'components', 'id' => $snipe_component->id])">
<x-slot:buttons>
<x-button.edit :item="$snipe_component" :route="route('components.edit', $snipe_component->id)"/>
+1 -1
View File
@@ -62,7 +62,7 @@
<x-page-column class="col-md-3">
<x-box class="side-box expanded">
<x-info-panel :infoPanelObj="$consumable" img_path="{{ app('consumables_upload_url') }}">
<x-info-panel :infoPanelObj="$consumable" img_path="{{ app('consumables_upload_url') }}" :qr_code_url="route('qr_code/common', ['object_type' => 'consumables', 'id' => $consumable->id])">
<x-slot:buttons>
<x-button.edit :item="$consumable" :route="route('consumables.edit', $consumable->id)"/>
+2 -2
View File
@@ -112,7 +112,7 @@ $qr_size = ($settings->alt_barcode_enabled=='1') && ($settings->label2_1d_type!=
@if ($settings->qr_code=='1')
<div class="qr_img">
<img src="{{ config('app.url') }}/hardware/{{ $asset->id }}/qr_code" class="qr_img">
<img src="{{ route('qr_code/common', ['object_type' => 'hardware', 'id' => $asset->id]) }}" class="qr_img">
</div>
@endif
@@ -166,7 +166,7 @@ $qr_size = ($settings->alt_barcode_enabled=='1') && ($settings->label2_1d_type!=
</div>
@if (($count % $settings->labels_per_page == 0) && $count!=count($assets))
@if ($settings->labels_per_page > 0 && ($count % $settings->labels_per_page == 0) && $count != count($assets))
<div class="page-break"></div>
<div class="next-padding">&nbsp;</div>
@endif
+3 -2
View File
@@ -318,12 +318,13 @@
@if (($snipeSettings->qr_code=='1') || $snipeSettings->label2_2d_type!='none')
@if ($snipeSettings->isQrEnabled())
<div class="col-md-12 text-center asset-qr-img" style="padding-top: 15px;">
<img src="{{ config('app.url') }}/hardware/{{ $asset->id }}/qr_code" class="img-thumbnail" style="height: 150px; width: 150px; margin-right: 10px;" alt="QR code for {{ $asset->getDisplayNameAttribute() }}">
<img src="{{ route('qr_code/common', ['object_type' => 'hardware', 'id' => $asset->id]) }}" class="img-thumbnail" style="height: 150px; width: 150px; margin-right: 10px;" alt="QR code for {{ $asset->getDisplayNameAttribute() }}">
</div>
@endif
</x-page-column>
<!-- end side stats column -->
+1 -1
View File
@@ -104,7 +104,7 @@
<x-page-column class="col-md-3">
<x-box class="side-box expanded">
<x-info-panel :infoPanelObj="$license" img_path="{{ app('licenses_upload_url') }}">
<x-info-panel :infoPanelObj="$license" img_path="{{ app('licenses_upload_url') }}" :qr_code_url="route('qr_code/common', ['object_type' => 'licenses', 'id' => $license->id])">
<x-slot:buttons>
+1 -1
View File
@@ -216,7 +216,7 @@
<x-page-column class="col-md-3">
<x-box class="side-box expanded">
<x-info-panel :infoPanelObj="$location" img_path="{{ app('locations_upload_url') }}">
<x-info-panel :infoPanelObj="$location" img_path="{{ app('locations_upload_url') }}" :qr_code_url="route('qr_code/common', ['object_type' => 'locations', 'id' => $location->id])">
<x-slot:buttons>
<x-button.edit :item="$location" :route="route('locations.edit', $location->id)" />
+1 -1
View File
@@ -54,7 +54,7 @@
</x-page-column>
<x-page-column class="col-md-3">
<x-box class="side-box expanded">
<x-info-panel :infoPanelObj="$model" img_path="{{ app('models_upload_url') }}">
<x-info-panel :infoPanelObj="$model" img_path="{{ app('models_upload_url') }}" :qr_code_url="route('qr_code/common', ['object_type' => 'models', 'id' => $model->id])">
<x-slot:buttons>
<x-button.edit :item="$model" :route="route('models.edit', $model->id)" />
<x-button.add :item="\App\Models\Asset::class" :tooltip="trans('general.new_asset')" :route="route('hardware.create', ['model_id' => $model->id])"/>
+5
View File
@@ -303,6 +303,11 @@
@endif
@if ($snipeSettings->isQrEnabled())
<div class="col-md-12 text-center user-qr-img" style="padding-top: 15px;">
<img src="{{ route('qr_code/common', ['object_type' => 'users', 'id' => $user->id]) }}" class="img-thumbnail" style="height: 150px; width: 150px; margin-right: 10px;" alt="QR code for {{ $user->display_name }}">
</div>
@endif
</x-page-column>
<!-- end side stats well column-->