mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-27 14:39:49 -08:00
934afa036f
Shift automatically applies the Laravel coding style - which uses the PSR-2 coding style as a base with some minor additions. You may customize the adopted coding style by adding your own [PHP CS Fixer][1] `.php_cs` config file to your project root. Feel free to use [Shift's Laravel ruleset][2] to help you get started. [1]: https://github.com/FriendsOfPHP/PHP-CS-Fixer [2]: https://gist.github.com/laravel-shift/cab527923ed2a109dda047b97d53c200
123 lines
4.4 KiB
PHP
123 lines
4.4 KiB
PHP
<?php
|
|
|
|
namespace App\Presenters;
|
|
|
|
/**
|
|
* Class AssetModelPresenter
|
|
*/
|
|
class AssetMaintenancesPresenter extends Presenter
|
|
{
|
|
/**
|
|
* Json Column Layout for bootstrap table
|
|
* @return string
|
|
*/
|
|
public static function dataTableLayout()
|
|
{
|
|
$layout = [
|
|
[
|
|
'field' => 'id',
|
|
'searchable' => false,
|
|
'sortable' => true,
|
|
'switchable' => true,
|
|
'title' => trans('general.id'),
|
|
'visible' => false,
|
|
], [
|
|
'field' => 'company',
|
|
'searchable' => true,
|
|
'sortable' => true,
|
|
'switchable' => true,
|
|
'title' => trans('admin/companies/table.title'),
|
|
'visible' => false,
|
|
'formatter' => 'companiesLinkObjFormatter',
|
|
], [
|
|
'field' => 'asset_name',
|
|
'searchable' => true,
|
|
'sortable' => true,
|
|
'title' => trans('admin/asset_maintenances/table.asset_name'),
|
|
'formatter' => 'assetNameLinkFormatter',
|
|
], [
|
|
'field' => 'asset_tag',
|
|
'searchable' => true,
|
|
'sortable' => true,
|
|
'title' => trans('admin/hardware/table.asset_tag'),
|
|
'formatter' => 'assetTagLinkFormatter',
|
|
], [
|
|
'field' => 'model',
|
|
'searchable' => true,
|
|
'sortable' => true,
|
|
'switchable' => true,
|
|
'title' => trans('admin/hardware/form.model'),
|
|
'visible' => false,
|
|
'formatter' => 'modelsLinkObjFormatter',
|
|
], [
|
|
'field' => 'supplier',
|
|
'searchable' => true,
|
|
'sortable' => true,
|
|
'switchable' => true,
|
|
'title' => trans('general.supplier'),
|
|
'visible' => false,
|
|
'formatter' => 'suppliersLinkObjFormatter',
|
|
], [
|
|
'field' => 'location',
|
|
'searchable' => true,
|
|
'sortable' => true,
|
|
'title' => trans('general.location'),
|
|
'formatter' => 'locationsLinkObjFormatter',
|
|
], [
|
|
'field' => 'asset_maintenance_type',
|
|
'searchable' => true,
|
|
'sortable' => true,
|
|
'title' => trans('admin/asset_maintenances/form.asset_maintenance_type'),
|
|
], [
|
|
'field' => 'title',
|
|
'searchable' => true,
|
|
'sortable' => true,
|
|
'title' => trans('admin/asset_maintenances/form.title'),
|
|
], [
|
|
'field' => 'start_date',
|
|
'searchable' => true,
|
|
'sortable' => true,
|
|
'title' => trans('admin/asset_maintenances/form.start_date'),
|
|
'formatter' => 'dateDisplayFormatter',
|
|
], [
|
|
'field' => 'completion_date',
|
|
'searchable' => true,
|
|
'sortable' => true,
|
|
'title' => trans('admin/asset_maintenances/form.completion_date'),
|
|
'formatter' => 'dateDisplayFormatter',
|
|
], [
|
|
'field' => 'notes',
|
|
'searchable' => true,
|
|
'sortable' => true,
|
|
'title' => trans('admin/asset_maintenances/form.notes'),
|
|
], [
|
|
'field' => 'is_warranty',
|
|
'searchable' => true,
|
|
'sortable' => true,
|
|
'title' => trans('admin/asset_maintenances/table.is_warranty'),
|
|
], [
|
|
'field' => 'cost',
|
|
'searchable' => true,
|
|
'sortable' => true,
|
|
'title' => trans('admin/asset_maintenances/form.cost'),
|
|
], [
|
|
'field' => 'user_id',
|
|
'searchable' => true,
|
|
'sortable' => true,
|
|
'title' => trans('general.admin'),
|
|
'formatter' => 'usersLinkObjFormatter',
|
|
], [
|
|
'field' => 'actions',
|
|
'searchable' => false,
|
|
'sortable' => false,
|
|
'switchable' => false,
|
|
'title' => trans('table.actions'),
|
|
'visible' => true,
|
|
'formatter' => 'maintenancesActionsFormatter',
|
|
],
|
|
];
|
|
|
|
return json_encode($layout);
|
|
}
|
|
}
|