mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 21:24:13 -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
|
||||
{
|
||||
protected $presenter = 'App\Presenters\AssetPresenter';
|
||||
use Loggable, Requestable, Presentable, Notifiable, SoftDeletes, ValidatingTrait, UniqueUndeletedTrait;
|
||||
use Loggable, Requestable, Presentable, SoftDeletes, ValidatingTrait, UniqueUndeletedTrait;
|
||||
|
||||
const LOCATION = 'location';
|
||||
const ASSET = 'asset';
|
||||
|
|
|
@ -19,6 +19,14 @@ class Component extends SnipeModel
|
|||
|
||||
protected $dates = ['deleted_at', 'purchase_date'];
|
||||
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
|
||||
*/
|
||||
|
|
|
@ -73,16 +73,16 @@ trait Loggable
|
|||
'settings' => $settings,
|
||||
];
|
||||
|
||||
|
||||
// Send to the admin, if settings dictate
|
||||
$recipient = new \App\Models\Recipients\AdminRecipient();
|
||||
|
||||
$checkoutClass = null;
|
||||
|
||||
if (method_exists($target, 'notify')) {
|
||||
$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));
|
||||
}
|
||||
|
||||
|
@ -140,8 +140,6 @@ trait Loggable
|
|||
'settings' => $settings,
|
||||
];
|
||||
|
||||
// Send to the admin, if settings dictate
|
||||
$recipient = new \App\Models\Recipients\AdminRecipient();
|
||||
|
||||
$checkoutClass = null;
|
||||
|
||||
|
@ -149,7 +147,10 @@ trait Loggable
|
|||
$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));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue