snipe-it/app/Presenters/DepreciationPresenter.php
snipe fdb5b3baf1
Depreciation detail view fixes [ch15776] (#9059)
* Allow sorting by months for depreciation list view

* Added dataTableLayout to standardize the list display table

* Implement the dataTableLayout() on the list view blade

* Split the view into tabs so we can combine asset depreciations and license depreciations

* Updated depreciation view to use tabbed interface for assets and licenses

* Added asset models to depreciation details page

* Make asset model category sortable

* Added cateory as allowed to be sorted on

* Added category sort scope

* Removed offset variable

* Small fixes to asset modes display in depreciation to bulk edit models
2021-01-27 17:44:05 -08:00

57 lines
1.4 KiB
PHP

<?php
namespace App\Presenters;
/**
* Class DepreciationPresenter
* @package App\Presenters
*/
class DepreciationPresenter 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" => "name",
"searchable" => true,
"sortable" => true,
"title" => trans('general.name'),
"visible" => true,
"formatter" => 'depreciationsLinkFormatter',
],
[
"field" => "months",
"searchable" => true,
"sortable" => true,
"title" => trans('admin/depreciations/table.term'),
"visible" => true,
],
[
"field" => "actions",
"searchable" => false,
"sortable" => false,
"switchable" => false,
"title" => trans('table.actions'),
"visible" => true,
"formatter" => "depreciationsActionsFormatter",
]
];
return json_encode($layout);
}
}