Fixed #15035 - adds company to slack message

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe
2025-04-18 00:28:37 +01:00
parent 4170397094
commit ad6352adc4
8 changed files with 73 additions and 13 deletions
@@ -93,12 +93,20 @@ class CheckoutAssetNotification extends Notification
$channel = ($this->settings->webhook_channel) ? $this->settings->webhook_channel : '';
$fields = [
'To' => '<'.$target->present()->viewUrl().'|'.$target->present()->fullName().'>',
'By' => '<'.$admin->present()->viewUrl().'|'.$admin->present()->fullName().'>',
trans('general.to') => '<'.$target->present()->viewUrl().'|'.$target->present()->fullName().'>',
trans('general.by') => '<'.$admin->present()->viewUrl().'|'.$admin->present()->fullName().'>',
];
if ($item->location) {
$fields[trans('general.location')] = $item->location->name;
}
if ($item->company) {
$fields[trans('general.company')] = $item->company->name;
}
if (($this->expected_checkin) && ($this->expected_checkin !== '')) {
$fields['Expected Checkin'] = $this->expected_checkin;
$fields[trans('general.expected_checkin')] = $this->expected_checkin;
}
return (new SlackMessage)