Skip to content

A free open source IT asset/license management system

fixes check in check out translations for assets in notiications

Godfrey Meadce51f106c
diff --git a/app/Notifications/CheckinAssetNotification.php b/app/Notifications/CheckinAssetNotification.php
index 066c9a14d1..1b23387ca4 100644
--- a/app/Notifications/CheckinAssetNotification.php
+++ b/app/Notifications/CheckinAssetNotification.php
@@ -93,7 +93,7 @@ class CheckinAssetNotification extends Notification
return (new SlackMessage)
- ->content(':arrow_down: :computer: '.trans('mail.Asset_Checkin_Notification'))
+ ->content(':arrow_down: :computer: '.trans('mail.Asset_Checkin_Notification', ['tag' => $item->asset_tag]))
->from($botname)
->to($channel)
->attachment(function ($attachment) use ($item, $note, $admin, $fields) {
@@ -112,7 +112,7 @@ class CheckinAssetNotification extends Notification
return MicrosoftTeamsMessage::create()
->to($this->settings->webhook_endpoint)
->type('success')
- ->title(trans('mail.Asset_Checkin_Notification'))
+ ->title(trans('mail.Asset_Checkin_Notification', ['tag' => $item->asset_tag]))
->addStartGroupToSection('activityText')
->fact(htmlspecialchars_decode($item->display_name), '', 'activityText')
->fact(trans('mail.checked_into'), ($item->location) ? $item->location->name : '')
@@ -122,7 +122,7 @@ class CheckinAssetNotification extends Notification
}
- $message = trans('mail.Asset_Checkin_Notification');
+ $message = trans('mail.Asset_Checkin_Notification', ['tag' => $item->asset_tag]);
$details = [
trans('mail.asset') => htmlspecialchars_decode($item->display_name),
trans('mail.checked_into') => ($item->location) ? $item->location->name : '',
@@ -144,7 +144,7 @@ class CheckinAssetNotification extends Notification
->card(
Card::create()
->header(
- '<strong>'.trans('mail.Asset_Checkin_Notification').'</strong>' ?: '',
+ '<strong>'.trans('mail.Asset_Checkin_Notification', ['tag' => $item->asset_tag]).'</strong>' ?: '',
htmlspecialchars_decode($item->display_name) ?: '',
)
->section(
diff --git a/app/Notifications/CheckoutAssetNotification.php b/app/Notifications/CheckoutAssetNotification.php
index 28caaff31b..9e11a3cbaf 100644
--- a/app/Notifications/CheckoutAssetNotification.php
+++ b/app/Notifications/CheckoutAssetNotification.php
@@ -110,7 +110,7 @@ class CheckoutAssetNotification extends Notification
}
return (new SlackMessage)
- ->content(':arrow_up: :computer: '.trans('mail.Asset_Checkout_Notification'))
+ ->content(':arrow_up: :computer: '.trans('mail.Asset_Checkout_Notification', ['tag' => $item->asset_tag]))
->from($botname)
->to($channel)
->attachment(function ($attachment) use ($item, $note, $admin, $fields) {
@@ -131,19 +131,19 @@ class CheckoutAssetNotification extends Notification
return MicrosoftTeamsMessage::create()
->to($this->settings->webhook_endpoint)
->type('success')
- ->title(trans('mail.Asset_Checkout_Notification'))
+ ->title(trans('mail.Asset_Checkout_Notification', ['tag' => $item->asset_tag]))
->addStartGroupToSection('activityText')
->fact(trans('mail.assigned_to'), $target->display_name)
->fact(htmlspecialchars_decode($item->display_name), '', 'activityText')
- ->fact(trans('mail.Asset_Checkout_Notification') . " by ", $admin->display_name)
+ ->fact(trans('mail.Asset_Checkout_Notification', ['tag' => $item->asset_tag]) . " by ", $admin->display_name)
->fact(trans('mail.notes'), $note ?: '');
}
- $message = trans('mail.Asset_Checkout_Notification');
+ $message = trans('mail.Asset_Checkout_Notification', ['tag' => $item->asset_tag]);
$details = [
trans('mail.assigned_to') => $target->present()->name,
trans('mail.asset') => htmlspecialchars_decode($item->display_name),
- trans('mail.Asset_Checkout_Notification'). ' by' => $admin->display_name,
+ trans('mail.Asset_Checkout_Notification', ['tag' => $item->asset_tag]). ' by' => $admin->display_name,
trans('mail.notes') => $note ?: '',
];
return array($message, $details);
@@ -159,7 +159,7 @@ public function toGoogleChat()
->card(
Card::create()
->header(
- '<strong>'.trans('mail.Asset_Checkout_Notification').'</strong>' ?: '',
+ '<strong>'.trans('mail.Asset_Checkout_Notification', ['tag' => $item->asset_tag]).'</strong>' ?: '',
htmlspecialchars_decode($item->display_name) ?: '',
)
->section(