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
@@ -40,7 +40,6 @@ class CheckoutAccessoryNotification extends Notification
if (Setting::getSettings()->webhook_selected == 'microsoft'){
// return [MicrosoftTeamsChannel::class];
$notifyBy[] = MicrosoftTeamsChannel::class;
}
@@ -105,21 +104,24 @@ class CheckoutAccessoryNotification extends Notification
}
public function toMicrosoftTeams()
{
$target = $this->target;
$admin = $this->admin;
$item = $this->item;
$note = $this->note;
return MicrosoftTeamsMessage::create()
->to($this->settings->webhook_endpoint)
->type('success')
->addStartGroupToSection('activityTitle')
->title("Accessory Checked Out")
->addStartGroupToSection('activityText')
->fact(htmlspecialchars_decode($item->present()->name), '', 'activityTitle')
->fact('Checked out from ', $item->location->name ? $item->location->name : '')
->fact(trans('mail.Accessory_Checkout_Notification')." by ", $admin->present()->fullName())
->fact('Number Remaining', $item->numRemaining())
->fact('Notes', $note ?: 'No notes');
return MicrosoftTeamsMessage::create()
->to($this->settings->webhook_endpoint)
->type('success')
->addStartGroupToSection('activityTitle')
->title(trans('mail.Accessory_Checkout_Notification'))
->addStartGroupToSection('activityText')
->fact(htmlspecialchars_decode($item->present()->name), '', 'activityTitle')
->fact(trans('mail.assigned_to'), $target->present()->name)
->fact(trans('mail.checkedout_from'), $item->location->name ? $item->location->name : '')
->fact(trans('mail.Accessory_Checkout_Notification') . " by ", $admin->present()->fullName())
->fact(trans('admin/consumables/general.remaining'), $item->numRemaining())
->fact(trans('mail.notes'), $note ?: trans('mail.no_notes'));
}
/**