mirror of
https://github.com/grokability/snipe-it.git
synced 2026-03-12 17:52:00 +08:00
Replace remaining calls to link_to_route in Presenters
This commit is contained in:
@@ -265,7 +265,7 @@ class AccessoryPresenter extends Presenter
|
||||
public function nameUrl()
|
||||
{
|
||||
if (auth()->user()->can('view', ['\App\Models\Accessory', $this])) {
|
||||
return (string)link_to_route('accessories.show', e($this->display_name), $this->id);
|
||||
return '<a href="' . route('accessories.show', $this->id) . '">' . e($this->display_name) . '</a>';
|
||||
} else {
|
||||
return e($this->display_name);
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ class ActionlogPresenter extends Presenter
|
||||
public function item()
|
||||
{
|
||||
if ($this->action_type == 'uploaded') {
|
||||
return (string) link_to_route('show/userfile', $this->model->filename, [$this->model->item->id, $this->model->id]);
|
||||
return '<a href="' . route('show/userfile', [$this->model->item->id, $this->model->id]) . '">' . e($this->model->filename) . '</a>';
|
||||
}
|
||||
if ($item = $this->model->item) {
|
||||
if (empty($item->deleted_at)) {
|
||||
|
||||
@@ -266,7 +266,7 @@ class AssetModelPresenter extends Presenter
|
||||
*/
|
||||
public function nameUrl()
|
||||
{
|
||||
return (string) link_to_route('models.show', $this->name, $this->id);
|
||||
return '<a href="' . route('models.show', $this->id) . '">' . e($this->name) . '</a>';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -452,7 +452,7 @@ class AssetPresenter extends Presenter
|
||||
public function nameUrl()
|
||||
{
|
||||
if (auth()->user()->can('view', ['\App\Models\Asset', $this])) {
|
||||
return (string)link_to_route('hardware.show', e($this->display_name), $this->id);
|
||||
return '<a href="' . route('hardware.show', $this->id) . '">' . e($this->display_name) . '</a>';
|
||||
} else {
|
||||
return e($this->display_name);
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ class CategoryPresenter extends Presenter
|
||||
public function nameUrl()
|
||||
{
|
||||
if (auth()->user()->can('view', ['\App\Models\Category', $this])) {
|
||||
return (string)link_to_route('categories.show', e($this->display_name), $this->id);
|
||||
return '<a href="' . route('categories.show', $this->id) . '">' . e($this->display_name) . '</a>';
|
||||
} else {
|
||||
return e($this->display_name);
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@ class CompanyPresenter extends Presenter
|
||||
public function nameUrl()
|
||||
{
|
||||
if (auth()->user()->can('view', ['\App\Models\Company', $this])) {
|
||||
return (string)link_to_route('companies.show', e($this->display_name), $this->id);
|
||||
return '<a href="' . route('companies.show', $this->id) . '">' . e($this->display_name) . '</a>';
|
||||
} else {
|
||||
return e($this->display_name);
|
||||
}
|
||||
|
||||
@@ -257,7 +257,7 @@ class ComponentPresenter extends Presenter
|
||||
public function nameUrl()
|
||||
{
|
||||
if (auth()->user()->can('view', ['\App\Models\Component', $this])) {
|
||||
return (string)link_to_route('components.show', e($this->display_name), $this->id);
|
||||
return '<a href="' . route('components.show', $this->id) . '">' . e($this->display_name) . '</a>';
|
||||
} else {
|
||||
return e($this->display_name);
|
||||
}
|
||||
|
||||
@@ -255,6 +255,6 @@ class ConsumablePresenter extends Presenter
|
||||
*/
|
||||
public function nameUrl()
|
||||
{
|
||||
return (string) link_to_route('consumables.show', e($this->name), $this->id);
|
||||
return '<a href="' . route('consumables.show', $this->id) . '">' . e($this->name) . '</a>';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ class CustomFieldsetPresenter extends Presenter
|
||||
public function nameUrl()
|
||||
{
|
||||
if (auth()->user()->can('view', ['\App\Models\CustomFieldset', $this])) {
|
||||
return (string)link_to_route('fieldsets.show', e($this->display_name), $this->id);
|
||||
return '<a href="' . route('fieldsets.show', $this->id) . '">' . e($this->display_name) . '</a>';
|
||||
} else {
|
||||
return e($this->display_name);
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ class DepartmentPresenter extends Presenter
|
||||
public function viewUrl()
|
||||
{
|
||||
if (auth()->user()->can('view', ['\App\Models\Location', $this])) {
|
||||
return (string)link_to_route('locations.show', $this->display_name, $this->id);
|
||||
return '<a href="' . route('locations.show', $this->id) . '">' . e($this->display_name) . '</a>';
|
||||
} else {
|
||||
return $this->display_name;
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ class DepreciationPresenter extends Presenter
|
||||
public function nameUrl()
|
||||
{
|
||||
if (auth()->user()->can('view', ['\App\Models\Depreciation', $this])) {
|
||||
return (string)link_to_route('depreciations.show', e($this->display_name), $this->id);
|
||||
return '<a href="' . route('depreciations.show', $this->id) . '">' . e($this->display_name) . '</a>';
|
||||
} else {
|
||||
return e($this->display_name);
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ class DepreciationReportPresenter extends Presenter
|
||||
public function nameUrl()
|
||||
{
|
||||
if (auth()->user()->can('view', ['\App\Models\Depreciation', $this])) {
|
||||
return (string)link_to_route('depreciations.show', e($this->display_name), $this->id);
|
||||
return '<a href="' . route('depreciations.show', $this->id) . '">' . e($this->display_name) . '</a>';
|
||||
} else {
|
||||
return e($this->display_name);
|
||||
}
|
||||
|
||||
@@ -323,7 +323,7 @@ class LicensePresenter extends Presenter
|
||||
public function nameUrl()
|
||||
{
|
||||
if (auth()->user()->can('view', ['\App\Models\License', $this])) {
|
||||
return (string)link_to_route('licenses.show', e($this->display_name), $this->id);
|
||||
return '<a href="' . route('licenses.show', $this->id) . '">' . e($this->display_name) . '</a>';
|
||||
} else {
|
||||
return e($this->display_name);
|
||||
}
|
||||
|
||||
@@ -351,7 +351,7 @@ class LocationPresenter extends Presenter
|
||||
public function nameUrl()
|
||||
{
|
||||
if (auth()->user()->can('view', ['\App\Models\Location', $this])) {
|
||||
return (string)link_to_route('locations.show', e($this->display_name), $this->id);
|
||||
return '<a href="' . route('locations.show', $this->id) . '">' . e($this->display_name) . '</a>';
|
||||
} else {
|
||||
return e($this->display_name);
|
||||
}
|
||||
|
||||
@@ -184,7 +184,7 @@ class ManufacturerPresenter extends Presenter
|
||||
public function nameUrl()
|
||||
{
|
||||
if (auth()->user()->can('view', ['\App\Models\Manufacturer', $this])) {
|
||||
return (string)link_to_route('manufacturers.show', e($this->display_name), $this->id);
|
||||
return '<a href="' . route('manufacturers.show', $this->id) . '">' . e($this->display_name) . '</a>';
|
||||
} else {
|
||||
return e($this->display_name);
|
||||
}
|
||||
|
||||
@@ -296,7 +296,7 @@ class PredefinedKitPresenter extends Presenter
|
||||
public function nameUrl()
|
||||
{
|
||||
if (auth()->user()->can('view', ['\App\Models\PredefinedKit', $this])) {
|
||||
return (string)link_to_route('kits.show', e($this->display_name), $this->id);
|
||||
return '<a href="' . route('kits.show', $this->id) . '">' . e($this->display_name) . '</a>';
|
||||
} else {
|
||||
return e($this->display_name);
|
||||
}
|
||||
|
||||
@@ -210,7 +210,7 @@ class SupplierPresenter extends Presenter
|
||||
public function nameUrl()
|
||||
{
|
||||
if (auth()->user()->can('view', ['\App\Models\Supplier', $this])) {
|
||||
return (string)link_to_route('suppliers.show', e($this->display_name), $this->id);
|
||||
return '<a href="' . route('suppliers.show', $this->id) . '">' . e($this->display_name) . '</a>';
|
||||
} else {
|
||||
return e($this->display_name);
|
||||
}
|
||||
@@ -232,7 +232,7 @@ class SupplierPresenter extends Presenter
|
||||
public function viewUrl()
|
||||
{
|
||||
if (auth()->user()->can('view', ['\App\Models\Supplier', $this])) {
|
||||
return (string)link_to_route('suppliers.show', $this->display_name, $this->id);
|
||||
return '<a href="' . route('suppliers.show', $this->id) . '">' . e($this->display_name) . '</a>';
|
||||
} else {
|
||||
return e($this->display_name);
|
||||
}
|
||||
|
||||
@@ -529,7 +529,7 @@ class UserPresenter extends Presenter
|
||||
public function nameUrl()
|
||||
{
|
||||
if (auth()->user()->can('view', ['\App\Models\User', $this])) {
|
||||
return (string)link_to_route('users.show', $this->display_name, $this->id);
|
||||
return '<a href="' . route('users.show', $this->id) . '">' . e($this->display_name) . '</a>';
|
||||
} else {
|
||||
return e($this->display_name);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user