Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added EULAs in print user's assets #14769

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 42 additions & 19 deletions resources/views/users/print.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@
{{ ($show_user->employee_num!='') ? ' (#'.$show_user->employee_num.') ' : '' }}
{{ ($show_user->jobtitle!='' ? ' - '.$show_user->jobtitle : '') }}
</h3>
<p></p>{{ trans('admin/users/general.all_assigned_list_generation')}} {{ Helper::getFormattedDateObject(now(), 'datetime', false) }}</body>
<p></p>{{ trans('admin/users/general.all_assigned_list_generation')}} {{ Helper::getFormattedDateObject(now(), 'datetime', false) }}

</body>

@if ($assets->count() > 0)
@php
$counter = 1;
Expand Down Expand Up @@ -118,7 +121,9 @@ class="snipe-table table table-striped inventory"
</thead>
<tbody>
@foreach ($assets as $asset)

@php
if ($asset->model->category->getEula()) $eulas[] = $asset->model->category->getEula()
@endphp
<tr>
<td>{{ $counter }}</td>
<td>
Expand Down Expand Up @@ -146,7 +151,6 @@ class="snipe-table table table-striped inventory"
$assignedCounter = 1;
@endphp
@foreach ($asset->assignedAssets as $asset)

<tr>
<td>{{ $counter }}.{{ $assignedCounter }}</td>
<td data-formatter="imageFormatter">
Expand Down Expand Up @@ -209,7 +213,9 @@ class="snipe-table table table-striped inventory"
@endphp

@foreach ($licenses as $license)

@php
if ($license->category->getEula()) $eulas[] = $license->category->getEula()
@endphp
<tr>
<td>{{ $lcounter }}</td>
<td>{{ $license->name }}</td>
Expand All @@ -229,7 +235,6 @@ class="snipe-table table table-striped inventory"
</table>
@endif


@if ($accessories->count() > 0)
<div id="accessories-toolbar">
<h4>{{ trans_choice('general.countable.accessories', $accessories->count(), ['count' => $accessories->count()]) }}</h4>
Expand Down Expand Up @@ -265,6 +270,9 @@ class="snipe-table table table-striped inventory"

@foreach ($accessories as $accessory)
@if ($accessory)
@php
if ($accessory->category->getEula()) $eulas[] = $accessory->category->getEula()
@endphp
<tr>
<td>{{ $acounter }}</td>
<td>
Expand All @@ -275,7 +283,6 @@ class="snipe-table table table-striped inventory"
<td>{{ ($accessory->manufacturer) ? $accessory->manufacturer->name : '' }} {{ $accessory->name }} {{ $accessory->model_number }}</td>
<td>{{ $accessory->category->name }}</td>
<td>{{ $accessory->pivot->created_at }}</td>

<td>
@if (($accessory->assetlog->first()) && ($accessory->assetlog->first()->accept_signature!=''))
<img style="width:auto;height:100px;" src="{{ asset('/') }}display-sig/{{ $accessory->assetlog->first()->accept_signature }}">
Expand Down Expand Up @@ -316,7 +323,6 @@ class="snipe-table table table-striped inventory"
<th style="width: 50%;" data-sortable="true">{{ trans('general.category') }}</th>
<th style="width: 10%;" data-sortable="true">{{ trans('admin/hardware/table.checkout_date') }}</th>
<th style="width: 10%;" data-sortable="true">{{ trans('general.signature') }}</th>

</tr>
</thead>
@php
Expand All @@ -325,10 +331,11 @@ class="snipe-table table table-striped inventory"

@foreach ($consumables as $consumable)
@if ($consumable)
@php
if ($consumable->category->getEula()) $eulas[] = $consumable->category->getEula()
@endphp
<tr>
<td>{{ $ccounter }}</td>


<td>
@if ($consumable->deleted_at!='')
<td>{{ ($consumable->manufacturer) ? $consumable->manufacturer->name : '' }} {{ $consumable->name }} {{ $consumable->model_number }}</td>
Expand All @@ -352,25 +359,44 @@ class="snipe-table table table-striped inventory"
</table>
@endif

<p></p>
<div class="pull-right">
<button class="btn btn-default" type="button" data-toggle="collapse" data-target="#eula-row" aria-expanded="false" aria-controls="eula-row" title="EULAs">
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this button show up on the print version?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@snipe I was in doubt if hide or not but I have seen that the other 2 buttons in the page are printable, so I didn't use a different behavior, but I prefer to hide them. So if you agree I hide all 3 buttons with the property hidden-print

<i class="fa fa-eye-slash"></i>
</button>
</div>

<table style="margin-top: 80px;">
<tr class="collapse" id="eula-row">
<td style="padding-right: 10px; vertical-align: top; font-weight: bold;">EULA</td>
<td style="padding-right: 10px; vertical-align: top; padding-bottom: 80px;" colspan="3">
@php
if (!empty($eulas)) $eulas = array_unique($eulas);
@endphp
@if (!empty($eulas))
@foreach ($eulas as $key => $eula)
{!! $eula !!}
@endforeach
@endif
</td>
</tr>
<tr>
<td style="padding-right: 10px; vertical-align: top; font-weight: bold;">{{ trans('general.signed_off_by') }}:</td>
<td style="padding-right: 10px; vertical-align: top;">________________________________________________________</td>
<td style="padding-right: 10px; vertical-align: top;">________________________________________________________</td>
<td>_____________________</td>
<td style="padding-right: 10px; vertical-align: top;">______________________________________</td>
<td style="padding-right: 10px; vertical-align: top;">______________________________________</td>
<td>_____________</td>
</tr>
<tr style="height: 80px;">
<td></td>
<td style="padding-right: 10px; vertical-align: top;">Name</td>
<td style="padding-right: 10px; vertical-align: top;">Signature</td>
<td style="padding-right: 10px; vertical-align: top;">{{ trans('general.date') }}</td>
</tr>

<tr>
<td style="padding-right: 10px; vertical-align: top; font-weight: bold;">{{ trans('admin/users/table.manager') }}:</td>
<td style="padding-right: 10px; vertical-align: top;">________________________________________________________</td>
<td style="padding-right: 10px; vertical-align: top;">________________________________________________________</td>
<td>_____________________</td>
<td style="padding-right: 10px; vertical-align: top;">______________________________________</td>
<td style="padding-right: 10px; vertical-align: top;">______________________________________</td>
<td>_____________</td>
</tr>
<tr>
<td></td>
Expand All @@ -379,14 +405,12 @@ class="snipe-table table table-striped inventory"
<td style="padding-right: 10px; vertical-align: top;">{{ trans('general.date') }}</td>
<td></td>
</tr>

</table>

{{-- Javascript files --}}
<script src="{{ url(mix('js/dist/all.js')) }}" nonce="{{ csrf_token() }}"></script>
<script defer src="{{ url(mix('js/dist/all-defer.js')) }}" nonce="{{ csrf_token() }}"></script>


@push('css')
<link rel="stylesheet" href="{{ url(mix('css/dist/bootstrap-table.css')) }}">
@endpush
Expand Down Expand Up @@ -472,6 +496,5 @@ classes: 'table table-responsive table-no-bordered',
</script>



</body>
</html>
Loading