Fixes #4230 - adds model name and manufacturer to emails

This commit is contained in:
snipe 2017-10-17 13:30:32 -07:00
parent e9c3d6bfb7
commit b46cbac911
15 changed files with 81 additions and 8 deletions

View file

@ -518,6 +518,9 @@ class AssetsController extends Controller
$data['item_tag'] = $asset->asset_tag; $data['item_tag'] = $asset->asset_tag;
$data['item_serial'] = $asset->serial; $data['item_serial'] = $asset->serial;
$data['note'] = $logaction->note; $data['note'] = $logaction->note;
$data['manufacturer_name'] = $asset->model->manufacturer->name;
$data['model_name'] = $asset->model->name;
$data['model_number'] = $asset->model->model_number;
if ((($asset->checkin_email()=='1')) && (isset($user)) && (!config('app.lock_passwords'))) { if ((($asset->checkin_email()=='1')) && (isset($user)) && (!config('app.lock_passwords'))) {
Mail::send('emails.checkin-asset', $data, function ($m) use ($user) { Mail::send('emails.checkin-asset', $data, function ($m) use ($user) {

View file

@ -558,6 +558,9 @@ class AssetsController extends Controller
$data['item_tag'] = $asset->asset_tag; $data['item_tag'] = $asset->asset_tag;
$data['item_serial'] = $asset->serial; $data['item_serial'] = $asset->serial;
$data['note'] = $logaction->note; $data['note'] = $logaction->note;
$data['manufacturer_name'] = $asset->model->manufacturer->name;
$data['model_name'] = $asset->model->name;
$data['model_number'] = $asset->model->model_number;
if ((($asset->checkin_email()=='1')) && (isset($user)) && (!empty($user->email)) && (!config('app.lock_passwords'))) { if ((($asset->checkin_email()=='1')) && (isset($user)) && (!empty($user->email)) && (!config('app.lock_passwords'))) {
Mail::send('emails.checkin-asset', $data, function ($m) use ($user) { Mail::send('emails.checkin-asset', $data, function ($m) use ($user) {

View file

@ -99,6 +99,9 @@ class CheckoutNotification extends Notification
'item_serial' => $item->serial, 'item_serial' => $item->serial,
'require_acceptance' => method_exists($item, 'requireAcceptance') ? $item->requireAcceptance() : '', 'require_acceptance' => method_exists($item, 'requireAcceptance') ? $item->requireAcceptance() : '',
'log_id' => $this->params['log_id'], 'log_id' => $this->params['log_id'],
'manufacturer_name' => $item->model->manufacturer->name,
'model_name' => $item->model->name,
'model_number' => $item->model->model_number,
]; ];
if ((method_exists($item, 'requireAcceptance') && ($item->requireAcceptance() == '1')) if ((method_exists($item, 'requireAcceptance') && ($item->requireAcceptance() == '1'))

View file

@ -14,6 +14,7 @@
'all' => 'All', 'all' => 'All',
'archived' => 'Archived', 'archived' => 'Archived',
'asset_models' => 'Asset Models', 'asset_models' => 'Asset Models',
'asset_model' => 'Model',
'asset' => 'Asset', 'asset' => 'Asset',
'asset_report' => 'Asset Report', 'asset_report' => 'Asset Report',
'asset_tag' => 'Asset Tag', 'asset_tag' => 'Asset Tag',

View file

@ -57,5 +57,5 @@
<p><strong><a href="{{ url('/') }}/account/accept-asset/{{ $log_id }}">{{ trans('mail.i_have_read') }}</a></strong></p> <p><strong><a href="{{ url('/') }}/account/accept-asset/{{ $log_id }}">{{ trans('mail.i_have_read') }}</a></strong></p>
@endif @endif
<p>{{ $snipeSettings->site_name }}</p> <p><a href="{{ url('/') }}">{{ $snipeSettings->site_name }}</a></p>
@stop @stop

View file

@ -25,6 +25,36 @@
</td> </td>
</tr> </tr>
@endif @endif
@if (isset($manufacturer_name))
<tr>
<td>
{{ trans('general.manufacturer') }}
</td>
<td>
<strong>{{ $manufacturer_name }}</strong>
</td>
</tr>
@endif
@if (isset($model_name))
<tr>
<td>
{{ trans('general.model_no') }}:
</td>
<td>
<strong>{{ $model_name }}</strong>
</td>
</tr>
@endif
@if (isset($model_number))
<tr>
<td>
{{ trans('general.asset_model') }}:
</td>
<td>
<strong>{{ $model_number }}</strong>
</td>
</tr>
@endif
@if (isset($item_serial)) @if (isset($item_serial))
<tr> <tr>
<td> <td>
@ -87,5 +117,5 @@
<p><strong><a href="{{ url('/') }}/account/accept-asset/{{ $log_id }}">{{ trans('mail.i_have_read') }}</a></strong></p> <p><strong><a href="{{ url('/') }}/account/accept-asset/{{ $log_id }}">{{ trans('mail.i_have_read') }}</a></strong></p>
@endif @endif
<p>{{ $snipeSettings->site_name }}</p> <p><a href="{{ url('/') }}">{{ $snipeSettings->site_name }}</a></p>
@stop @stop

View file

@ -9,4 +9,5 @@
{{ trans('mail.canceled') }} {{ $requested_date }} {{ trans('mail.canceled') }} {{ $requested_date }}
</p> </p>
<p><a href="{{ url('/') }}">{{ $snipeSettings->site_name }}</a></p>
@stop @stop

View file

@ -11,4 +11,5 @@
{{ trans('mail.quantity') }} {{ $item_quantity}} {{ trans('mail.quantity') }} {{ $item_quantity}}
@endif @endif
<p><a href="{{ url('/') }}">{{ $snipeSettings->site_name }}</a></p>
@stop @stop

View file

@ -25,6 +25,36 @@
</td> </td>
</tr> </tr>
@endif @endif
@if (isset($manufacturer_name))
<tr>
<td style="background-color:#ccc">
{{ trans('general.manufacturer') }}
</td>
<td>
<strong>{{ $manufacturer_name }}</strong>
</td>
</tr>
@endif
@if (isset($model_name))
<tr>
<td style="background-color:#ccc">
{{ trans('general.model_no') }}:
</td>
<td>
<strong>{{ $model_name }}</strong>
</td>
</tr>
@endif
@if (isset($model_number))
<tr>
<td style="background-color:#ccc">
{{ trans('general.asset_model') }}:
</td>
<td>
<strong>{{ $model_number }}</strong>
</td>
</tr>
@endif
<tr> <tr>
<td style="background-color:#ccc"> <td style="background-color:#ccc">
{{ trans('mail.checkin_date') }} {{ trans('mail.checkin_date') }}
@ -45,5 +75,5 @@
@endif @endif
</table> </table>
<p>{{ $snipeSettings->site_name }}</p> <p><a href="{{ url('/') }}">{{ $snipeSettings->site_name }}</a></p>
@stop @stop

View file

@ -17,5 +17,5 @@
{!! $email_content !!} {!! $email_content !!}
</table> </table>
<p><a href="{{ url('/') }}">{{ $snipeSettings->site_name }}</a></p>
@stop @stop

View file

@ -14,5 +14,5 @@
{!! $email_content !!} {!! $email_content !!}
</table> </table>
<p><a href="{{ url('/') }}">{{ $snipeSettings->site_name }}</a></p>
@stop @stop

View file

@ -9,5 +9,5 @@
<p>{{ trans('mail.best_regards') }}</p> <p>{{ trans('mail.best_regards') }}</p>
<p>{{ $snipeSettings->site_name }}</p> <p><a href="{{ url('/') }}">{{ $snipeSettings->site_name }}</a></p>
@stop @stop

View file

@ -27,5 +27,6 @@
</table> </table>
<p><a href="{{ url('/') }}">{{ $snipeSettings->site_name }}</a></p>
@stop @stop

View file

@ -9,5 +9,5 @@
<p>{{ trans('mail.best_regards') }}</p> <p>{{ trans('mail.best_regards') }}</p>
<p>{{ $snipeSettings->site_name }}</p> <p><a href="{{ url('/') }}">{{ $snipeSettings->site_name }}</a></p>
@stop @stop

View file

@ -12,5 +12,5 @@
<p>{{ trans('mail.best_regards') }}</p> <p>{{ trans('mail.best_regards') }}</p>
<p>{{ $snipeSettings->site_name }}</p> <p><a href="{{ url('/') }}">{{ $snipeSettings->site_name }}</a></p>
@stop @stop