Skip to content

Commit

Permalink
removed translation fixed via method
Browse files Browse the repository at this point in the history
  • Loading branch information
Godmartinz committed Jan 24, 2024
1 parent 00f07ac commit c65b32b
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 15 deletions.
4 changes: 2 additions & 2 deletions app/Notifications/CheckinAccessoryNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function via()
$notifyBy[] = MicrosoftTeamsChannel::class;
}

if (Setting::getSettings()->webhook_endpoint != '') {
if (Setting::getSettings()->webhook_selected == 'slack') {
$notifyBy[] = 'slack';
}

Expand Down Expand Up @@ -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 ?: '');
}

/**
Expand Down
4 changes: 2 additions & 2 deletions app/Notifications/CheckinAssetNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
Expand Down Expand Up @@ -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 ?: '');
}

/**
Expand Down
6 changes: 3 additions & 3 deletions app/Notifications/CheckinLicenseSeatNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function via()
$notifyBy[] = MicrosoftTeamsChannel::class;
}

if (Setting::getSettings()->webhook_endpoint != '') {
if (Setting::getSettings()->webhook_selected == 'slack') {
$notifyBy[] = 'slack';
}

Expand Down Expand Up @@ -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 ?: '');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/Notifications/CheckoutAccessoryNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?: '');

}

Expand Down
4 changes: 2 additions & 2 deletions app/Notifications/CheckoutAssetNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
Expand Down Expand Up @@ -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 ?: '');


}
Expand Down
4 changes: 2 additions & 2 deletions app/Notifications/CheckoutConsumableNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function via()
$notifyBy[] = MicrosoftTeamsChannel::class;
}

if (Setting::getSettings()->webhook_endpoint != '') {
if (Setting::getSettings()->webhook_selected == 'slack') {
$notifyBy[] = 'slack';
}

Expand Down Expand Up @@ -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 ?: '');
}

/**
Expand Down
4 changes: 2 additions & 2 deletions app/Notifications/CheckoutLicenseSeatNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function via()
$notifyBy[] = MicrosoftTeamsChannel::class;
}

if (Setting::getSettings()->webhook_endpoint != '') {
if (Setting::getSettings()->webhook_selected == 'slack') {
$notifyBy[] = 'slack';
}

Expand Down Expand Up @@ -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 ?: '');
}

/**
Expand Down
1 change: 0 additions & 1 deletion resources/lang/en-US/admin/hardware/form.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit c65b32b

Please sign in to comment.