mirror of
https://github.com/grokability/snipe-it.git
synced 2026-03-12 17:52:00 +08:00
Merge remote-tracking branch 'origin/develop'
This commit is contained in:
@@ -52,6 +52,7 @@ class ResetDemoSettings extends Command
|
||||
$settings->header_color = '#3c8dbc';
|
||||
$settings->link_dark_color = '#5fa4cc';
|
||||
$settings->link_light_color = '#296282;';
|
||||
$settings->nav_link_color = '#FFFFFF';
|
||||
$settings->label2_2d_type = 'QRCODE';
|
||||
$settings->default_currency = 'USD';
|
||||
$settings->brand = 2;
|
||||
|
||||
@@ -191,9 +191,9 @@ class SettingsController extends Controller
|
||||
$request->validate(['site_name' => 'required']);
|
||||
}
|
||||
|
||||
$setting->header_color = $request->input('header_color');
|
||||
$setting->header_color = $request->input('header_color', '#3c8dbc');
|
||||
$setting->link_light_color = $request->input('link_light_color', '#296282');
|
||||
$setting->link_dark_color = $request->input('link_dark_color', '#296282');
|
||||
$setting->link_dark_color = $request->input('link_dark_color', '#5fa4cc');
|
||||
$setting->nav_link_color = $request->input('nav_link_color', '#FFFFFF');
|
||||
|
||||
$setting->site_name = $request->input('site_name', 'Snipe-IT');
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -22,9 +22,6 @@ 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]);
|
||||
}
|
||||
if ($item = $this->model->item) {
|
||||
if (empty($item->deleted_at)) {
|
||||
return $this->model->item->present()->nameUrl();
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -125,8 +125,8 @@ 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);
|
||||
if (auth()->user()->can('view', ['\App\Models\Department', $this])) {
|
||||
return '<a href="' . route('departments.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);
|
||||
}
|
||||
@@ -339,15 +339,6 @@ class LicensePresenter extends Presenter
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Link to this licenses serial
|
||||
* @return string
|
||||
*/
|
||||
public function serialUrl()
|
||||
{
|
||||
return (string) link_to('/licenses/'.$this->id, mb_strimwidth($this->serial, 0, 50, '...'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Url to view this item.
|
||||
* @return string
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
@foreach($custom_fieldsets AS $fieldset)
|
||||
<tr>
|
||||
<td>
|
||||
{{ link_to_route("fieldsets.show",$fieldset->name,['fieldset' => $fieldset->id]) }}
|
||||
<a href="{{ route('fieldsets.show', ['fieldset' => $fieldset->id]) }}">{{ $fieldset->name }}</a>
|
||||
</td>
|
||||
<td>
|
||||
{{ $fieldset->fields->count() }}
|
||||
|
||||
@@ -553,7 +553,7 @@
|
||||
{!! $asset->checkInvalidNextAuditDate() ? '<i class="fas fa-exclamation-triangle text-orange" aria-hidden="true"></i>' : '' !!}
|
||||
{{ Helper::getFormattedDateObject($audit_log->created_at, 'datetime', false) }}
|
||||
@if ($audit_log->user)
|
||||
({{ link_to_route('users.show', $audit_log->user->display_name, [$audit_log->user->id]) }})
|
||||
(<a href="{{ route('users.show', $audit_log->user->id) }}">{{ $audit_log->user->display_name }}</a>)
|
||||
@endif
|
||||
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user