diff --git a/app/Models/User.php b/app/Models/User.php index 1f57f91907..73a30b229b 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -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'); } /** diff --git a/resources/views/notifications/markdown/user-inventory.blade.php b/resources/views/notifications/markdown/user-inventory.blade.php index d597338549..c7dfba9a30 100644 --- a/resources/views/notifications/markdown/user-inventory.blade.php +++ b/resources/views/notifications/markdown/user-inventory.blade.php @@ -9,9 +9,18 @@ ## {{ $assets->count() }} {{ trans('general.assets') }} - + @foreach($assets as $asset) - + + + + + @if (($snipeSettings->show_images_in_email =='1') && $asset->getImageUrl()) + + @endif + @endforeach
{{ trans('mail.name') }} {{ trans('mail.asset_tag') }}{{ trans('admin/hardware/table.serial') }}
{{ trans('mail.name') }} {{ trans('mail.asset_tag') }}{{ trans('admin/hardware/table.serial') }}
{{ $asset->present()->name }} {{ $asset->asset_tag }} {{ $asset->serial }}
{{ $asset->present()->name }} {{ $asset->asset_tag }} {{ $asset->serial }} + Asset +
@endif @@ -20,9 +29,16 @@ ## {{ $accessories->count() }} {{ trans('general.accessories') }} - + @foreach($accessories as $accessory) - + + + @if (($snipeSettings->show_images_in_email =='1') && $accessory->getImageUrl()) + + @endif + @endforeach
{{ trans('mail.name') }}
{{ trans('mail.name') }}
{{ $accessory->name }}
{{ $accessory->name }} + Accessory +
@endif @@ -33,7 +49,9 @@ @foreach($licenses as $license) - + + + @endforeach
{{ $license->name }}
{{ $license->name }}
@endif