Skip to content

A free open source IT asset/license management system

Fixed permission name for locations

snipeed6d020edba3
diff --git a/app/Presenters/LocationPresenter.php b/app/Presenters/LocationPresenter.php
index aa3dfe30c6..de59167207 100644
--- a/app/Presenters/LocationPresenter.php
+++ b/app/Presenters/LocationPresenter.php
@@ -378,7 +378,7 @@ class LocationPresenter extends Presenter
public function formattedNameLink() {
- if (auth()->user()->can('location.view', $this)) {
+ if (auth()->user()->can('locations.view', $this)) {
return ($this->tag_color ? "<i class='fa-solid fa-fw fa-square' style='color: ".e($this->tag_color)."' aria-hidden='true'></i>" : '').'<a href="'.route('locations.show', e($this->id)).'">'.e($this->name).'</a>';
}
diff --git a/resources/views/account/view-assets.blade.php b/resources/views/account/view-assets.blade.php
index 72f2263262..12581ce9b2 100755
--- a/resources/views/account/view-assets.blade.php
+++ b/resources/views/account/view-assets.blade.php
@@ -324,7 +324,7 @@
{{ trans('admin/users/table.email') }}
</div>
<div class="col-md-9">
- <a href="mailto:{{ $user->email }}">{{ $user->email }}</a>
+ <a href="mailto:{{ $user->email }}"><x-icon type="email" /> {{ $user->email }}</a>
</div>
</div>
@endif
@@ -336,7 +336,7 @@
{{ trans('general.website') }}
</div>
<div class="col-md-9">
- <a href="{{ $user->website }}" target="_blank">{{ $user->website }}</a>
+ <a href="{{ $user->website }}" target="_blank"><x-icon type="external-link" /> {{ $user->website }}</a>
</div>
</div>
@endif
@@ -348,7 +348,7 @@
{{ trans('admin/users/table.phone') }}
</div>
<div class="col-md-9">
- <a href="tel:{{ $user->phone }}">{{ $user->phone }}</a>
+ <a href="tel:{{ $user->phone }}"><x-icon type="phone" /> {{ $user->phone }}</a>
</div>
</div>
@endif
@@ -360,7 +360,7 @@
{{ trans('admin/users/table.location') }}
</div>
<div class="col-md-9">
- {{ link_to_route('locations.show', $user->userloc->name, [$user->userloc->id]) }}
+ {!! $user->userloc->present()->formattedNameLink !!}
</div>
</div>
@endif
@@ -528,10 +528,11 @@
{{ $asset->serial }}
</td>
<td>
- {{ ($asset->defaultLoc) ? $asset->defaultLoc->name : '' }}
+ {!! ($asset->defaultLoc) ? $asset->defaultLoc->present()->formattedNameLink : '' !!}
+
</td>
<td>
- {!! ($asset->defaultLoc) ? $asset->defaultLoc->present()->formattedNameLink : trans('general.deleted') !!}
+ {!! ($asset->location) ? $asset->location->present()->formattedNameLink : '' !!}
</td>
<td>
{{ ($asset->expected_checkin) ? $asset->expected_checkin_formatted_date : '' }}