A free open source IT asset/license management system
More info anel refinements
snipef82cdabccd18
diff --git a/app/Models/License.php b/app/Models/License.phpindex 2b01a9624b..95109f7036 100755--- a/app/Models/License.php+++ b/app/Models/License.php@@ -389,7 +389,7 @@ class License extends Depreciable*/public function category(){- return $this->belongsTo(\App\Models\Category::class, 'category_id');+ return $this->belongsTo(\App\Models\Category::class, 'category_id')->withTrashed();}/**@@ -401,7 +401,7 @@ class License extends Depreciable*/public function manufacturer(){- return $this->belongsTo(\App\Models\Manufacturer::class, 'manufacturer_id');+ return $this->belongsTo(\App\Models\Manufacturer::class, 'manufacturer_id')->withTrashed();}/**diff --git a/app/Presenters/AssetModelPresenter.php b/app/Presenters/AssetModelPresenter.phpindex b92530e8c6..22cdeb26c9 100644--- a/app/Presenters/AssetModelPresenter.php+++ b/app/Presenters/AssetModelPresenter.php@@ -304,10 +304,10 @@ class AssetModelPresenter extends Presenterpublic function formattedNameLink() {- if (auth()->user()->can('models.view', $this)) {- return '<a href="'.route('models.show', e($this->id)).'">'.e($this->name).'</a>';+ if (auth()->user()->can('view', ['\App\Models\AssetModel', $this])) {+ return '<a href="'.route('models.show', e($this->id)).'" class="'. (($this->deleted_at!='') ? 'deleted' : '').'">'.e($this->display_name).'</a>';}- return $this->name;+ return '<span class="'. (($this->deleted_at!='') ? 'deleted' : '').'">'.e($this->display_name).'</span>';}}diff --git a/app/Presenters/CategoryPresenter.php b/app/Presenters/CategoryPresenter.phpindex ca0c2434af..f97a3cc31b 100644--- a/app/Presenters/CategoryPresenter.php+++ b/app/Presenters/CategoryPresenter.php@@ -157,10 +157,16 @@ class CategoryPresenter extends Presenterpublic function formattedNameLink() {- if (auth()->user()->can('view', ['\App\Models\Category', $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('categories.show', e($this->id)).'">'.e($this->name).'</a>';+ // We use soft-deletes for categories, but we don't give you a way to restore them right now. This would be the method we'd use when that happens+// if (auth()->user()->can('view', ['\App\Models\Category', $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('models.show', e($this->id)).'" class="'. (($this->deleted_at!='') ? 'deleted' : '').'">'.e($this->display_name).'</a>';+// }++ if ((auth()->user()->can('view', ['\App\Models\Category', $this])) && ($this->deleted_at=='')) {+ 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('categories.show', e($this->id)).'">'.e($this->name).'</a>';}- return ($this->tag_color ? "<i class='fa-solid fa-fw fa-square' style='color: ".e($this->tag_color)."' aria-hidden='true'></i>" : '').e($this->name);+ return ($this->tag_color ? "<i class='fa-solid fa-fw fa-square' style='color: ".e($this->tag_color)."' aria-hidden='true'></i>" : '').'<span class="'. (($this->deleted_at!='') ? 'deleted' : '').'">'.e($this->display_name).'</span>';+}}diff --git a/resources/views/blade/box/info-panel.blade.php b/resources/views/blade/box/info-panel.blade.phpindex edb8d62d13..df88669702 100644--- a/resources/views/blade/box/info-panel.blade.php+++ b/resources/views/blade/box/info-panel.blade.php@@ -69,7 +69,7 @@@endif@if ($infoPanelObj->termination_date)- <x-info-element icon_type="terminates" title="{{ trans('general.termination_date') }}">+ <x-info-element icon_type="terminates" title="{{ trans('admin/licenses/form.termination_date') }}">{{ Helper::getFormattedDateObject($infoPanelObj->termination_date, 'date', false) }}</x-info-element>@endif@@ -130,7 +130,9 @@{{ $snipeSettings->default_currency }}@endif- {{ Helper::formatCurrencyOutput($infoPanelObj->purchase_cost) }}+ <x-copy-to-clipboard copy_what="purchase_cost" class="pull-right">+ {{ Helper::formatCurrencyOutput($infoPanelObj->purchase_cost) }}+ </x-copy-to-clipboard></x-info-element>@if (isset($infoPanelObj->qty))@@ -175,7 +177,7 @@@if ($infoPanelObj->category)<x-info-element icon_type="category" icon_color="{{ $infoPanelObj->category->tag_color }}" title="{{ trans('general.category') }}">- {!! $infoPanelObj->category->present()->nameUrl !!}+ {!! $infoPanelObj->category->present()->formattedNameLink !!}</x-info-element>@endif