mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-09 23:24:06 -08:00
Merge branch 'develop' of https://github.com/snipe/snipe-it into develop
This commit is contained in:
commit
7982b3f237
|
@ -40,10 +40,17 @@ class CheckoutableListener
|
|||
*/
|
||||
$acceptance = $this->getCheckoutAcceptance($event);
|
||||
|
||||
Notification::send(
|
||||
$this->getNotifiables($event),
|
||||
$this->getCheckoutNotification($event, $acceptance)
|
||||
);
|
||||
if(!$event->checkedOutTo->locale){
|
||||
Notification::locale(Setting::getSettings()->locale)->send(
|
||||
$this->getNotifiables($event),
|
||||
$this->getCheckoutNotification($event, $acceptance)
|
||||
);
|
||||
} else {
|
||||
Notification::send(
|
||||
$this->getNotifiables($event),
|
||||
$this->getCheckoutNotification($event, $acceptance)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -60,10 +67,17 @@ class CheckoutableListener
|
|||
/**
|
||||
* Send the appropriate notification
|
||||
*/
|
||||
Notification::send(
|
||||
$this->getNotifiables($event),
|
||||
$this->getCheckinNotification($event)
|
||||
);
|
||||
if(!$event->checkedOutTo->locale){
|
||||
Notification::locale(Setting::getSettings()->locale)->send(
|
||||
$this->getNotifiables($event),
|
||||
$this->getCheckinNotification($event)
|
||||
);
|
||||
} else {
|
||||
Notification::send(
|
||||
$this->getNotifiables($event),
|
||||
$this->getCheckinNotification($event)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -15,11 +15,12 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
|||
use App\Http\Traits\UniqueUndeletedTrait;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Laravel\Passport\HasApiTokens;
|
||||
use Illuminate\Contracts\Translation\HasLocalePreference;
|
||||
use DB;
|
||||
|
||||
|
||||
|
||||
class User extends SnipeModel implements AuthenticatableContract, AuthorizableContract, CanResetPasswordContract
|
||||
class User extends SnipeModel implements AuthenticatableContract, AuthorizableContract, CanResetPasswordContract, HasLocalePreference
|
||||
{
|
||||
protected $presenter = 'App\Presenters\UserPresenter';
|
||||
use SoftDeletes, ValidatingTrait;
|
||||
|
@ -643,4 +644,8 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo
|
|||
{
|
||||
return $query->leftJoin('departments as departments_users', 'users.department_id', '=', 'departments_users.id')->orderBy('departments_users.name', $order);
|
||||
}
|
||||
|
||||
public function preferredLocale(){
|
||||
return $this->locale;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -96,7 +96,6 @@ class CheckinLicenseSeatNotification extends Notification
|
|||
*/
|
||||
public function toMail($notifiable)
|
||||
{
|
||||
|
||||
return (new MailMessage)->markdown('notifications.markdown.checkin-license',
|
||||
[
|
||||
'item' => $this->item,
|
||||
|
|
Loading…
Reference in a new issue