Fixes checkout buttons on licenses list

This commit is contained in:
snipe 2017-04-24 21:37:20 -07:00
parent 6d53a5f58d
commit 59a4e161ff
2 changed files with 21 additions and 7 deletions

View file

@ -42,6 +42,7 @@ class LicensesTransformer
'supplier' => ($license->supplier) ? ['id' => $license->supplier->id,'name'=> e($license->supplier->name)] : null,
'created_at' => Helper::getFormattedDateObject($license->created_at, 'datetime'),
'updated_at' => Helper::getFormattedDateObject($license->updated_at, 'datetime'),
'user_can_checkout' => (bool) ($license->remaincount() > 0),
];
$permissions_array['available_actions'] = [

View file

@ -102,16 +102,29 @@ class LicensePresenter extends Presenter
"sortable" => true,
"visible" => false,
"title" => trans('general.order_number'),
], [
"field" => "actions",
"searchable" => false,
"sortable" => false,
"switchable" => false,
"title" => trans('table.actions'),
"formatter" => "licensesActionsFormatter",
]
];
$layout[] = [
"field" => "checkincheckout",
"searchable" => false,
"sortable" => false,
"switchable" => true,
"title" => 'Checkin/Checkout',
"visible" => true,
"formatter" => "licensesInOutFormatter",
];
$layout[] = [
"field" => "actions",
"searchable" => false,
"sortable" => false,
"switchable" => false,
"title" => trans('table.actions'),
"formatter" => "licensesActionsFormatter",
];
return json_encode($layout);
}