mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
Added created_at and modified_at to asset listing/api
This commit is contained in:
parent
9e7f998df5
commit
9ccaad8b9c
|
@ -67,6 +67,7 @@ class AssetsController extends Controller
|
|||
'image',
|
||||
'assigned_to',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
'purchase_date',
|
||||
'purchase_cost'
|
||||
];
|
||||
|
|
|
@ -40,10 +40,11 @@ class AssetsTransformer
|
|||
'location' => ($asset->assetLoc) ? ['id' => $asset->assetLoc->id,'name'=> e($asset->assetLoc->name)] : null,
|
||||
'rtd_location' => ($asset->defaultLoc) ? ['id' => $asset->defaultLoc->id,'name'=> e($asset->defaultLoc->name)] : null,
|
||||
'image' => ($asset->getImageUrl()) ? $asset->getImageUrl() : null,
|
||||
'assigned_to' => ($asset->assigneduser) ? (new UsersTransformer)->transformUser($asset->assigneduser) : null,
|
||||
'assigned_to' => ($asset->assigneduser) ? ['id' => $asset->assigneduser->id,'first_name'=> e( $asset->assigneduser->first_name), 'last_name'=> e( $asset->assigneduser->last_name)] : null,
|
||||
'warranty' => ($asset->warranty_months > 0) ? e($asset->warranty_months).' '.trans('admin/hardware/form.months') : null,
|
||||
'warranty_expires' => ($asset->warranty_months > 0) ? $asset->present()->warrantee_expires() : null,
|
||||
'created_at' => $asset->created_at,
|
||||
'created_at' => $asset->created_at->format('Y-m-d H:i:s'),
|
||||
'updated_at' => $asset->updated_at->format('Y-m-d H:i:s'),
|
||||
'purchase_date' => $asset->purchase_date,
|
||||
'purchase_cost' => $asset->purchase_cost,
|
||||
'can_checkout' => $asset->availableForCheckout(),
|
||||
|
|
|
@ -145,6 +145,18 @@ class AssetPresenter extends Presenter
|
|||
"sortable" => true,
|
||||
"visible" => false,
|
||||
"title" => trans('general.notes'),
|
||||
], [
|
||||
"field" => "created_at",
|
||||
"searchable" => false,
|
||||
"sortable" => true,
|
||||
"visible" => false,
|
||||
"title" => trans('general.created_at'),
|
||||
], [
|
||||
"field" => "updated_at",
|
||||
"searchable" => false,
|
||||
"sortable" => true,
|
||||
"visible" => false,
|
||||
"title" => trans('general.updated_at')
|
||||
]
|
||||
];
|
||||
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
'created' => 'Item Created',
|
||||
'created_asset' => 'created asset',
|
||||
'created_at' => 'Created at',
|
||||
'updated_at' => 'Updated at',
|
||||
'currency' => '$', // this is deprecated
|
||||
'current' => 'Current',
|
||||
'custom_report' => 'Custom Asset Report',
|
||||
|
|
Loading…
Reference in a new issue