mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 14:27:33 -08:00
Fixed component checkout bug
This commit is contained in:
parent
69478aea58
commit
983786c29f
|
@ -24,7 +24,7 @@ use App\Notifications\CheckoutAssetNotification;
|
||||||
class Asset extends Depreciable
|
class Asset extends Depreciable
|
||||||
{
|
{
|
||||||
protected $presenter = 'App\Presenters\AssetPresenter';
|
protected $presenter = 'App\Presenters\AssetPresenter';
|
||||||
use Loggable, Requestable, Presentable, Notifiable, SoftDeletes, ValidatingTrait, UniqueUndeletedTrait;
|
use Loggable, Requestable, Presentable, SoftDeletes, ValidatingTrait, UniqueUndeletedTrait;
|
||||||
|
|
||||||
const LOCATION = 'location';
|
const LOCATION = 'location';
|
||||||
const ASSET = 'asset';
|
const ASSET = 'asset';
|
||||||
|
|
|
@ -19,6 +19,14 @@ class Component extends SnipeModel
|
||||||
|
|
||||||
protected $dates = ['deleted_at', 'purchase_date'];
|
protected $dates = ['deleted_at', 'purchase_date'];
|
||||||
protected $table = 'components';
|
protected $table = 'components';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set static properties to determine which checkout/checkin handlers we should use
|
||||||
|
*/
|
||||||
|
public static $checkoutClass = null;
|
||||||
|
public static $checkinClass = null;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Category validation rules
|
* Category validation rules
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -73,16 +73,16 @@ trait Loggable
|
||||||
'settings' => $settings,
|
'settings' => $settings,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
$checkoutClass = null;
|
||||||
// Send to the admin, if settings dictate
|
|
||||||
$recipient = new \App\Models\Recipients\AdminRecipient();
|
|
||||||
|
|
||||||
|
|
||||||
if (method_exists($target, 'notify')) {
|
if (method_exists($target, 'notify')) {
|
||||||
$target->notify(new static::$checkoutClass($params));
|
$target->notify(new static::$checkoutClass($params));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($settings->admin_cc_email!='') {
|
// Send to the admin, if settings dictate
|
||||||
|
$recipient = new \App\Models\Recipients\AdminRecipient();
|
||||||
|
|
||||||
|
if (($settings->admin_cc_email!='') && (static::$checkoutClass!='')) {
|
||||||
$recipient->notify(new static::$checkoutClass($params));
|
$recipient->notify(new static::$checkoutClass($params));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -140,8 +140,6 @@ trait Loggable
|
||||||
'settings' => $settings,
|
'settings' => $settings,
|
||||||
];
|
];
|
||||||
|
|
||||||
// Send to the admin, if settings dictate
|
|
||||||
$recipient = new \App\Models\Recipients\AdminRecipient();
|
|
||||||
|
|
||||||
$checkoutClass = null;
|
$checkoutClass = null;
|
||||||
|
|
||||||
|
@ -149,7 +147,10 @@ trait Loggable
|
||||||
$target->notify(new static::$checkinClass($params));
|
$target->notify(new static::$checkinClass($params));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($settings->admin_cc_email!='') {
|
// Send to the admin, if settings dictate
|
||||||
|
$recipient = new \App\Models\Recipients\AdminRecipient();
|
||||||
|
|
||||||
|
if (($settings->admin_cc_email!='') && (static::$checkoutClass!='')) {
|
||||||
$recipient->notify(new static::$checkinClass($params));
|
$recipient->notify(new static::$checkinClass($params));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue