From b0897a1fc90d5a992c0b04b14c4282e1912f5834 Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Thu, 23 Jun 2022 11:52:35 -0700 Subject: [PATCH] adds acceptance for consumables and components --- .../Account/AcceptanceController.php | 19 ++++++++ .../accept/accept-component-eula.blade.php | 47 +++++++++++++++++++ .../accept/accept-consumable-eula.blade.php | 47 +++++++++++++++++++ 3 files changed, 113 insertions(+) create mode 100644 resources/views/account/accept/accept-component-eula.blade.php create mode 100644 resources/views/account/accept/accept-consumable-eula.blade.php diff --git a/app/Http/Controllers/Account/AcceptanceController.php b/app/Http/Controllers/Account/AcceptanceController.php index 78b2907332..e81a0329de 100644 --- a/app/Http/Controllers/Account/AcceptanceController.php +++ b/app/Http/Controllers/Account/AcceptanceController.php @@ -16,6 +16,8 @@ use App\Models\User; use App\Models\AssetModel; use App\Models\Accessory; use App\Models\License; +use App\Models\Component; +use App\Models\Consumable; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; @@ -24,6 +26,7 @@ use Illuminate\Support\Str; use App\Http\Controllers\SettingsController; use Barryvdh\DomPDF\Facade\Pdf; use Carbon\Carbon; +use phpDocumentor\Reflection\Types\Compound; class AcceptanceController extends Controller { @@ -141,18 +144,34 @@ class AcceptanceController extends Controller $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->license_id); $display_model = $license->name; $assigned_to = User::find($acceptance->assigned_to_id)->present()->fullName; break; + + case 'App\Models\Component': + $pdf_view_route ='account.accept.accept-component-eula'; + $component = Component::find($item->id); + $display_model = $component->name; + $assigned_to = User::find($acceptance->assigned_to_id)->present()->fullName; + break; + + case 'App\Models\Consumable': + $pdf_view_route ='account.accept.accept-consumable-eula'; + $consumable = Consumable::find($item->id); + $display_model = $consumable->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'; diff --git a/resources/views/account/accept/accept-component-eula.blade.php b/resources/views/account/accept/accept-component-eula.blade.php new file mode 100644 index 0000000000..258894342f --- /dev/null +++ b/resources/views/account/accept/accept-component-eula.blade.php @@ -0,0 +1,47 @@ + + + + + + + + + + +@if ($logo) +
+ +

{{$company_name}}

+
+@endif +
+ +

+ {{ trans('general.date') }}: {{ date($date_settings) }}
+ {{ trans('general.component') }}: {{ $item_model }}
+

+ +@if ($eula) +
+ {!! $eula !!} +
+@endif + + +

+ Assigned on: {{$check_out_date}}
+ Assigned to: {{$assigned_to}}
+ Accepted on: {{$accepted_date}} +

+ + +@if ($signature!='') + +@endif + + \ No newline at end of file diff --git a/resources/views/account/accept/accept-consumable-eula.blade.php b/resources/views/account/accept/accept-consumable-eula.blade.php new file mode 100644 index 0000000000..3800ca01af --- /dev/null +++ b/resources/views/account/accept/accept-consumable-eula.blade.php @@ -0,0 +1,47 @@ + + + + + + + + + + +@if ($logo) +
+ +

{{$company_name}}

+
+@endif +
+ +

+ {{ trans('general.date') }}: {{ date($date_settings) }}
+ {{ trans('general.consumable') }}: {{ $item_model }}
+

+ +@if ($eula) +
+ {!! $eula !!} +
+@endif + + +

+ Assigned on: {{$check_out_date}}
+ Assigned to: {{$assigned_to}}
+ Accepted on: {{$accepted_date}} +

+ + +@if ($signature!='') + +@endif + + \ No newline at end of file