add translations, brush up code

This commit is contained in:
Godfrey M
2024-01-24 10:38:06 -08:00
parent 49021d277c
commit 00f07ac2ce
10 changed files with 60 additions and 55 deletions
+10 -15
View File
@@ -126,27 +126,22 @@ class CheckoutAssetNotification extends Notification
}
public function toMicrosoftTeams()
{
$target = $this->target;
$admin = $this->admin;
$item = $this->item;
$note = $this->note;
try {
return MicrosoftTeamsMessage::create()
->to($this->settings->webhook_endpoint)
->type('success')
->title(trans('mail.Asset_Checkout_Notification'))
->addStartGroupToSection('activityText')
->fact(trans('mail.assigned_to'), $target->present()->name)
->fact(htmlspecialchars_decode($item->present()->name), '', 'activityText')
->fact(trans('mail.Asset_Checkout_Notification') . " by ", $admin->present()->fullName())
->fact(trans('mail.notes'), $note ?: trans('mail.no_notes'));
return MicrosoftTeamsMessage::create()
->to($this->settings->webhook_endpoint)
->type('success')
->title("Asset Checked Out")
->addStartGroupToSection('activityText')
->fact(htmlspecialchars_decode($item->present()->name), '', 'activityText')
->fact('Checked out from ', $item->location ? $item->location->name : $item->assetLoc()->name)
->fact(trans('mail.Asset_Checkout_Notification') . " by ", $admin->present()->fullName())
->fact('Asset Status', $item->assetstatus->name)
->fact('Notes', $note ?: 'No notes');
}
catch(Exception $e) {
dd($e);
}
}
/**