Merge branch 'develop' of https://github.com/snipe/snipe-it into develop

This commit is contained in:
snipe 2020-11-12 15:13:50 -08:00
commit c8572deb5c
18 changed files with 66 additions and 33 deletions

View file

@ -111,7 +111,7 @@ class CheckinAccessoryNotification extends Notification
]; ];
return (new SlackMessage) return (new SlackMessage)
->content(':arrow_down: :keyboard: Accessory Checked In') ->content(':arrow_down: :keyboard: '.trans('mail.Accessory_Checkin_Notification'))
->from($botname) ->from($botname)
->attachment(function ($attachment) use ($item, $note, $admin, $fields) { ->attachment(function ($attachment) use ($item, $note, $admin, $fields) {
$attachment->title(htmlspecialchars_decode($item->present()->name), $item->present()->viewUrl()) $attachment->title(htmlspecialchars_decode($item->present()->name), $item->present()->viewUrl())
@ -135,7 +135,7 @@ class CheckinAccessoryNotification extends Notification
'note' => $this->note, 'note' => $this->note,
'target' => $this->target, 'target' => $this->target,
]) ])
->subject('Accessory checked in'); ->subject(trans('mail.Accessory_Checkin_Notification'));
} }
} }

View file

@ -79,7 +79,7 @@ class CheckinAssetNotification extends Notification
]; ];
return (new SlackMessage) return (new SlackMessage)
->content(':arrow_down: :computer: Asset Checked In') ->content(':arrow_down: :computer: '.trans('mail.Asset_Checkin_Notification'))
->from($botname) ->from($botname)
->attachment(function ($attachment) use ($item, $note, $admin, $fields) { ->attachment(function ($attachment) use ($item, $note, $admin, $fields) {
$attachment->title(htmlspecialchars_decode($item->present()->name), $item->present()->viewUrl()) $attachment->title(htmlspecialchars_decode($item->present()->name), $item->present()->viewUrl())
@ -113,7 +113,7 @@ class CheckinAssetNotification extends Notification
'fields' => $fields, 'fields' => $fields,
'expected_checkin' => $this->expected_checkin, 'expected_checkin' => $this->expected_checkin,
]) ])
->subject('Asset checked in'); ->subject(trans('mail.Asset_Checkin_Notification'));
return $message; return $message;

View file

@ -83,7 +83,7 @@ class CheckinLicenseSeatNotification extends Notification
return (new SlackMessage) return (new SlackMessage)
->content(':arrow_down: :floppy_disk: License Checked In') ->content(':arrow_down: :floppy_disk: '.trans('mail.License_Checkin_Notification'))
->from($botname) ->from($botname)
->attachment(function ($attachment) use ($item, $note, $admin, $fields) { ->attachment(function ($attachment) use ($item, $note, $admin, $fields) {
$attachment->title(htmlspecialchars_decode($item->present()->name), $item->present()->viewUrl()) $attachment->title(htmlspecialchars_decode($item->present()->name), $item->present()->viewUrl())
@ -106,7 +106,7 @@ class CheckinLicenseSeatNotification extends Notification
'note' => $this->note, 'note' => $this->note,
'target' => $this->target, 'target' => $this->target,
]) ])
->subject('License checked in'); ->subject(trans('mail.License_Checkin_Notification'));
} }

View file

@ -48,7 +48,7 @@ class ExpectedCheckinAdminNotification extends Notification
[ [
'assets' => $this->assets, 'assets' => $this->assets,
]) ])
->subject('Expected asset checkin report'); ->subject(trans('mail.Expected_Checkin_Report'));
return $message; return $message;

View file

@ -2,7 +2,7 @@
namespace App\Notifications; namespace App\Notifications;
use Carbon\Carbon; use App\Helpers\Helper;
use Illuminate\Bus\Queueable; use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Messages\MailMessage; use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification; use Illuminate\Notifications\Notification;
@ -46,16 +46,18 @@ class ExpectedCheckinNotification extends Notification
*/ */
public function toMail() public function toMail()
{ {
$formatted_due = Carbon::parse($this->params->expected_checkin)->format('D, M j, Y');
return (new MailMessage) $message = (new MailMessage)->markdown('notifications.markdown.expected-checkin',
->error() [
->subject('Reminder: '.$this->params->present()->name().' checkin deadline approaching') 'date' => Helper::getFormattedDateObject($this->params->expected_checkin, 'date', false),
->line('Hi, '.$this->params->assignedto->first_name.' '.$this->params->assignedto->last_name) 'asset' => $this->params->present()->name(),
->greeting('An asset checked out to you is due to be checked back in on '.$formatted_due.'.') 'serial' => $this->params->serial,
->line('Asset: '.$this->params->present()->name()) 'asset_tag' => $this->params->asset_tag
->line('Serial: '.$this->params->serial) ])
->line('Asset Tag: '.$this->params->asset_tag) ->subject(trans('mail.Expected_Checkin_Notification', ['name' => $this->params->present()->name()]));
->action('View Your Assets', route('view-assets'));
return $message;
} }
} }

View file

@ -242,4 +242,9 @@
'login_enabled' => 'Login Enabled', 'login_enabled' => 'Login Enabled',
'audit_due' => 'Due for Audit', 'audit_due' => 'Due for Audit',
'audit_overdue' => 'Overdue for Audit', 'audit_overdue' => 'Overdue for Audit',
'accept' => 'Accept :asset',
'i_accept' => 'I accept',
'i_decline' => 'I decline',
'sign_tos' => 'Sign below to indicate that you agree to the terms of service:',
'clear_signature' => 'Clear Signature'
]; ];

View file

@ -70,5 +70,11 @@ return array(
'welcome' => 'Welcome :name', 'welcome' => 'Welcome :name',
'welcome_to' => 'Welcome to :web!', 'welcome_to' => 'Welcome to :web!',
'your_credentials' => 'Your Snipe-IT credentials', 'your_credentials' => 'Your Snipe-IT credentials',
'Accessory_Checkin_Notification' => 'Accessory checked in',
'Asset_Checkin_Notification' => 'Asset checked in',
'License_Checkin_Notification' => 'License checked in',
'Expected_Checkin_Report' => 'Expected asset checkin report'
'Expected_Checkin_Notification' => 'Reminder: :name checkin deadline approaching',
'Expected_Checkin_Date' => 'An asset checked out to you is due to be checked back in on :date',
'your_assets' => 'View Your Assets'
); );

View file

@ -2,7 +2,7 @@
{{-- Page title --}} {{-- Page title --}}
@section('title') @section('title')
Accept {{ $item->present()->name() }} {{trans('general.accept', ['asset' => $item->present()->name()])}}
@parent @parent
@stop @stop
@ -42,14 +42,14 @@
<div class="radio"> <div class="radio">
<label> <label>
<input type="radio" name="asset_acceptance" id="accepted" value="accepted"> <input type="radio" name="asset_acceptance" id="accepted" value="accepted">
I accept {{trans('general.i_accept')}}
</label> </label>
</div> </div>
<div class="radio"> <div class="radio">
<label> <label>
<input type="radio" name="asset_acceptance" id="declined" value="declined"> <input type="radio" name="asset_acceptance" id="declined" value="declined">
I decline {{trans('general.i_decline')}}
</label> </label>
</div> </div>
@ -64,7 +64,7 @@
@if ($snipeSettings->require_accept_signature=='1') @if ($snipeSettings->require_accept_signature=='1')
<div class="col-md-12 col-sm-12 text-center" style="padding-top: 20px"> <div class="col-md-12 col-sm-12 text-center" style="padding-top: 20px">
<h2>Sign below to indicate that you agree to the terms of service:</h2> <h2>{{trans('general.sign_tos')}}</h2>
<div id="signature-pad" class="m-signature-pad"> <div id="signature-pad" class="m-signature-pad">
<div class="m-signature-pad--body col-md-12 col-sm-12 col-lg-12 col-xs-12"> <div class="m-signature-pad--body col-md-12 col-sm-12 col-lg-12 col-xs-12">
@ -72,7 +72,7 @@
<input type="hidden" name="signature_output" id="signature_output"> <input type="hidden" name="signature_output" id="signature_output">
</div> </div>
<div class="col-md-12 col-sm-12 col-lg-12 col-xs-12 text-center"> <div class="col-md-12 col-sm-12 col-lg-12 col-xs-12 text-center">
<button type="button" class="btn btn-sm btn-primary clear" data-action="clear" id="clear_button">Clear Signature</button> <button type="button" class="btn btn-sm btn-primary clear" data-action="clear" id="clear_button">{{trans('general.clear_signature')}}</button>
</div> </div>
</div> </div>
</div> <!-- .col-md-12.text-center--> </div> <!-- .col-md-12.text-center-->

View file

@ -55,7 +55,7 @@
@endif @endif
@endcomponent @endcomponent
Thanks, {{ trans('mail.best_regards') }}
{{ $snipeSettings->site_name }} {{ $snipeSettings->site_name }}

View file

@ -25,7 +25,7 @@
@endif @endif
@endcomponent @endcomponent
Thanks, {{ trans('mail.best_regards') }}
{{ $snipeSettings->site_name }} {{ $snipeSettings->site_name }}

View file

@ -42,7 +42,7 @@
@endif @endif
@endcomponent @endcomponent
Thanks, {{ trans('mail.best_regards') }}
{{ $snipeSettings->site_name }} {{ $snipeSettings->site_name }}

View file

@ -24,7 +24,7 @@
@endif @endif
@endcomponent @endcomponent
Thanks, {{ trans('mail.best_regards') }}
{{ $snipeSettings->site_name }} {{ $snipeSettings->site_name }}

View file

@ -47,7 +47,7 @@
@endif @endif
Thanks, {{ trans('mail.best_regards') }}
{{ $snipeSettings->site_name }} {{ $snipeSettings->site_name }}

View file

@ -64,7 +64,7 @@
@endif @endif
Thanks, {{ trans('mail.best_regards') }}
{{ $snipeSettings->site_name }} {{ $snipeSettings->site_name }}

View file

@ -44,7 +44,7 @@
@endif @endif
Thanks, {{ trans('mail.best_regards') }}
{{ $snipeSettings->site_name }} {{ $snipeSettings->site_name }}

View file

@ -47,7 +47,7 @@
@endif @endif
Thanks, {{ trans('mail.best_regards') }}
{{ $snipeSettings->site_name }} {{ $snipeSettings->site_name }}

View file

@ -0,0 +1,20 @@
@component('mail::message')
# {{ trans('mail.hello') }},
{{ trans('mail.Expected_Checkin_Date', ['date' => $date]) }}
@if ((isset($asset)) && ($asset!=''))
{{ trans('mail.asset_name') }} {{ $asset }}
@endif
{{ trans('mail.asset_tag') }} {{ $asset_tag }}
@if (isset($serial))
{{ trans('mail.serial') }}: {{ $serial }}
@endif
**[{{ trans('mail.your_assets') }}]({{ route('view-assets') }})**
{{ trans('mail.best_regards') }}
{{ $snipeSettings->site_name }}
@endcomponent

View file

@ -14,7 +14,7 @@ $checkin = \App\Helpers\Helper::getFormattedDateObject($asset->expected_checkin,
@endforeach @endforeach
@endcomponent @endcomponent
Thanks, {{ trans('mail.best_regards') }}
{{ $snipeSettings->site_name }} {{ $snipeSettings->site_name }}