mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-14 01:24:06 -08:00
75b527ab59
* Locations API support for image * Added manufacturers API support for image * Added manufacturers API support for image * Added image support for locations add/update * Added manufacturer image upload support to controller * General image string * Added blade support for image uploads/delete image * Added $request support (from Input::) * Added image support in API transformers * Added image to Manufacturers presenter for data table * Migration to create image fields * Ignore the contents of the new image directories * Create new image upload directories * Created components/consumables uploads directory * Fixed missing textSearch scope from companies * Added ignore for companies uploads directory * Added blade support for image upload * Fixed path to upload directory on edit * Added company image upport to transformers, controllers * Added image support for categories * Added support for images in Departments * Added support for image in Consumables * Added image support for components
124 lines
4.3 KiB
PHP
124 lines
4.3 KiB
PHP
<?php
|
|
|
|
namespace App\Presenters;
|
|
|
|
/**
|
|
* Class CompanyPresenter
|
|
* @package App\Presenters
|
|
*/
|
|
class CompanyPresenter 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,
|
|
"switchable" => true,
|
|
"title" => trans('admin/companies/table.name'),
|
|
"visible" => true,
|
|
"formatter" => 'companiesLinkFormatter',
|
|
],[
|
|
"field" => "image",
|
|
"searchable" => false,
|
|
"sortable" => true,
|
|
"switchable" => true,
|
|
"title" => trans('general.image'),
|
|
"visible" => true,
|
|
"formatter" => 'imageFormatter',
|
|
],[
|
|
"field" => "users_count",
|
|
"searchable" => false,
|
|
"sortable" => false,
|
|
"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,
|
|
"sortable" => false,
|
|
"title" => '<span class="hidden-xs"><i class="fa fa-barcode"></i></span><span class="hidden-md hidden-lg">'.trans('general.assets').'</span>',
|
|
"visible" => true,
|
|
|
|
],[
|
|
"field" => "licenses_count",
|
|
"searchable" => false,
|
|
"sortable" => false,
|
|
"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,
|
|
"sortable" => false,
|
|
"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,
|
|
"sortable" => false,
|
|
"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,
|
|
"sortable" => false,
|
|
"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,
|
|
"sortable" => false,
|
|
"visible" => false,
|
|
"title" => trans('general.updated_at'),
|
|
],[
|
|
"field" => "created_at",
|
|
"searchable" => false,
|
|
"sortable" => false,
|
|
"visible" => false,
|
|
"title" => trans('general.created_at'),
|
|
],[
|
|
"field" => "actions",
|
|
"searchable" => false,
|
|
"sortable" => false,
|
|
"switchable" => false,
|
|
"title" => trans('table.actions'),
|
|
"visible" => true,
|
|
"formatter" => "companiesActionsFormatter",
|
|
]
|
|
];
|
|
|
|
return json_encode($layout);
|
|
}
|
|
|
|
|
|
/**
|
|
* Link to this companies name
|
|
* @return string
|
|
*/
|
|
public function nameUrl()
|
|
{
|
|
return (string) link_to_route('companies.show', $this->name, $this->id);
|
|
}
|
|
|
|
/**
|
|
* Url to view this item.
|
|
* @return string
|
|
*/
|
|
public function viewUrl()
|
|
{
|
|
return route('companies.show', $this->id);
|
|
}
|
|
}
|