2016-12-23 17:52:00 -08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Presenters;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class ManufacturerPresenter
|
|
|
|
*/
|
|
|
|
class ManufacturerPresenter extends Presenter
|
|
|
|
{
|
2017-03-10 22:08:59 -08:00
|
|
|
/**
|
|
|
|
* Json Column Layout for bootstrap table
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public static function dataTableLayout()
|
|
|
|
{
|
|
|
|
$layout = [
|
|
|
|
|
|
|
|
[
|
2021-06-10 13:15:52 -07:00
|
|
|
'field' => 'id',
|
|
|
|
'searchable' => false,
|
|
|
|
'sortable' => true,
|
|
|
|
'switchable' => true,
|
|
|
|
'title' => trans('general.id'),
|
|
|
|
'visible' => false,
|
2017-03-10 22:08:59 -08:00
|
|
|
],
|
|
|
|
[
|
2021-06-10 13:15:52 -07:00
|
|
|
'field' => 'name',
|
|
|
|
'searchable' => true,
|
|
|
|
'sortable' => true,
|
2024-03-20 14:25:50 -07:00
|
|
|
'switchable' => false,
|
2021-06-10 13:15:52 -07:00
|
|
|
'title' => trans('admin/manufacturers/table.name'),
|
|
|
|
'visible' => true,
|
|
|
|
'formatter' => 'manufacturersLinkFormatter',
|
2017-03-10 22:08:59 -08:00
|
|
|
],
|
2017-10-25 22:35:58 -07:00
|
|
|
[
|
2021-06-10 13:15:52 -07:00
|
|
|
'field' => 'image',
|
|
|
|
'searchable' => false,
|
|
|
|
'sortable' => true,
|
|
|
|
'switchable' => true,
|
|
|
|
'title' => trans('general.image'),
|
|
|
|
'visible' => true,
|
|
|
|
'formatter' => 'imageFormatter',
|
2017-10-25 22:35:58 -07:00
|
|
|
],
|
2017-03-10 22:08:59 -08:00
|
|
|
[
|
2021-06-10 13:15:52 -07:00
|
|
|
'field' => 'url',
|
|
|
|
'searchable' => true,
|
|
|
|
'sortable' => true,
|
|
|
|
'switchable' => true,
|
2024-02-05 11:09:16 -08:00
|
|
|
'title' => trans('general.url'),
|
2021-06-10 13:15:52 -07:00
|
|
|
'visible' => true,
|
2023-04-26 18:42:34 -07:00
|
|
|
'formatter' => 'externalLinkFormatter',
|
2017-03-10 22:08:59 -08:00
|
|
|
],
|
|
|
|
[
|
2021-06-10 13:15:52 -07:00
|
|
|
'field' => 'support_url',
|
|
|
|
'searchable' => true,
|
|
|
|
'sortable' => true,
|
|
|
|
'switchable' => true,
|
|
|
|
'title' => trans('admin/manufacturers/table.support_url'),
|
|
|
|
'visible' => true,
|
2023-04-26 18:16:23 -07:00
|
|
|
'formatter' => 'externalLinkFormatter',
|
2017-03-10 22:08:59 -08:00
|
|
|
],
|
|
|
|
|
|
|
|
[
|
2021-06-10 13:15:52 -07:00
|
|
|
'field' => 'support_phone',
|
|
|
|
'searchable' => true,
|
|
|
|
'sortable' => true,
|
|
|
|
'switchable' => true,
|
|
|
|
'title' => trans('admin/manufacturers/table.support_phone'),
|
|
|
|
'visible' => true,
|
|
|
|
'formatter' => 'phoneFormatter',
|
2017-03-10 22:08:59 -08:00
|
|
|
],
|
|
|
|
|
|
|
|
[
|
2021-06-10 13:15:52 -07:00
|
|
|
'field' => 'support_email',
|
|
|
|
'searchable' => true,
|
|
|
|
'sortable' => true,
|
|
|
|
'switchable' => true,
|
|
|
|
'title' => trans('admin/manufacturers/table.support_email'),
|
|
|
|
'visible' => true,
|
|
|
|
'formatter' => 'emailFormatter',
|
2017-03-10 22:08:59 -08:00
|
|
|
],
|
2023-04-26 16:39:15 -07:00
|
|
|
[
|
|
|
|
'field' => 'warranty_lookup_url',
|
|
|
|
'searchable' => true,
|
|
|
|
'sortable' => true,
|
|
|
|
'switchable' => true,
|
|
|
|
'title' => trans('admin/manufacturers/table.warranty_lookup_url'),
|
|
|
|
'visible' => false,
|
2023-04-26 18:16:23 -07:00
|
|
|
'formatter' => 'externalLinkFormatter',
|
2023-04-26 16:39:15 -07:00
|
|
|
],
|
2017-03-10 22:08:59 -08:00
|
|
|
|
|
|
|
[
|
2021-06-10 13:15:52 -07:00
|
|
|
'field' => 'assets_count',
|
|
|
|
'searchable' => false,
|
|
|
|
'sortable' => true,
|
|
|
|
'switchable' => true,
|
2024-08-19 03:58:31 -07:00
|
|
|
'title' => trans('general.assets'),
|
2021-06-10 13:15:52 -07:00
|
|
|
'visible' => true,
|
2024-08-19 03:58:31 -07:00
|
|
|
'class' => 'css-barcode',
|
2017-03-10 22:08:59 -08:00
|
|
|
],
|
|
|
|
[
|
2021-06-10 13:15:52 -07:00
|
|
|
'field' => 'licenses_count',
|
|
|
|
'searchable' => false,
|
|
|
|
'sortable' => true,
|
|
|
|
'switchable' => true,
|
2024-08-19 03:58:31 -07:00
|
|
|
'title' => trans('general.licenses'),
|
2021-06-10 13:15:52 -07:00
|
|
|
'visible' => true,
|
2024-08-19 03:58:31 -07:00
|
|
|
'class' => 'css-license',
|
2017-03-10 22:08:59 -08:00
|
|
|
],
|
|
|
|
[
|
2021-06-10 13:15:52 -07:00
|
|
|
'field' => 'consumables_count',
|
|
|
|
'searchable' => false,
|
|
|
|
'sortable' => true,
|
|
|
|
'switchable' => true,
|
2024-08-19 03:58:31 -07:00
|
|
|
'title' => trans('general.consumables'),
|
2021-06-10 13:15:52 -07:00
|
|
|
'visible' => true,
|
2024-08-19 03:58:31 -07:00
|
|
|
'class' => 'css-consumable',
|
2017-03-10 22:08:59 -08:00
|
|
|
],
|
|
|
|
[
|
2021-06-10 13:15:52 -07:00
|
|
|
'field' => 'accessories_count',
|
|
|
|
'searchable' => false,
|
|
|
|
'sortable' => true,
|
|
|
|
'switchable' => true,
|
2024-08-19 03:58:31 -07:00
|
|
|
'title' => trans('general.accessories'),
|
2021-06-10 13:15:52 -07:00
|
|
|
'visible' => true,
|
2024-08-19 03:58:31 -07:00
|
|
|
'class' => 'css-accessory',
|
2017-03-10 22:08:59 -08:00
|
|
|
],
|
|
|
|
[
|
2024-09-19 10:04:50 -07:00
|
|
|
'field' => 'created_by',
|
|
|
|
'searchable' => false,
|
|
|
|
'sortable' => true,
|
|
|
|
'title' => trans('general.created_by'),
|
|
|
|
'visible' => false,
|
|
|
|
'formatter' => 'usersLinkObjFormatter',
|
|
|
|
], [
|
2021-06-10 13:15:52 -07:00
|
|
|
'field' => 'created_at',
|
|
|
|
'searchable' => true,
|
|
|
|
'sortable' => true,
|
|
|
|
'switchable' => true,
|
|
|
|
'title' => trans('general.created_at'),
|
|
|
|
'visible' => false,
|
|
|
|
'formatter' => 'dateDisplayFormatter',
|
2024-09-19 10:04:50 -07:00
|
|
|
], [
|
|
|
|
'field' => 'updated_at',
|
|
|
|
'searchable' => true,
|
|
|
|
'sortable' => true,
|
|
|
|
'switchable' => true,
|
|
|
|
'title' => trans('general.updated_at'),
|
|
|
|
'visible' => false,
|
|
|
|
'formatter' => 'dateDisplayFormatter',
|
|
|
|
], [
|
2021-06-10 13:15:52 -07:00
|
|
|
'field' => 'actions',
|
|
|
|
'searchable' => false,
|
|
|
|
'sortable' => false,
|
|
|
|
'switchable' => false,
|
|
|
|
'title' => trans('table.actions'),
|
|
|
|
'visible' => true,
|
|
|
|
'formatter' => 'manufacturersActionsFormatter',
|
|
|
|
],
|
2017-03-10 22:08:59 -08:00
|
|
|
];
|
|
|
|
|
|
|
|
return json_encode($layout);
|
|
|
|
}
|
|
|
|
|
2016-12-23 17:52:00 -08:00
|
|
|
/**
|
|
|
|
* Link to this manufacturers name
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function nameUrl()
|
|
|
|
{
|
2016-12-29 14:02:18 -08:00
|
|
|
return (string) link_to_route('manufacturers.show', $this->name, $this->id);
|
2016-12-23 17:52:00 -08:00
|
|
|
}
|
2016-12-26 15:19:04 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Url to view this item.
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function viewUrl()
|
|
|
|
{
|
|
|
|
return route('manufacturers.show', $this->id);
|
|
|
|
}
|
2016-12-23 17:52:00 -08:00
|
|
|
}
|