mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-11 05:47:28 -08:00
* Fix problem when using ValidatingTrait * Checking that email alerts are enabled when trying to send expected check-in alerts (fix for issue #6169)
This commit is contained in:
parent
e45b4efa1a
commit
05b03df600
|
@ -57,17 +57,12 @@ class SendExpectedCheckinAlerts extends Command
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Send a rollup to the admin, if settings dictate
|
// Send a rollup to the admin, if settings dictate
|
||||||
$recipient = new \App\Models\Recipients\AlertRecipient();
|
$recipient = new \App\Models\Recipients\AlertRecipient();
|
||||||
|
|
||||||
if (($assets) && ($assets->count() > 0) && ($settings->alert_email!='')) {
|
if (($assets) && ($assets->count() > 0) && ($settings->alerts_enabled && $settings->alert_email != '')) {
|
||||||
$recipient->notify(new ExpectedCheckinAdminNotification($assets));
|
$recipient->notify(new ExpectedCheckinAdminNotification($assets));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,9 +12,14 @@ use Illuminate\Validation\Rule;
|
||||||
|
|
||||||
class CustomField extends Model
|
class CustomField extends Model
|
||||||
{
|
{
|
||||||
use ValidatingTrait, UniqueUndeletedTrait;
|
use ValidatingTrait,
|
||||||
public $guarded=["id"];
|
UniqueUndeletedTrait;
|
||||||
public static $PredefinedFormats=[
|
|
||||||
|
public $guarded = [
|
||||||
|
"id"
|
||||||
|
];
|
||||||
|
|
||||||
|
public static $PredefinedFormats = [
|
||||||
"ANY" => "",
|
"ANY" => "",
|
||||||
"CUSTOM REGEX" => "",
|
"CUSTOM REGEX" => "",
|
||||||
"ALPHA" => "alpha",
|
"ALPHA" => "alpha",
|
||||||
|
@ -31,6 +36,14 @@ class CustomField extends Model
|
||||||
"BOOLEAN" => "boolean",
|
"BOOLEAN" => "boolean",
|
||||||
];
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validation rules.
|
||||||
|
* At least empty array must be provided if using ValidatingTrait.
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $rules = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The attributes that are mass assignable.
|
* The attributes that are mass assignable.
|
||||||
*
|
*
|
||||||
|
@ -57,7 +70,6 @@ class CustomField extends Model
|
||||||
*/
|
*/
|
||||||
public static $table_name = "assets";
|
public static $table_name = "assets";
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert the custom field's name property to a db-safe string.
|
* Convert the custom field's name property to a db-safe string.
|
||||||
*
|
*
|
||||||
|
|
|
@ -7,9 +7,15 @@ use Watson\Validating\ValidatingTrait;
|
||||||
|
|
||||||
class CustomFieldset extends Model
|
class CustomFieldset extends Model
|
||||||
{
|
{
|
||||||
|
use ValidatingTrait;
|
||||||
|
|
||||||
protected $guarded=["id"];
|
protected $guarded=["id"];
|
||||||
|
|
||||||
public $rules=[
|
/**
|
||||||
|
* Validation rules
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $rules = [
|
||||||
"name" => "required|unique:custom_fieldsets"
|
"name" => "required|unique:custom_fieldsets"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -21,7 +27,6 @@ class CustomFieldset extends Model
|
||||||
* @var boolean
|
* @var boolean
|
||||||
*/
|
*/
|
||||||
protected $injectUniqueIdentifier = true;
|
protected $injectUniqueIdentifier = true;
|
||||||
use ValidatingTrait;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue