From 5516978f2e004001b0c60b64418310ab00c23ca5 Mon Sep 17 00:00:00 2001 From: Ivan Nieto Date: Thu, 11 Oct 2018 16:08:09 -0500 Subject: [PATCH] #5696 proposed fix (#6314) * Another 'or' caught in a blade template * Added the requireAcceptance() method in LicenseSeat.php. Changed the permission in checkout-license mail to view. * Getting right the permission in the view checkout-license --- app/Models/LicenseSeat.php | 12 ++++++++++++ .../markdown/checkout-license.blade.php | 2 +- resources/views/vendor/mail/html/button.blade.php | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/app/Models/LicenseSeat.php b/app/Models/LicenseSeat.php index ab514c0a58..e86959f152 100755 --- a/app/Models/LicenseSeat.php +++ b/app/Models/LicenseSeat.php @@ -29,6 +29,18 @@ class LicenseSeat extends SnipeModel implements ICompanyableChild return ['asset', 'license']; } + /** + * Determine whether the user should be required to accept the license + * + * @author A. Gianotto + * @since [v4.0] + * @return boolean + */ + public function requireAcceptance() + { + return $this->license->category->require_acceptance; + } + public function getEula() { return $this->license->getEula(); } diff --git a/resources/views/notifications/markdown/checkout-license.blade.php b/resources/views/notifications/markdown/checkout-license.blade.php index f267816be5..f838751125 100644 --- a/resources/views/notifications/markdown/checkout-license.blade.php +++ b/resources/views/notifications/markdown/checkout-license.blade.php @@ -16,7 +16,7 @@ @if (isset($item->category)) | **{{ trans('general.category') }}** | {{ $item->category->name }} | @endif -@if ($target->can('update', $item)) +@if ($target->can('view', $item)) | **Key** | {{ $item->serial }} | @endif @if ($note) diff --git a/resources/views/vendor/mail/html/button.blade.php b/resources/views/vendor/mail/html/button.blade.php index c7aae1b885..bf35c79183 100644 --- a/resources/views/vendor/mail/html/button.blade.php +++ b/resources/views/vendor/mail/html/button.blade.php @@ -7,7 +7,7 @@
- {{ $slot }} + {{ $slot }}