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()]) }} +

+
- - - - - - - - - - - - - - - - @foreach ($show_user->assets as $asset) - @php - if ($asset->model->category->getEula()) $eulas[] = $asset->model->category->getEula() - @endphp - - - - - - - - - - - - - - @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') }}
{{ $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 -
+ + + + + + + + + + + + + + + @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) + + + + + + + + + + + + + + @if ($settings->show_assigned_assets) + @php + $assignedCounter = 1; + @endphp + @foreach ($asset->assignedAssets as $asset) + + + + + + + + + + + + + + @php + $assignedCounter++ + @endphp + @endforeach + @endif + @php + $counter++ + @endphp + @endforeach + +
#{{ 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') }}
{{ $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 +
{{ $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 +
+ @endif + + @if ($show_user->licenses->count() > 0) +
+

{{ trans_choice('general.countable.licenses', $show_user->licenses->count(), ['count' => $show_user->licenses->count()]) }}

+
+ + + + + + + + + + + @php + $lcounter = 1; + @endphp + + @foreach ($show_user->licenses as $license) + @php + if ($license->category->getEula()) $eulas[] = $license->category->getEula() + @endphp + + + + + + + @php + $lcounter++ + @endphp + @endforeach +
#{{ trans('general.name') }}{{ trans('admin/licenses/form.license_key') }}{{ trans('admin/hardware/table.checkout_date') }}
{{ $lcounter }}{{ $license->name }} + @can('viewKeys', $license) + {{ $license->serial }} + @else + {{ str_repeat('x', 15) }} + @endcan + {{ $license->pivot->updated_at }}
+ @endif + + + @if ($show_user->accessories->count() > 0) +
+

{{ trans_choice('general.countable.accessories', $show_user->accessories->count(), ['count' => $show_user->accessories->count()]) }}

+
+ + + + + + + + + + + + + @php + $acounter = 1; + @endphp + + @foreach ($show_user->accessories as $accessory) + @if ($accessory) + @php + if ($accessory->category->getEula()) $eulas[] = $accessory->category->getEula() + @endphp - + - - - - - - - + + + + - @php - $assignedCounter++ + $acounter++ @endphp - @endforeach - @endif - @php - $counter++ - @endphp - @endforeach - -
#{{ trans('general.image') }}{{ trans('general.name') }}{{ trans('general.category') }}{{ trans('admin/hardware/table.checkout_date') }}{{ trans('general.signature') }}
{{ $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
- @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()]) }}

+
- - - - - - - - - - @php - $lcounter = 1; - @endphp - - @foreach ($show_user->licenses as $license) - @php - if ($license->category->getEula()) $eulas[] = $license->category->getEula() - @endphp +
#{{ trans('general.name') }}{{ trans('admin/licenses/form.license_key') }}{{ trans('admin/hardware/table.checkout_date') }}
+ - - - - + + + + + + + @php - $lcounter++ + $ccounter = 1; @endphp - @endforeach -
{{ $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') }}
- @endif - - @if ($show_user->accessories->count() > 0) -
-

{{ trans_choice('general.countable.accessories', $show_user->accessories->count(), ['count' => $show_user->accessories->count()]) }}

-
- - - - - - - - - - - - - @php - $acounter = 1; - @endphp - - @foreach ($show_user->accessories as $accessory) - @if ($accessory) - @php - if ($accessory->category->getEula()) $eulas[] = $accessory->category->getEula() - @endphp - - - - - - - - - - @php - $acounter++ - @endphp - @endif - @endforeach -
#{{ trans('general.image') }}{{ trans('general.name') }}{{ trans('general.category') }}{{ trans('admin/hardware/table.checkout_date') }}{{ trans('general.signature') }}
{{ $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 -
- @endif - - @if ($show_user->consumables->count() > 0) -
-

{{ trans_choice('general.countable.consumables', $show_user->consumables->count(), ['count' => $show_user->consumables->count()]) }}

-
- - - - - - - - - - - - - @php - $ccounter = 1; - @endphp - - @foreach ($show_user->consumables as $consumable) - @if ($consumable) - @php - if ($consumable->category->getEula()) $eulas[] = $consumable->category->getEula() - @endphp - - - - @else - {{ ($consumable->manufacturer) ? $consumable->manufacturer->name : '' }} {{ $consumable->name }} {{ $consumable->model_number }} - @endif - - - + @foreach ($show_user->consumables as $consumable) + @if ($consumable) + @php + if ($consumable->category->getEula()) $eulas[] = $consumable->category->getEula() + @endphp + + + @else + {{ ($consumable->manufacturer) ? $consumable->manufacturer->name : '' }} {{ $consumable->name }} {{ $consumable->model_number }} @endif - - + + + + + + @php + $ccounter++ + @endphp + @endif + @endforeach +
{{ trans('general.name') }}{{ trans('general.category') }}{{ trans('admin/hardware/table.checkout_date') }}{{ trans('general.signature') }}
{{ $ccounter }} - @if ($consumable->deleted_at!='') - {{ ($consumable->manufacturer) ? $consumable->manufacturer->name : '' }} {{ $consumable->name }} {{ $consumable->model_number }}{{ ($consumable->category) ? $consumable->category->name : ' invalid/deleted category' }} {{ $consumable->pivot->created_at }}
{{ $ccounter }} - @if (($consumable->assetlog->first()) && ($consumable->assetlog->first()->accept_signature!='')) - + @if ($consumable->deleted_at!='') + {{ ($consumable->manufacturer) ? $consumable->manufacturer->name : '' }} {{ $consumable->name }} {{ $consumable->model_number }}
{{ ($consumable->category) ? $consumable->category->name : ' invalid/deleted category' }} {{ $consumable->pivot->created_at }} + @if (($consumable->assetlog->first()) && ($consumable->assetlog->first()->accept_signature!='')) + + @endif +
+ @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