mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Merge pull request #12509 from inietov/fixes/add_images_to_user_inventory_mail_report
Added images to emailed user inventory report [sc-19801]
This commit is contained in:
commit
81cb29db5e
|
@ -285,7 +285,7 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo
|
|||
*/
|
||||
public function assets()
|
||||
{
|
||||
return $this->morphMany(\App\Models\Asset::class, 'assigned', 'assigned_type', 'assigned_to')->withTrashed();
|
||||
return $this->morphMany(\App\Models\Asset::class, 'assigned', 'assigned_type', 'assigned_to')->withTrashed()->orderBy('id');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -313,7 +313,7 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo
|
|||
public function accessories()
|
||||
{
|
||||
return $this->belongsToMany(\App\Models\Accessory::class, 'accessories_users', 'assigned_to', 'accessory_id')
|
||||
->withPivot('id', 'created_at', 'note')->withTrashed();
|
||||
->withPivot('id', 'created_at', 'note')->withTrashed()->orderBy('accessory_id');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -9,9 +9,18 @@
|
|||
## {{ $assets->count() }} {{ trans('general.assets') }}
|
||||
|
||||
<table width="100%">
|
||||
<tr><th align="left">{{ trans('mail.name') }} </th><th align="left">{{ trans('mail.asset_tag') }}</th><th align="left">{{ trans('admin/hardware/table.serial') }}</th></tr>
|
||||
<tr><th align="left">{{ trans('mail.name') }} </th><th align="left">{{ trans('mail.asset_tag') }}</th><th align="left">{{ trans('admin/hardware/table.serial') }}</th> <th></th> </tr>
|
||||
@foreach($assets as $asset)
|
||||
<tr><td>{{ $asset->present()->name }}</td><td> {{ $asset->asset_tag }} </td><td> {{ $asset->serial }} </td></tr>
|
||||
<tr>
|
||||
<td>{{ $asset->present()->name }}</td>
|
||||
<td> {{ $asset->asset_tag }} </td>
|
||||
<td> {{ $asset->serial }} </td>
|
||||
@if (($snipeSettings->show_images_in_email =='1') && $asset->getImageUrl())
|
||||
<td>
|
||||
<img src="{{ asset($asset->getImageUrl()) }}" alt="Asset" style="max-width: 64px;">
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
@endif
|
||||
|
@ -20,9 +29,16 @@
|
|||
## {{ $accessories->count() }} {{ trans('general.accessories') }}
|
||||
|
||||
<table width="100%">
|
||||
<tr><th align="left">{{ trans('mail.name') }} </th></tr>
|
||||
<tr><th align="left">{{ trans('mail.name') }} </th> <th></th> </tr>
|
||||
@foreach($accessories as $accessory)
|
||||
<tr><td>{{ $accessory->name }}</td></tr>
|
||||
<tr>
|
||||
<td>{{ $accessory->name }}</td>
|
||||
@if (($snipeSettings->show_images_in_email =='1') && $accessory->getImageUrl())
|
||||
<td>
|
||||
<img src="{{ asset($accessory->getImageUrl()) }}" alt="Accessory" style="max-width: 64px;">
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
@endif
|
||||
|
@ -33,7 +49,9 @@
|
|||
<table width="100%">
|
||||
<tr><th align="left"{{ trans('mail.name') }} </th></tr>
|
||||
@foreach($licenses as $license)
|
||||
<tr><td>{{ $license->name }}</td></tr>
|
||||
<tr>
|
||||
<td>{{ $license->name }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
@endif
|
||||
|
|
Loading…
Reference in a new issue