2016-12-23 17:52:00 -08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Presenters;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class CompanyPresenter
|
|
|
|
* @package App\Presenters
|
|
|
|
*/
|
|
|
|
class CompanyPresenter extends Presenter
|
|
|
|
{
|
2017-07-07 17:10:06 -07:00
|
|
|
/**
|
|
|
|
* 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,
|
|
|
|
"switchable" => true,
|
|
|
|
"title" => trans('admin/companies/table.name'),
|
|
|
|
"visible" => true,
|
|
|
|
"formatter" => 'companiesLinkFormatter',
|
2017-10-25 22:35:58 -07:00
|
|
|
],[
|
|
|
|
"field" => "image",
|
|
|
|
"searchable" => false,
|
|
|
|
"sortable" => true,
|
|
|
|
"switchable" => true,
|
|
|
|
"title" => trans('general.image'),
|
|
|
|
"visible" => true,
|
|
|
|
"formatter" => 'imageFormatter',
|
2017-07-07 17:10:06 -07:00
|
|
|
],[
|
|
|
|
"field" => "users_count",
|
|
|
|
"searchable" => false,
|
2017-12-12 07:03:09 -08:00
|
|
|
"sortable" => true,
|
2017-07-07 17:10:06 -07:00
|
|
|
"title" => '<span class="hidden-xs"><i class="fa fa-users"></i></span><span class="hidden-md hidden-lg">'.trans('general.users').'</span></th>',
|
|
|
|
"visible" => true,
|
|
|
|
|
|
|
|
],[
|
|
|
|
"field" => "assets_count",
|
|
|
|
"searchable" => false,
|
2017-12-12 07:03:09 -08:00
|
|
|
"sortable" => true,
|
2020-04-02 18:17:21 -07:00
|
|
|
"title" => '<span class="hidden-xs"><i class="fa fa-barcode" aria-hidden="true"></i></span><span class="hidden-md hidden-lg">'.trans('general.assets').'</span>',
|
2017-07-07 17:10:06 -07:00
|
|
|
"visible" => true,
|
|
|
|
|
|
|
|
],[
|
|
|
|
"field" => "licenses_count",
|
|
|
|
"searchable" => false,
|
2017-12-12 07:03:09 -08:00
|
|
|
"sortable" => true,
|
2017-07-07 17:10:06 -07:00
|
|
|
"visible" => true,
|
|
|
|
"title" => ' <span class="hidden-xs"><i class="fa fa-floppy-o"></i></span><span class="hidden-md hidden-lg">'.trans('general.licenses').'</span>',
|
|
|
|
],[
|
|
|
|
"field" => "accessories_count",
|
|
|
|
"searchable" => false,
|
2017-12-12 07:03:09 -08:00
|
|
|
"sortable" => true,
|
2017-07-07 17:10:06 -07:00
|
|
|
"visible" => true,
|
|
|
|
"title" => ' <span class="hidden-xs"><i class="fa fa-keyboard-o"></i></span><span class="hidden-md hidden-lg">'.trans('general.accessories').'</span>',
|
|
|
|
],[
|
|
|
|
"field" => "consumables_count",
|
|
|
|
"searchable" => false,
|
2017-12-12 07:03:09 -08:00
|
|
|
"sortable" => true,
|
2017-07-07 17:10:06 -07:00
|
|
|
"visible" => true,
|
|
|
|
"title" => ' <span class="hidden-xs"><i class="fa fa-tint"></i></span><span class="hidden-md hidden-lg">'.trans('general.consumables').'</span>',
|
|
|
|
],[
|
|
|
|
"field" => "components_count",
|
|
|
|
"searchable" => false,
|
2017-12-12 07:03:09 -08:00
|
|
|
"sortable" => true,
|
2017-07-07 17:10:06 -07:00
|
|
|
"visible" => true,
|
|
|
|
"title" => ' <span class="hidden-xs"><i class="fa fa-hdd-o"></i></span><span class="hidden-md hidden-lg">'.trans('general.components').'</span>',
|
|
|
|
],[
|
|
|
|
"field" => "updated_at",
|
|
|
|
"searchable" => false,
|
2017-12-12 07:03:09 -08:00
|
|
|
"sortable" => true,
|
2017-07-07 17:10:06 -07:00
|
|
|
"visible" => false,
|
|
|
|
"title" => trans('general.updated_at'),
|
2020-09-03 19:40:17 -07:00
|
|
|
"formatter" => 'createdAtFormatter',
|
2017-07-07 17:10:06 -07:00
|
|
|
],[
|
|
|
|
"field" => "created_at",
|
|
|
|
"searchable" => false,
|
2017-12-12 07:03:09 -08:00
|
|
|
"sortable" => true,
|
2017-07-07 17:10:06 -07:00
|
|
|
"visible" => false,
|
|
|
|
"title" => trans('general.created_at'),
|
2020-09-03 19:40:17 -07:00
|
|
|
"formatter" => 'createdAtFormatter',
|
2017-07-07 17:10:06 -07:00
|
|
|
],[
|
|
|
|
"field" => "actions",
|
|
|
|
"searchable" => false,
|
|
|
|
"sortable" => false,
|
|
|
|
"switchable" => false,
|
|
|
|
"title" => trans('table.actions'),
|
|
|
|
"visible" => true,
|
|
|
|
"formatter" => "companiesActionsFormatter",
|
|
|
|
]
|
|
|
|
];
|
|
|
|
|
|
|
|
return json_encode($layout);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-12-23 17:52:00 -08:00
|
|
|
/**
|
|
|
|
* Link to this companies name
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function nameUrl()
|
|
|
|
{
|
|
|
|
return (string) link_to_route('companies.show', $this->name, $this->id);
|
|
|
|
}
|
2016-12-26 15:19:04 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Url to view this item.
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function viewUrl()
|
|
|
|
{
|
|
|
|
return route('companies.show', $this->id);
|
|
|
|
}
|
2016-12-23 17:52:00 -08:00
|
|
|
}
|