From c65b32bcdb67420320d8bc3ca6e76fa0b7908847 Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Wed, 24 Jan 2024 14:49:42 -0800 Subject: [PATCH] removed translation fixed via method --- app/Notifications/CheckinAccessoryNotification.php | 4 ++-- app/Notifications/CheckinAssetNotification.php | 4 ++-- app/Notifications/CheckinLicenseSeatNotification.php | 6 +++--- app/Notifications/CheckoutAccessoryNotification.php | 2 +- app/Notifications/CheckoutAssetNotification.php | 4 ++-- app/Notifications/CheckoutConsumableNotification.php | 4 ++-- app/Notifications/CheckoutLicenseSeatNotification.php | 4 ++-- resources/lang/en-US/admin/hardware/form.php | 1 - 8 files changed, 14 insertions(+), 15 deletions(-) diff --git a/app/Notifications/CheckinAccessoryNotification.php b/app/Notifications/CheckinAccessoryNotification.php index fbe525376e8b..f376c26a8469 100644 --- a/app/Notifications/CheckinAccessoryNotification.php +++ b/app/Notifications/CheckinAccessoryNotification.php @@ -44,7 +44,7 @@ public function via() $notifyBy[] = MicrosoftTeamsChannel::class; } - if (Setting::getSettings()->webhook_endpoint != '') { + if (Setting::getSettings()->webhook_selected == 'slack') { $notifyBy[] = 'slack'; } @@ -130,7 +130,7 @@ public function toMicrosoftTeams() ->fact(trans('mail.checked_into'), $item->location->name ? $item->location->name : '') ->fact(trans('mail.Accessory_Checkin_Notification')." by ", $admin->present()->fullName()) ->fact(trans('admin/consumables/general.remaining'), $item->numRemaining()) - ->fact(trans('mail.notes'), $note ?: 'No notes'); + ->fact(trans('mail.notes'), $note ?: ''); } /** diff --git a/app/Notifications/CheckinAssetNotification.php b/app/Notifications/CheckinAssetNotification.php index 171b41831a20..8e9467c54f5a 100644 --- a/app/Notifications/CheckinAssetNotification.php +++ b/app/Notifications/CheckinAssetNotification.php @@ -51,7 +51,7 @@ public function via() $notifyBy[] = MicrosoftTeamsChannel::class; } - if (Setting::getSettings()->webhook_endpoint != '') { + if (Setting::getSettings()->webhook_selected == 'slack') { \Log::debug('use webhook'); $notifyBy[] = 'slack'; } @@ -106,7 +106,7 @@ public function toMicrosoftTeams() ->fact(trans('mail.checked_into'), $item->location->name ? $item->location->name : '') ->fact(trans('mail.Asset_Checkin_Notification')." by ", $admin->present()->fullName()) ->fact(trans('admin/hardware/form.status'), $item->assetstatus->name) - ->fact(trans('mail.notes'), $note ?: trans('mail.no_notes')); + ->fact(trans('mail.notes'), $note ?: ''); } /** diff --git a/app/Notifications/CheckinLicenseSeatNotification.php b/app/Notifications/CheckinLicenseSeatNotification.php index 2af301b7db38..2222f937f3f6 100644 --- a/app/Notifications/CheckinLicenseSeatNotification.php +++ b/app/Notifications/CheckinLicenseSeatNotification.php @@ -48,7 +48,7 @@ public function via() $notifyBy[] = MicrosoftTeamsChannel::class; } - if (Setting::getSettings()->webhook_endpoint != '') { + if (Setting::getSettings()->webhook_selected == 'slack') { $notifyBy[] = 'slack'; } @@ -108,10 +108,10 @@ public function toMicrosoftTeams() ->title(trans('mail.License_Checkin_Notification')) ->addStartGroupToSection('activityText') ->fact(htmlspecialchars_decode($item->present()->name), '', 'header') - ->fact(trans('mail.License_Checkin_Notification')." by ", $admin->present()->fullName() ?: 'ClI tool') + ->fact(trans('mail.License_Checkin_Notification')." by ", $admin->present()->fullName() ?: 'CLI tool') ->fact(trans('mail.checkedin_from'), $target->present()->fullName()) ->fact(trans('admin/consumables/general.remaining'), $item->availCount()->count()) - ->fact(trans('mail.notes'), $note ?: trans('mail.no_notes')); + ->fact(trans('mail.notes'), $note ?: ''); } /** diff --git a/app/Notifications/CheckoutAccessoryNotification.php b/app/Notifications/CheckoutAccessoryNotification.php index d0cb7d13d05b..62fce8e176e7 100644 --- a/app/Notifications/CheckoutAccessoryNotification.php +++ b/app/Notifications/CheckoutAccessoryNotification.php @@ -120,7 +120,7 @@ public function toMicrosoftTeams() ->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')); + ->fact(trans('mail.notes'), $note ?: ''); } diff --git a/app/Notifications/CheckoutAssetNotification.php b/app/Notifications/CheckoutAssetNotification.php index 652ec03f6ab5..7350a7736be4 100644 --- a/app/Notifications/CheckoutAssetNotification.php +++ b/app/Notifications/CheckoutAssetNotification.php @@ -60,7 +60,7 @@ public function via() } $notifyBy = []; - if ((Setting::getSettings()) && (Setting::getSettings()->webhook_endpoint != '')) { + if ((Setting::getSettings()) && (Setting::getSettings()->webhook_selected == 'slack')) { \Log::debug('use webhook'); $notifyBy[] = 'slack'; } @@ -139,7 +139,7 @@ public function toMicrosoftTeams() ->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')); + ->fact(trans('mail.notes'), $note ?: ''); } diff --git a/app/Notifications/CheckoutConsumableNotification.php b/app/Notifications/CheckoutConsumableNotification.php index c8cde7daf38b..228c4c2e9592 100644 --- a/app/Notifications/CheckoutConsumableNotification.php +++ b/app/Notifications/CheckoutConsumableNotification.php @@ -50,7 +50,7 @@ public function via() $notifyBy[] = MicrosoftTeamsChannel::class; } - if (Setting::getSettings()->webhook_endpoint != '') { + if (Setting::getSettings()->webhook_selected == 'slack') { $notifyBy[] = 'slack'; } @@ -126,7 +126,7 @@ public function toMicrosoftTeams() ->fact(trans('mail.Consumable_checkout_notification')." by ", $admin->present()->fullName()) ->fact(trans('mail.assigned_to'), $target->present()->fullName()) ->fact(trans('admin/consumables/general.remaining'), $item->numRemaining()) - ->fact(trans('mail.notes'), $note ?: trans('mail.no_notes')); + ->fact(trans('mail.notes'), $note ?: ''); } /** diff --git a/app/Notifications/CheckoutLicenseSeatNotification.php b/app/Notifications/CheckoutLicenseSeatNotification.php index 33db588350ff..d5c9871f3b86 100644 --- a/app/Notifications/CheckoutLicenseSeatNotification.php +++ b/app/Notifications/CheckoutLicenseSeatNotification.php @@ -51,7 +51,7 @@ public function via() $notifyBy[] = MicrosoftTeamsChannel::class; } - if (Setting::getSettings()->webhook_endpoint != '') { + if (Setting::getSettings()->webhook_selected == 'slack') { $notifyBy[] = 'slack'; } @@ -127,7 +127,7 @@ public function toMicrosoftTeams() ->fact(trans('mail.License_Checkout_Notification')." by ", $admin->present()->fullName()) ->fact(trans('mail.assigned_to'), $target->present()->fullName()) ->fact(trans('admin/consumables/general.remaining'), $item->availCount()->count()) - ->fact(trans('mail.notes'), $note ?: trans('mail.no_notes')); + ->fact(trans('mail.notes'), $note ?: ''); } /** diff --git a/resources/lang/en-US/admin/hardware/form.php b/resources/lang/en-US/admin/hardware/form.php index ae6b5646bd08..ee3fa20fb094 100644 --- a/resources/lang/en-US/admin/hardware/form.php +++ b/resources/lang/en-US/admin/hardware/form.php @@ -35,7 +35,6 @@ 'months' => 'months', 'name' => 'Asset Name', 'notes' => 'Notes', - 'no_notes' => 'No Notes', 'order' => 'Order Number', 'qr' => 'QR Code', 'requestable' => 'Users may request this asset',