diff --git a/app/Http/Controllers/Users/UsersController.php b/app/Http/Controllers/Users/UsersController.php
index 31c5a1689d..ddef9e3b30 100755
--- a/app/Http/Controllers/Users/UsersController.php
+++ b/app/Http/Controllers/Users/UsersController.php
@@ -612,7 +612,7 @@ class UsersController extends Controller
$this->authorize('view', $user);
return view('users.print')
- ->with('show_user', $user)
+ ->with('users', [$user])
->with('settings', Setting::getSettings());
}
diff --git a/resources/views/users/print.blade.php b/resources/views/users/print.blade.php
index 822d15d883..5627d76096 100644
--- a/resources/views/users/print.blade.php
+++ b/resources/views/users/print.blade.php
@@ -2,345 +2,347 @@
@section('content')
-
- {{ trans('general.assigned_to', ['name' => $show_user->present()->fullName()]) }}
- {{ ($show_user->employee_num!='') ? ' (#'.$show_user->employee_num.') ' : '' }}
- {{ ($show_user->jobtitle!='' ? ' - '.$show_user->jobtitle : '') }}
-
- {{ trans('admin/users/general.all_assigned_list_generation')}} {{ Helper::getFormattedDateObject(now(), 'datetime', false) }}
+ @foreach($users as $show_user)
+
+ {{ trans('general.assigned_to', ['name' => $show_user->present()->fullName()]) }}
+ {{ ($show_user->employee_num!='') ? ' (#'.$show_user->employee_num.') ' : '' }}
+ {{ ($show_user->jobtitle!='' ? ' - '.$show_user->jobtitle : '') }}
+
+ {{ trans('admin/users/general.all_assigned_list_generation')}} {{ Helper::getFormattedDateObject(now(), 'datetime', false) }}
- @if ($show_user->assets->count() > 0)
- @php
- $counter = 1;
- @endphp
+ @if ($show_user->assets->count() > 0)
+ @php
+ $counter = 1;
+ @endphp
-
-
{{ trans_choice('general.countable.assets', $show_user->assets->count(), ['count' => $show_user->assets->count()]) }}
-
-
+
+
{{ trans_choice('general.countable.assets', $show_user->assets->count(), ['count' => $show_user->assets->count()]) }}
+
+
-
-
- # |
- {{ trans('general.image') }} |
- {{ trans('admin/hardware/table.asset_tag') }} |
- {{ trans('general.name') }} |
- {{ trans('general.category') }} |
- {{ trans('admin/hardware/form.model') }} |
- {{ trans('admin/hardware/form.default_location') }} |
- {{ trans('general.location') }} |
- {{ trans('admin/hardware/form.serial') }} |
- {{ trans('admin/hardware/table.checkout_date') }} |
- {{ trans('general.signature') }} |
-
-
- @foreach ($show_user->assets as $asset)
- @php
- if ($asset->model->category->getEula()) $eulas[] = $asset->model->category->getEula()
- @endphp
-
- {{ $counter }} |
-
- @if ($asset->getImageUrl())
-
- @endif
- |
- {{ $asset->asset_tag }} |
- {{ $asset->name }} |
- {{ (($asset->model) && ($asset->model->category)) ? $asset->model->category->name : trans('general.invalid_category') }} |
- {{ ($asset->model) ? $asset->model->name : trans('general.invalid_model') }} |
- {{ ($asset->defaultLoc) ? $asset->defaultLoc->name : '' }} |
- {{ ($asset->location) ? $asset->location->name : '' }} |
- {{ $asset->serial }} |
-
- {{ Helper::getFormattedDateObject($asset->last_checkout, 'datetime', false) }} |
-
- @if (($asset->assetlog->first()) && ($asset->assetlog->first()->accept_signature!=''))
-
- @endif
- |
-
- @if ($settings->show_assigned_assets)
+
+
+ # |
+ {{ trans('general.image') }} |
+ {{ trans('admin/hardware/table.asset_tag') }} |
+ {{ trans('general.name') }} |
+ {{ trans('general.category') }} |
+ {{ trans('admin/hardware/form.model') }} |
+ {{ trans('admin/hardware/form.default_location') }} |
+ {{ trans('general.location') }} |
+ {{ trans('admin/hardware/form.serial') }} |
+ {{ trans('admin/hardware/table.checkout_date') }} |
+ {{ trans('general.signature') }} |
+
+
+ @foreach ($show_user->assets as $asset)
@php
- $assignedCounter = 1;
+ if ($asset->model->category->getEula()) $eulas[] = $asset->model->category->getEula()
@endphp
- @foreach ($asset->assignedAssets as $asset)
+
+ {{ $counter }} |
+
+ @if ($asset->getImageUrl())
+
+ @endif
+ |
+ {{ $asset->asset_tag }} |
+ {{ $asset->name }} |
+ {{ (($asset->model) && ($asset->model->category)) ? $asset->model->category->name : trans('general.invalid_category') }} |
+ {{ ($asset->model) ? $asset->model->name : trans('general.invalid_model') }} |
+ {{ ($asset->defaultLoc) ? $asset->defaultLoc->name : '' }} |
+ {{ ($asset->location) ? $asset->location->name : '' }} |
+ {{ $asset->serial }} |
+
+ {{ Helper::getFormattedDateObject($asset->last_checkout, 'datetime', false) }} |
+
+ @if (($asset->assetlog->first()) && ($asset->assetlog->first()->accept_signature!=''))
+
+ @endif
+ |
+
+ @if ($settings->show_assigned_assets)
+ @php
+ $assignedCounter = 1;
+ @endphp
+ @foreach ($asset->assignedAssets as $asset)
+
+ {{ $counter }}.{{ $assignedCounter }} |
+
+ @if ($asset->getImageUrl())
+
+ @endif
+ |
+ {{ $asset->asset_tag }} |
+ {{ $asset->name }} |
+ {{ (($asset->model) && ($asset->model->category)) ? $asset->model->category->name : trans('general.invalid_category') }} |
+ {{ ($asset->model) ? $asset->model->name : trans('general.invalid_model') }} |
+ {{ ($asset->defaultLoc) ? $asset->defaultLoc->name : '' }} |
+ {{ ($asset->location) ? $asset->location->name : '' }} |
+ {{ $asset->serial }} |
+
+ {{ Helper::getFormattedDateObject($asset->last_checkout, 'datetime', false) }} |
+
+ @if (($asset->assetlog->first()) && ($asset->assetlog->first()->accept_signature!=''))
+
+ @endif
+ |
+
+ @php
+ $assignedCounter++
+ @endphp
+ @endforeach
+ @endif
+ @php
+ $counter++
+ @endphp
+ @endforeach
+
+
+ @endif
+
+ @if ($show_user->licenses->count() > 0)
+
+
{{ trans_choice('general.countable.licenses', $show_user->licenses->count(), ['count' => $show_user->licenses->count()]) }}
+
+
+
+
+
+ # |
+ {{ trans('general.name') }} |
+ {{ trans('admin/licenses/form.license_key') }} |
+ {{ trans('admin/hardware/table.checkout_date') }} |
+
+
+ @php
+ $lcounter = 1;
+ @endphp
+
+ @foreach ($show_user->licenses as $license)
+ @php
+ if ($license->category->getEula()) $eulas[] = $license->category->getEula()
+ @endphp
+
+ {{ $lcounter }} |
+ {{ $license->name }} |
+
+ @can('viewKeys', $license)
+ {{ $license->serial }}
+ @else
+ {{ str_repeat('x', 15) }}
+ @endcan
+ |
+ {{ $license->pivot->updated_at }} |
+
+ @php
+ $lcounter++
+ @endphp
+ @endforeach
+
+ @endif
+
+
+ @if ($show_user->accessories->count() > 0)
+
+
{{ trans_choice('general.countable.accessories', $show_user->accessories->count(), ['count' => $show_user->accessories->count()]) }}
+
+
+
+
+
+ # |
+ {{ trans('general.image') }} |
+ {{ trans('general.name') }} |
+ {{ trans('general.category') }} |
+ {{ trans('admin/hardware/table.checkout_date') }} |
+ {{ trans('general.signature') }} |
+
+
+ @php
+ $acounter = 1;
+ @endphp
+
+ @foreach ($show_user->accessories as $accessory)
+ @if ($accessory)
+ @php
+ if ($accessory->category->getEula()) $eulas[] = $accessory->category->getEula()
+ @endphp
- {{ $counter }}.{{ $assignedCounter }} |
+ {{ $acounter }} |
- @if ($asset->getImageUrl())
-
+ @if ($accessory->getImageUrl())
+
@endif
|
- {{ $asset->asset_tag }} |
- {{ $asset->name }} |
- {{ (($asset->model) && ($asset->model->category)) ? $asset->model->category->name : trans('general.invalid_category') }} |
- {{ ($asset->model) ? $asset->model->name : trans('general.invalid_model') }} |
- {{ ($asset->defaultLoc) ? $asset->defaultLoc->name : '' }} |
- {{ ($asset->location) ? $asset->location->name : '' }} |
- {{ $asset->serial }} |
+ {{ ($accessory->manufacturer) ? $accessory->manufacturer->name : '' }} {{ $accessory->name }} {{ $accessory->model_number }} |
+ {{ $accessory->category->name }} |
+ {{ $accessory->pivot->created_at }} |
+
- {{ Helper::getFormattedDateObject($asset->last_checkout, 'datetime', false) }} |
-
- @if (($asset->assetlog->first()) && ($asset->assetlog->first()->accept_signature!=''))
-
+ @if (($accessory->assetlog->first()) && ($accessory->assetlog->first()->accept_signature!=''))
+
@endif
|
@php
- $assignedCounter++
+ $acounter++
@endphp
- @endforeach
- @endif
- @php
- $counter++
- @endphp
- @endforeach
-
-
- @endif
+ @endif
+ @endforeach
+
+ @endif
- @if ($show_user->licenses->count() > 0)
-
-
{{ trans_choice('general.countable.licenses', $show_user->licenses->count(), ['count' => $show_user->licenses->count()]) }}
-
+ @if ($show_user->consumables->count() > 0)
+
+
{{ trans_choice('general.countable.consumables', $show_user->consumables->count(), ['count' => $show_user->consumables->count()]) }}
+
-
-
-
- # |
- {{ trans('general.name') }} |
- {{ trans('admin/licenses/form.license_key') }} |
- {{ trans('admin/hardware/table.checkout_date') }} |
-
-
- @php
- $lcounter = 1;
- @endphp
-
- @foreach ($show_user->licenses as $license)
- @php
- if ($license->category->getEula()) $eulas[] = $license->category->getEula()
- @endphp
+
+
- {{ $lcounter }} |
- {{ $license->name }} |
-
- @can('viewKeys', $license)
- {{ $license->serial }}
- @else
- {{ str_repeat('x', 15) }}
- @endcan
- |
- {{ $license->pivot->updated_at }} |
+ |
+ {{ trans('general.name') }} |
+ {{ trans('general.category') }} |
+ {{ trans('admin/hardware/table.checkout_date') }} |
+ {{ trans('general.signature') }} |
+
+
@php
- $lcounter++
+ $ccounter = 1;
@endphp
- @endforeach
-
- @endif
-
- @if ($show_user->accessories->count() > 0)
-
-
{{ trans_choice('general.countable.accessories', $show_user->accessories->count(), ['count' => $show_user->accessories->count()]) }}
-
-
-
-
-
- # |
- {{ trans('general.image') }} |
- {{ trans('general.name') }} |
- {{ trans('general.category') }} |
- {{ trans('admin/hardware/table.checkout_date') }} |
- {{ trans('general.signature') }} |
-
-
- @php
- $acounter = 1;
- @endphp
-
- @foreach ($show_user->accessories as $accessory)
- @if ($accessory)
- @php
- if ($accessory->category->getEula()) $eulas[] = $accessory->category->getEula()
- @endphp
-
- {{ $acounter }} |
-
- @if ($accessory->getImageUrl())
-
- @endif
- |
- {{ ($accessory->manufacturer) ? $accessory->manufacturer->name : '' }} {{ $accessory->name }} {{ $accessory->model_number }} |
- {{ $accessory->category->name }} |
- {{ $accessory->pivot->created_at }} |
-
-
- @if (($accessory->assetlog->first()) && ($accessory->assetlog->first()->accept_signature!=''))
-
- @endif
- |
-
- @php
- $acounter++
- @endphp
- @endif
- @endforeach
-
- @endif
-
- @if ($show_user->consumables->count() > 0)
-
-
{{ trans_choice('general.countable.consumables', $show_user->consumables->count(), ['count' => $show_user->consumables->count()]) }}
-
-
-
-
-
- |
- {{ trans('general.name') }} |
- {{ trans('general.category') }} |
- {{ trans('admin/hardware/table.checkout_date') }} |
- {{ trans('general.signature') }} |
-
-
-
- @php
- $ccounter = 1;
- @endphp
-
- @foreach ($show_user->consumables as $consumable)
- @if ($consumable)
- @php
- if ($consumable->category->getEula()) $eulas[] = $consumable->category->getEula()
- @endphp
-
- {{ $ccounter }} |
-
- @if ($consumable->deleted_at!='')
- | {{ ($consumable->manufacturer) ? $consumable->manufacturer->name : '' }} {{ $consumable->name }} {{ $consumable->model_number }} |
- @else
- {{ ($consumable->manufacturer) ? $consumable->manufacturer->name : '' }} {{ $consumable->name }} {{ $consumable->model_number }}
- @endif
-
- {{ ($consumable->category) ? $consumable->category->name : ' invalid/deleted category' }} |
- {{ $consumable->pivot->created_at }} |
+ @foreach ($show_user->consumables as $consumable)
+ @if ($consumable)
+ @php
+ if ($consumable->category->getEula()) $eulas[] = $consumable->category->getEula()
+ @endphp
+
+ {{ $ccounter }} |
- @if (($consumable->assetlog->first()) && ($consumable->assetlog->first()->accept_signature!=''))
-
+ @if ($consumable->deleted_at!='')
+ | {{ ($consumable->manufacturer) ? $consumable->manufacturer->name : '' }} {{ $consumable->name }} {{ $consumable->model_number }} |
+ @else
+ {{ ($consumable->manufacturer) ? $consumable->manufacturer->name : '' }} {{ $consumable->name }} {{ $consumable->model_number }}
@endif
-
-
+
+ {{ ($consumable->category) ? $consumable->category->name : ' invalid/deleted category' }} |
+ {{ $consumable->pivot->created_at }} |
+
+ @if (($consumable->assetlog->first()) && ($consumable->assetlog->first()->accept_signature!=''))
+
+ @endif
+ |
+
+ @php
+ $ccounter++
+ @endphp
+ @endif
+ @endforeach
+
+ @endif
+
+
+
+
+
+
+
+
+ EULA |
+
@php
- $ccounter++
+ if (!empty($eulas)) $eulas = array_unique($eulas);
@endphp
- @endif
- @endforeach
+ @if (!empty($eulas))
+ @foreach ($eulas as $key => $eula)
+ {!! $eula !!}
+ @endforeach
+ @endif
+ |
+
+
+ {{ trans('general.signed_off_by') }}: |
+ ______________________________________ |
+ ______________________________________ |
+ _____________ |
+
+
+ |
+ {{ trans('general.name') }} |
+ {{ trans('general.signature') }} |
+ {{ trans('general.date') }} |
+
+
+ {{ trans('admin/users/table.manager') }}: |
+ ______________________________________ |
+ ______________________________________ |
+ _____________ |
+
+
+ |
+ {{ trans('general.name') }} |
+ {{ trans('general.signature') }} |
+ {{ trans('general.date') }} |
+ |
+
+
- @endif
-
-
-
-
-
-
-
-
- EULA |
-
- @php
- if (!empty($eulas)) $eulas = array_unique($eulas);
- @endphp
- @if (!empty($eulas))
- @foreach ($eulas as $key => $eula)
- {!! $eula !!}
- @endforeach
- @endif
- |
-
-
- {{ trans('general.signed_off_by') }}: |
- ______________________________________ |
- ______________________________________ |
- _____________ |
-
-
- |
- {{ trans('general.name') }} |
- {{ trans('general.signature') }} |
- {{ trans('general.date') }} |
-
-
- {{ trans('admin/users/table.manager') }}: |
- ______________________________________ |
- ______________________________________ |
- _____________ |
-
-
- |
- {{ trans('general.name') }} |
- {{ trans('general.signature') }} |
- {{ trans('general.date') }} |
- |
-
-
-
+ @endforeach
@endsection