diff --git a/app/Models/License.php b/app/Models/License.php index 494d8ca8b0..162bea4c3e 100755 --- a/app/Models/License.php +++ b/app/Models/License.php @@ -16,6 +16,14 @@ use Watson\Validating\ValidatingTrait; class License extends Depreciable { protected $presenter = 'App\Presenters\LicensePresenter'; + + /** + * Set static properties to determine which checkout/checkin handlers we should use + */ + public static $checkoutClass = CheckoutLicenseNotification::class; + public static $checkinClass = CheckinLicenseNotification::class; + + use SoftDeletes; use CompanyableTrait; use Loggable, Presentable; diff --git a/app/Models/Loggable.php b/app/Models/Loggable.php index a325762d4a..cdebaf11b4 100644 --- a/app/Models/Loggable.php +++ b/app/Models/Loggable.php @@ -76,6 +76,7 @@ trait Loggable $checkoutClass = null; if (method_exists($target, 'notify')) { + \Log::debug('This target is notifiable'); $target->notify(new static::$checkoutClass($params)); } @@ -83,6 +84,7 @@ trait Loggable $recipient = new \App\Models\Recipients\AdminRecipient(); if (($settings->admin_cc_email!='') && (static::$checkoutClass!='')) { + \Log::debug('Send an email to the admin - '.$settings->admin_cc_email); $recipient->notify(new static::$checkoutClass($params)); } diff --git a/resources/lang/en/admin/categories/general.php b/resources/lang/en/admin/categories/general.php index 16b3b79f51..7551fefffd 100644 --- a/resources/lang/en/admin/categories/general.php +++ b/resources/lang/en/admin/categories/general.php @@ -5,7 +5,8 @@ return array( 'about_categories' => 'Categories help you organize your items. Some example categories might be "Desktops", "Laptops", "Mobile Phones", "Tablets", and so on, but you can use categories any way that makes sense for you.', 'asset_categories' => 'Asset Categories', 'category_name' => 'Category Name', - 'checkin_email' => 'Send email to user on checkin.', + 'checkin_email' => 'Send email to user on checkin/checkout.', + 'checkin_email_notification' => 'This user will be sent an email on checkin/checkout.', 'clone' => 'Clone Category', 'create' => 'Create Category', 'edit' => 'Edit Category', diff --git a/resources/views/licenses/checkout.blade.php b/resources/views/licenses/checkout.blade.php index 7e348e9e05..1fe0c4280e 100755 --- a/resources/views/licenses/checkout.blade.php +++ b/resources/views/licenses/checkout.blade.php @@ -57,6 +57,40 @@ + + + @if ($license->requireAcceptance() || $license->getEula() || ($snipeSettings->slack_endpoint!='')) +
+
+
+ + @if ($license->requireAcceptance()) + + {{ trans('admin/categories/general.required_acceptance') }} +
+ @endif + + @if ($license->getEula()) + + {{ trans('admin/categories/general.required_eula') }} +
+ @endif + + @if (($license->category) && ($license->category->checkin_email)) + + {{ trans('admin/categories/general.checkin_email_notification') }} +
+ @endif + + @if ($snipeSettings->slack_endpoint!='') + + A slack message will be sent + @endif +
+
+
+ @endif +