A free open source IT asset/license management system
Patched #11025 to develop
snipecaef98d36d55
diff --git a/resources/lang/en/general.php b/resources/lang/en/general.phpindex a22145fa57..5140861fc4 100644--- a/resources/lang/en/general.php+++ b/resources/lang/en/general.php@@ -1,6 +1,6 @@<?php- return [+return ['accessories' => 'Accessories','activated' => 'Activated','accessory' => 'Accessory',@@ -26,6 +26,7 @@'audit' => 'Audit','audit_report' => 'Audit Log','assets' => 'Assets',+ 'assigned_to' => 'Assigned to :name','avatar_delete' => 'Delete Avatar','avatar_upload' => 'Upload Avatar','back' => 'Back',@@ -352,4 +353,4 @@'checkout_tooltip' => 'Check this item out','checkin_tooltip' => 'Check this item in','checkout_user_tooltip' => 'Check this item out to a user',-];+];\ No newline at end of filediff --git a/resources/views/users/print.blade.php b/resources/views/users/print.blade.phpindex 15605db64a..ec15e1dc03 100644--- a/resources/views/users/print.blade.php+++ b/resources/views/users/print.blade.php@@ -2,7 +2,7 @@<html lang="{{ str_replace('_', '-', app()->getLocale()) }}"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>- <title>Assigned to {{ $show_user->present()->fullName() }}</title>+ <title>{{ trans('general.assigned_to', ['name' => $show_user->present()->fullName()]) }}</title><style>body {font-family: "Arial, Helvetica", sans-serif;@@ -30,230 +30,230 @@</style></head><body>+@if ($snipeSettings->logo_print_assets=='1')@if ($snipeSettings->brand == '3')<h2>- @if ($snipeSettings->logo!='')- <img class="print-logo" src="{{ url('/') }}/uploads/{{ $snipeSettings->logo }}">- @endif- {{ $snipeSettings->site_name }}+ @if ($snipeSettings->logo!='')+ <img class="print-logo" src="{{ url('/') }}/uploads/{{ $snipeSettings->logo }}">+ @endif+ {{ $snipeSettings->site_name }}</h2>@elseif ($snipeSettings->brand == '2')@if ($snipeSettings->logo!='')<img class="print-logo" src="{{ url('/') }}/uploads/{{ $snipeSettings->logo }}">@endif@else- <h2>{{ $snipeSettings->site_name }}</h2>+ <h2>{{ $snipeSettings->site_name }}</h2>@endif@endif-<h2>Assigned to {{ $show_user->present()->fullName() }}</h4>+<h2>{{ trans('general.assigned_to', ['name' => $show_user->present()->fullName()]) }}</h4>-@if ($assets->count() > 0)- @php- $counter = 1;- @endphp- <table class="inventory">- <thead>- <tr>- <th colspan="8">{{ trans('general.assets') }}</th>- </tr>- </thead>- <thead>+ @if ($assets->count() > 0)+ @php+ $counter = 1;+ @endphp+ <table class="inventory">+ <thead>+ <tr>+ <th colspan="8">{{ trans('general.assets') }}</th>+ </tr>+ </thead>+ <thead><tr><th style="width: 20px;"></th>- <th style="width: 20%;">{{ trans('general.asset_tag') }}</th>+ <th style="width: 20%;">{{ trans('admin/hardware/table.asset_tag') }}</th><th style="width: 20%;">{{ trans('general.name') }}</th><th style="width: 10%;">{{ trans('general.category') }}</th>- <th style="width: 20%;">{{ trans('general.asset_model') }}</th>+ <th style="width: 20%;">{{ trans('admin/hardware/form.model') }}</th><th style="width: 20%;">{{ trans('admin/hardware/form.serial') }}</th>- <th style="width: 10%;">{{ trans('general.checked_out') }}</th>+ <th style="width: 10%;">{{ trans('admin/hardware/table.checkout_date') }}</th><th data-formatter="imageFormatter" style="width: 20%;">{{ trans('general.signature') }}</th></tr>- </thead>+ </thead>- @foreach ($assets as $asset)+ @foreach ($assets as $asset)- <tr>- <td>{{ $counter }}</td>- <td>{{ $asset->asset_tag }}</td>- <td>{{ $asset->name }}</td>- <td>{{ $asset->model->category->name }}</td>- <td>{{ $asset->model->name }}</td>- <td>{{ $asset->serial }}</td>- <td>- {{ $asset->last_checkout }}</td>- <td>- @if ($asset->assetlog->first())- <img style="width:auto;height:100px;" src="{{ asset('/') }}display-sig/{{ $asset->assetlog->firstWhere('action_type', 'accepted')->accept_signature}}">+ <tr>+ <td>{{ $counter }}</td>+ <td>{{ $asset->asset_tag }}</td>+ <td>{{ $asset->name }}</td>+ <td>{{ $asset->model->category->name }}</td>+ <td>{{ $asset->model->name }}</td>+ <td>{{ $asset->serial }}</td>+ <td>+ {{ $asset->last_checkout }}</td>+ <td>+ @if ($asset->assetlog->first())+ <img style="width:auto;height:100px;" src="{{ asset('/') }}display-sig/{{ $asset->assetlog->first()->accept_signature }}">+ @endif+ </td>+ </tr>+ @if($settings->show_assigned_assets)+ @php+ $assignedCounter = 1;+ @endphp+ @foreach ($asset->assignedAssets as $asset)++ <tr>+ <td>{{ $counter }}.{{ $assignedCounter }}</td>+ <td>{{ $asset->asset_tag }}</td>+ <td>{{ $asset->name }}</td>+ <td>{{ $asset->model->category->name }}</td>+ <td>{{ $asset->model->name }}</td>+ <td>{{ $asset->serial }}</td>+ <td>{{ $asset->last_checkout }}</td>+ <td><img style="width:auto;height:100px;" src="{{ asset('/') }}display-sig/{{ $asset->assetlog->first()->accept_signature }}"></td>+ </tr>+ @php+ $assignedCounter+++ @endphp+ @endforeach@endif- </td>- </tr>- @if($settings->show_assigned_assets)@php- $assignedCounter = 1;+ $counter++@endphp- @foreach ($asset->assignedAssets as $asset)-- <tr>- <td>{{ $counter }}.{{ $assignedCounter }}</td>- <td>{{ $asset->asset_tag }}</td>- <td>{{ $asset->name }}</td>- <td>{{ $asset->model->category->name }}</td>- <td>{{ $asset->model->name }}</td>- <td>{{ $asset->serial }}</td>- <td>- {{ $asset->last_checkout }}</td>- <td><img style="width:auto;height:100px;" src="{{ asset('/') }}display-sig/{{ $asset->assetlog->first()->accept_signature }}"></td>- </tr>- @php- $assignedCounter++- @endphp- @endforeach- @endif- @php- $counter++- @endphp- @endforeach- </table>-@endif+ @endforeach+ </table>+ @endif-@if ($licenses->count() > 0)- <br><br>- <table class="inventory">- <thead>- <tr>- <th colspan="4">{{ trans('general.licenses') }}</th>- </tr>- </thead>- <thead>+ @if ($licenses->count() > 0)+ <br><br>+ <table class="inventory">+ <thead>+ <tr>+ <th colspan="4">{{ trans('general.licenses') }}</th>+ </tr>+ </thead>+ <thead><tr><th style="width: 20px;"></th><th style="width: 40%;">{{ trans('general.name') }}</th>- <th style="width: 50%;">{{ trans('general.license_serial') }}</th>- <th style="width: 10%;">{{ trans('general.checked_out') }}</th>+ <th style="width: 50%;">{{ trans('admin/licenses/form.license_key') }}</th>+ <th style="width: 10%;">{{ trans('admin/hardware/table.checkout_date') }}</th></tr>- </thead>- @php- $lcounter = 1;- @endphp+ </thead>+ @php+ $lcounter = 1;+ @endphp++ @foreach ($licenses as $license)++ <tr>+ <td>{{ $lcounter }}</td>+ <td>{{ $license->name }}</td>+ <td>+ @can('viewKeys', $license)+ {{ $license->serial }}+ @else+ <i class="fa-lock" aria-hidden="true"></i> {{ str_repeat('x', 15) }}+ @endcan+ </td>+ <td>{{ $license->pivot->created_at }}</td>+ </tr>+ @php+ $lcounter+++ @endphp+ @endforeach+ </table>+ @endif- @foreach ($licenses as $license)+ @if ($accessories->count() > 0)+ <br><br>+ <table class="inventory">+ <thead><tr>- <td>{{ $lcounter }}</td>- <td>{{ $license->name }}</td>- <td>- @can('viewKeys', $license)- {{ $license->serial }}- @else- <i class="fa-lock" aria-hidden="true"></i> {{ str_repeat('x', 15) }}- @endcan- </td>- <td>{{ $license->pivot->created_at }}</td>+ <th colspan="4">{{ trans('general.accessories') }}</th></tr>+ </thead>+ <thead>+ <tr>+ <th style="width: 20px;"></th>+ <th style="width: 40%;">{{ trans('general.name') }}</th>+ <th style="width: 50%;">{{ trans('general.category') }}</th>+ <th style="width: 10%;">{{ trans('admin/hardware/table.checkout_date') }}</th>+ </tr>+ </thead>@php- $lcounter+++ $acounter = 1;@endphp- @endforeach- </table>-@endif+ @foreach ($accessories as $accessory)+ @if ($accessory)+ <tr>+ <td>{{ $acounter }}</td>+ <td>{{ ($accessory->manufacturer) ? $accessory->manufacturer->name : '' }} {{ $accessory->name }} {{ $accessory->model_number }}</td>+ <td>{{ $accessory->category->name }}</td>+ <td>{{ $accessory->pivot->created_at }}</td>+ </tr>+ @php+ $acounter+++ @endphp+ @endif+ @endforeach+ </table>+ @endif-@if ($accessories->count() > 0)- <br><br>- <table class="inventory">- <thead>- <tr>- <th colspan="4">{{ trans('general.accessories') }}</th>- </tr>- </thead>- <thead>+ @if ($consumables->count() > 0)+ <br><br>+ <table class="inventory">+ <thead>+ <tr>+ <th colspan="4">{{ trans('general.consumables') }}</th>+ </tr>+ </thead>+ <thead><tr><th style="width: 20px;"></th><th style="width: 40%;">{{ trans('general.name') }}</th><th style="width: 50%;">{{ trans('general.category') }}</th><th style="width: 10%;">{{ trans('admin/hardware/table.checkout_date') }}</th></tr>- </thead>- @php- $acounter = 1;- @endphp-- @foreach ($accessories as $accessory)- @if ($accessory)- <tr>- <td>{{ $acounter }}</td>- <td>{{ ($accessory->manufacturer) ? $accessory->manufacturer->name : '' }} {{ $accessory->name }} {{ $accessory->model_number }}</td>- <td>{{ $accessory->category->name }}</td>- <td>{{ $accessory->pivot->created_at }}</td>- </tr>- @php- $acounter++- @endphp- @endif- @endforeach- </table>-@endif+ </thead>+ @php+ $ccounter = 1;+ @endphp-@if ($consumables->count() > 0)- <br><br>- <table class="inventory">- <thead>- <tr>- <th colspan="4">{{ trans('general.consumables') }}</th>- </tr>- </thead>- <thead>- <tr>- <th style="width: 20px;"></th>- <th style="width: 40%;">{{ trans('general.name') }}</th>- <th style="width: 50%;">{{ trans('general.category') }}</th>- <th style="width: 10%;">{{ trans('admin/hardware/table.checkout_date') }}</th>- </tr>- </thead>- @php- $ccounter = 1;- @endphp+ @foreach ($consumables as $consumable)+ @if ($consumable)+ <tr>+ <td>{{ $ccounter }}</td>- @foreach ($consumables as $consumable)- @if ($consumable)- <tr>- <td>{{ $ccounter }}</td>+ <td>+ @if ($consumable->deleted_at!='')+ <td>{{ ($consumable->manufacturer) ? $consumable->manufacturer->name : '' }} {{ $consumable->name }} {{ $consumable->model_number }}</td>+ @else+ {{ ($consumable->manufacturer) ? $consumable->manufacturer->name : '' }} {{ $consumable->name }} {{ $consumable->model_number }}+ @endif+ </td>+ <td>{{ ($consumable->category) ? $consumable->category->name : ' invalid/deleted category' }} </td>+ <td>{{ $consumable->pivot->created_at }}</td>+ </tr>+ @php+ $ccounter+++ @endphp+ @endif+ @endforeach+ </table>+ @endif- <td>- @if ($consumable->deleted_at!='')- <td>{{ ($consumable->manufacturer) ? $consumable->manufacturer->name : '' }} {{ $consumable->name }} {{ $consumable->model_number }}</td>- @else- {{ ($consumable->manufacturer) ? $consumable->manufacturer->name : '' }} {{ $consumable->name }} {{ $consumable->model_number }}- @endif- </td>- <td>{{ ($consumable->category) ? $consumable->category->name : trans('general.invalid_category') }} </td>- <td>{{ $consumable->assetlog->first()->created_at }}</td>- </tr>- @php- $ccounter++- @endphp- @endif- @endforeach+ <br>+ <br>+ <br>+ <table>+ <tr>+ <td>{{ trans('general.signed_off_by') }}:</td>+ <td>________________________________________________________</td>+ <td></td>+ <td>{{ trans('general.date') }}:</td>+ <td>________________________________________________________</td>+ </tr></table>-@endif--<br>-<br>-<br>-<table>- <tr>- <td>{{ trans('general.signed_off_by') }}:</td>- <td>________________________________________________________</td>- <td></td>- <td>{{ trans('general.date') }}:</td>- <td>________________________________________________________</td>- </tr>-</table></body>-</html>+</html>\ No newline at end of file