mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-21 02:30:45 -08:00
Another attempt for #4165
(This is terrible and needs to be refactored.)
This commit is contained in:
parent
af69f7636b
commit
7617fda978
|
@ -487,7 +487,7 @@ class Asset extends Depreciable
|
||||||
} elseif ($this->model->category->use_default_eula == '1') {
|
} elseif ($this->model->category->use_default_eula == '1') {
|
||||||
return $Parsedown->text(e(Setting::getSettings()->default_eula_text));
|
return $Parsedown->text(e(Setting::getSettings()->default_eula_text));
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -83,28 +83,36 @@ class CheckoutNotification extends Notification
|
||||||
public function toMail($notifiable)
|
public function toMail($notifiable)
|
||||||
{
|
{
|
||||||
|
|
||||||
//TODO: Expand for non assets.
|
if (class_basename(get_class($this->params['item']))=='Asset') {
|
||||||
$item = $this->params['item'];
|
|
||||||
$admin_user = $this->params['admin'];
|
//TODO: Expand for non assets.
|
||||||
$target = $this->params['target'];
|
$item = $this->params['item'];
|
||||||
$data = [
|
$admin_user = $this->params['admin'];
|
||||||
'eula' => method_exists($item, 'getEula') ? $item->getEula() : '',
|
$target = $this->params['target'];
|
||||||
'first_name' => $target->present()->fullName(),
|
$data = [
|
||||||
'item_name' => $item->present()->name(),
|
'eula' => method_exists($item, 'getEula') ? $item->getEula() : '',
|
||||||
'checkout_date' => $item->last_checkout,
|
'first_name' => $target->present()->fullName(),
|
||||||
'expected_checkin' => $item->expected_checkin,
|
'item_name' => $item->present()->name(),
|
||||||
'item_tag' => $item->asset_tag,
|
'checkout_date' => $item->last_checkout,
|
||||||
'note' => $this->params['note'],
|
'expected_checkin' => $item->expected_checkin,
|
||||||
'item_serial' => $item->serial,
|
'item_tag' => $item->asset_tag,
|
||||||
'require_acceptance' => method_exists($item, 'requireAcceptance') ? $item->requireAcceptance() : '',
|
'note' => $this->params['note'],
|
||||||
'log_id' => $this->params['log_id'],
|
'item_serial' => $item->serial,
|
||||||
];
|
'require_acceptance' => method_exists($item, 'requireAcceptance') ? $item->requireAcceptance() : '',
|
||||||
|
'log_id' => $this->params['log_id'],
|
||||||
|
];
|
||||||
|
|
||||||
return (new MailMessage)
|
|
||||||
->view('emails.accept-asset', $data)
|
|
||||||
->subject(trans('mail.Confirm_asset_delivery'));
|
|
||||||
|
|
||||||
|
|
||||||
|
if ((method_exists($item, 'requireAcceptance') && ($item->requireAcceptance() == '1'))
|
||||||
|
|| (method_exists($item, 'getEula') && ($item->getEula()))
|
||||||
|
) {
|
||||||
|
return (new MailMessage)
|
||||||
|
->view('emails.accept-asset', $data)
|
||||||
|
->subject(trans('mail.Confirm_asset_delivery'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue