mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-21 03:15:45 -08:00
Fix checkouts for licenses
This commit is contained in:
parent
25e859c866
commit
fc043a35d9
|
@ -38,13 +38,7 @@ class CheckoutableListener
|
||||||
// @todo: get sent for models that don't have email addresses associated...
|
// @todo: get sent for models that don't have email addresses associated...
|
||||||
if (Setting::getSettings() && Setting::getSettings()->webhook_endpoint) {
|
if (Setting::getSettings() && Setting::getSettings()->webhook_endpoint) {
|
||||||
Notification::route('slack', Setting::getSettings()->webhook_endpoint)
|
Notification::route('slack', Setting::getSettings()->webhook_endpoint)
|
||||||
->notify(new CheckoutAssetNotification(
|
->notify($this->getCheckoutNotification($event));
|
||||||
$event->checkoutable,
|
|
||||||
$event->checkedOutTo,
|
|
||||||
$event->checkedOutBy,
|
|
||||||
null,
|
|
||||||
$event->note)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -53,6 +47,7 @@ class CheckoutableListener
|
||||||
$acceptance = $this->getCheckoutAcceptance($event);
|
$acceptance = $this->getCheckoutAcceptance($event);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
// @todo: wrap notification above in this try
|
||||||
if (! $event->checkedOutTo->locale) {
|
if (! $event->checkedOutTo->locale) {
|
||||||
Notification::locale(Setting::getSettings()->locale)->send(
|
Notification::locale(Setting::getSettings()->locale)->send(
|
||||||
$this->getNotifiables($event),
|
$this->getNotifiables($event),
|
||||||
|
@ -193,7 +188,7 @@ class CheckoutableListener
|
||||||
* @param CheckoutAcceptance $acceptance
|
* @param CheckoutAcceptance $acceptance
|
||||||
* @return Notification
|
* @return Notification
|
||||||
*/
|
*/
|
||||||
private function getCheckoutNotification($event, $acceptance)
|
private function getCheckoutNotification($event, $acceptance = null)
|
||||||
{
|
{
|
||||||
$notificationClass = null;
|
$notificationClass = null;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue