A free open source IT asset/license management system
Update introduction lines with qty
Marcus Moore15698d7694a1
diff --git a/app/Mail/CheckoutAccessoryMail.php b/app/Mail/CheckoutAccessoryMail.phpindex b1bab86c88..24efd57933 100644--- a/app/Mail/CheckoutAccessoryMail.php+++ b/app/Mail/CheckoutAccessoryMail.php@@ -83,17 +83,19 @@ class CheckoutAccessoryMail extends Mailable],);}+private function introductionLine(): string{if ($this->target instanceof Location) {- return trans('mail.new_item_checked_location', ['location' => $this->target->name ]);+ return trans_choice('mail.new_item_checked_location', $this->checkout_qty, ['location' => $this->target->name]);}+if ($this->requiresAcceptance()) {- return trans('mail.new_item_checked_with_acceptance');+ return trans_choice('mail.new_item_checked_with_acceptance', $this->checkout_qty);}if (!$this->requiresAcceptance()) {- return trans('mail.new_item_checked');+ return trans_choice('mail.new_item_checked', $this->checkout_qty);}// we shouldn't get here but let's send a default message just in casediff --git a/app/Mail/CheckoutAssetMail.php b/app/Mail/CheckoutAssetMail.phpindex 0dcd568bab..324c1c8f29 100644--- a/app/Mail/CheckoutAssetMail.php+++ b/app/Mail/CheckoutAssetMail.php@@ -138,14 +138,15 @@ class CheckoutAssetMail extends Mailableprivate function introductionLine(): string{if ($this->firstTimeSending && $this->target instanceof Location) {- return trans('mail.new_item_checked_location', ['location' => $this->target->name ]);+ return trans_choice('mail.new_item_checked_location', 1, ['location' => $this->target->name]);}+if ($this->firstTimeSending && $this->requiresAcceptance()) {- return trans('mail.new_item_checked_with_acceptance');+ return trans_choice('mail.new_item_checked_with_acceptance', 1);}if ($this->firstTimeSending && !$this->requiresAcceptance()) {- return trans('mail.new_item_checked');+ return trans_choice('mail.new_item_checked', 1);}if (!$this->firstTimeSending && $this->requiresAcceptance()) {diff --git a/resources/lang/en-US/mail.php b/resources/lang/en-US/mail.phpindex bb5c077ebe..7899f86d37 100644--- a/resources/lang/en-US/mail.php+++ b/resources/lang/en-US/mail.php@@ -75,9 +75,9 @@ return ['low_inventory_alert' => 'There is :count item that is below minimum inventory or will soon be low.|There are :count items that are below minimum inventory or will soon be low.','min_QTY' => 'Min QTY','name' => 'Name',- 'new_item_checked' => 'A new item has been checked out under your name, details are below.',- 'new_item_checked_with_acceptance' => 'A new item has been checked out under your name that requires acceptance, details are below.',- 'new_item_checked_location' => 'A new item has been checked out to :location, details are below.',+ 'new_item_checked' => 'A new item has been checked out under your name, details are below.|:count new items have been checked out under your name, details are below.',+ 'new_item_checked_with_acceptance' => 'A new item has been checked out under your name that requires acceptance, details are below.|:count new items have been checked out under your name that requires acceptance, details are below.',+ 'new_item_checked_location' => 'A new item has been checked out to :location, details are below.|:count new items have been checked out to :location, details are below.','recent_item_checked' => 'An item was recently checked out under your name that requires acceptance, details are below.','notes' => 'Notes','password' => 'Password',diff --git a/resources/views/mail/markdown/checkout-component.blade.php b/resources/views/mail/markdown/checkout-component.blade.phpindex fa9054df62..8c06dc1d6e 100644--- a/resources/views/mail/markdown/checkout-component.blade.php+++ b/resources/views/mail/markdown/checkout-component.blade.php@@ -1,7 +1,7 @@@component('mail::message')# {{ trans('mail.hello') }} {{ $target->assignedto->display_name }},-{{ trans('mail.new_item_checked') }}+{{ trans_choice('mail.new_item_checked', $qty) }}@component('mail::table')| | |@@ -47,4 +47,4 @@{{ $snipeSettings->site_name }}-@endcomponent\ No newline at end of file+@endcomponentdiff --git a/resources/views/mail/markdown/checkout-consumable.blade.php b/resources/views/mail/markdown/checkout-consumable.blade.phpindex c746de18ec..1e949700f4 100644--- a/resources/views/mail/markdown/checkout-consumable.blade.php+++ b/resources/views/mail/markdown/checkout-consumable.blade.php@@ -1,7 +1,7 @@@component('mail::message')# {{ trans('mail.hello') }} {{ $target->display_name }},-{{ trans('mail.new_item_checked') }}+{{ trans_choice('mail.new_item_checked', $qty) }}@component('mail::table')diff --git a/resources/views/mail/markdown/checkout-license.blade.php b/resources/views/mail/markdown/checkout-license.blade.phpindex 9813f31cd6..d3b3fe7de0 100644--- a/resources/views/mail/markdown/checkout-license.blade.php+++ b/resources/views/mail/markdown/checkout-license.blade.php@@ -1,7 +1,7 @@@component('mail::message')# {{ trans('mail.hello').' '.$target.','}}-{{ trans('mail.new_item_checked') }}+{{ trans_choice('mail.new_item_checked', 1) }}@component('mail::table')| | |