mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 06:17:28 -08:00
adds eula blade for licenses and fixes assigned_to for dom_pdf
This commit is contained in:
parent
366f3aacef
commit
df76e6eacf
|
@ -133,19 +133,39 @@ class AcceptanceController extends Controller
|
|||
|
||||
|
||||
// this is horrible
|
||||
if ($acceptance->checkoutable_type == 'App\Models\Asset') {
|
||||
$pdf_view_route ='account.accept.accept-asset-eula';
|
||||
$asset_model = AssetModel::find($item->model_id);
|
||||
$display_model = $asset_model->name;
|
||||
$assigned_to = User::find($item->assigned_to)->present()->fullName;
|
||||
|
||||
} elseif ($acceptance->checkoutable_type== 'App\Models\Accessory') {
|
||||
$pdf_view_route ='account.accept.accept-accessory-eula';
|
||||
$accessory = Accessory::find($item->id);
|
||||
$display_model = $accessory->name;
|
||||
$assigned_to = User::find($item->assignedTo);
|
||||
|
||||
switch($acceptance->checkoutable_type){
|
||||
case 'App\Models\Asset':
|
||||
$pdf_view_route ='account.accept.accept-asset-eula';
|
||||
$asset_model = AssetModel::find($item->model_id);
|
||||
$display_model = $asset_model->name;
|
||||
$assigned_to = User::find($acceptance->assigned_to_id)->present()->fullName;
|
||||
break;
|
||||
case 'App\Models\Accessory':
|
||||
$pdf_view_route ='account.accept.accept-accessory-eula';
|
||||
$accessory = Accessory::find($item->id);
|
||||
$display_model = $accessory->name;
|
||||
$assigned_to = User::find($item->assignedTo);
|
||||
break;
|
||||
case 'App\Models\LicenseSeat':
|
||||
$pdf_view_route ='account.accept.accept-license-eula';
|
||||
$license = License::find($item->id);
|
||||
$display_model = $license->name;
|
||||
$assigned_to = User::find($acceptance->assigned_to_id)->present()->fullName;
|
||||
break;
|
||||
}
|
||||
// if ($acceptance->checkoutable_type == 'App\Models\Asset') {
|
||||
// $pdf_view_route ='account.accept.accept-asset-eula';
|
||||
// $asset_model = AssetModel::find($item->model_id);
|
||||
// $display_model = $asset_model->name;
|
||||
// $assigned_to = User::find($item->assigned_to)->present()->fullName;
|
||||
//
|
||||
// } elseif ($acceptance->checkoutable_type== 'App\Models\Accessory') {
|
||||
// $pdf_view_route ='account.accept.accept-accessory-eula';
|
||||
// $accessory = Accessory::find($item->id);
|
||||
// $display_model = $accessory->name;
|
||||
// $assigned_to = User::find($item->assignedTo);
|
||||
//
|
||||
// }
|
||||
|
||||
/**
|
||||
* Gather the data for the PDF. We fire this whether there is a signature required or not,
|
||||
|
|
47
resources/views/account/accept/accept-license-eula.blade.php
Normal file
47
resources/views/account/accept/accept-license-eula.blade.php
Normal file
|
@ -0,0 +1,47 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<style>
|
||||
body {
|
||||
font-family:'Dejavu Sans', Arial, Helvetica, sans-serif;
|
||||
font-size: 11px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@if ($logo)
|
||||
<center>
|
||||
<img src="{{ $logo }}">
|
||||
<p>{{$company_name}}</p>
|
||||
</center>
|
||||
@endif
|
||||
<br>
|
||||
|
||||
<p>
|
||||
{{ trans('general.date') }}: {{ date($date_settings) }} <br>
|
||||
{{ trans('general.license') }}: {{ $item_model }}<br>
|
||||
</p>
|
||||
|
||||
@if ($eula)
|
||||
<hr>
|
||||
{!! $eula !!}
|
||||
<hr>
|
||||
@endif
|
||||
|
||||
|
||||
<p>
|
||||
Assigned on: {{$check_out_date}}<br>
|
||||
Assigned to: {{$assigned_to}}<br>
|
||||
Accepted on: {{$accepted_date}}
|
||||
</p>
|
||||
|
||||
|
||||
@if ($signature!='')
|
||||
<img src="{{ $signature }}" style="max-width: 600px; border-bottom: black solid 1px;">
|
||||
@endif
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in a new issue