Skip to content

Commit

Permalink
Fixes #901 - added notes field to list view
Browse files Browse the repository at this point in the history
  • Loading branch information
snipe committed Jul 17, 2015
1 parent 24b0d83 commit de62db5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/config/version.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
return array (
'app_version' => 'v2.0-pre',
'hash_version' => 'v2.0-pre-beta-5-g1c2a409',
'hash_version' => 'v2.0-pre-beta-30-gdec3f29',
);
13 changes: 9 additions & 4 deletions app/controllers/admin/AssetsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,7 @@ public function postBulkSave($assets = null)
public function getDatatable($status = null)
{

$assets = Asset::with('model','assigneduser','assigneduser.userloc','assetstatus','defaultLoc','assetlog','model','model.category')->Hardware()->select(array('id', 'name','model_id','assigned_to','asset_tag','serial','status_id','purchase_date','deleted_at','rtd_location_id'));
$assets = Asset::with('model','assigneduser','assigneduser.userloc','assetstatus','defaultLoc','assetlog','model','model.category')->Hardware()->select(array('id', 'name','model_id','assigned_to','asset_tag','serial','status_id','purchase_date','deleted_at','rtd_location_id','notes'));


switch ($status) {
Expand Down Expand Up @@ -1050,7 +1050,7 @@ public function getDatatable($status = null)
$actions = new \Chumper\Datatable\Columns\FunctionColumn('actions', function ($assets)
{
if ($assets->deleted_at=='') {
return '<div style=" white-space: nowrap;"><a href="'.route('clone/hardware', $assets->id).'" class="btn btn-info btn-sm"><i class="fa fa-files-o"></i></a> <a href="'.route('update/hardware', $assets->id).'" class="btn btn-warning btn-sm"><i class="fa fa-pencil icon-white"></i></a> <a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'.route('delete/hardware', $assets->id).'" data-content="'.Lang::get('admin/hardware/message.delete.confirm').'" data-title="'.Lang::get('general.delete').' '.htmlspecialchars($assets->asset_tag).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a></div>';
return '<div style=" white-space: nowrap;"><a href="'.route('clone/hardware', $assets->id).'" class="btn btn-info btn-sm" title="Clone asset"><i class="fa fa-files-o"></i></a> <a href="'.route('update/hardware', $assets->id).'" class="btn btn-warning btn-sm"><i class="fa fa-pencil icon-white"></i></a> <a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'.route('delete/hardware', $assets->id).'" data-content="'.Lang::get('admin/hardware/message.delete.confirm').'" data-title="'.Lang::get('general.delete').' '.htmlspecialchars($assets->asset_tag).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a></div>';
} elseif ($assets->model->deleted_at=='') {
return '<a href="'.route('restore/hardware', $assets->id).'" class="btn btn-warning btn-sm"><i class="fa fa-recycle icon-white"></i></a>';
}
Expand Down Expand Up @@ -1134,6 +1134,11 @@ public function getDatatable($status = null)
return $assets->eol_date();
})

->addColumn('notes',function($assets)
{
return $assets->notes;
})


->addColumn('checkout_date',function($assets)
{
Expand All @@ -1144,8 +1149,8 @@ public function getDatatable($status = null)
})
->addColumn($inout)
->addColumn($actions)
->searchColumns('name', 'asset_tag', 'serial', 'model', 'status','location','eol','checkout_date', 'inout','category')
->orderColumns('name', 'asset_tag', 'serial', 'model', 'status','location','eol','checkout_date', 'inout')
->searchColumns('name', 'asset_tag', 'serial', 'model', 'status','location','eol','checkout_date', 'inout','category','notes')
->orderColumns('name', 'asset_tag', 'serial', 'model', 'status','location','eol','notes','checkout_date', 'inout')
->make();

}
Expand Down
5 changes: 3 additions & 2 deletions app/views/backend/hardware/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
Lang::get('admin/hardware/table.location'),
Lang::get('general.category'),
Lang::get('admin/hardware/table.eol'),
Lang::get('general.notes'),
Lang::get('admin/hardware/table.checkout_date'),
Lang::get('admin/hardware/table.change'),
Lang::get('table.actions'))
Expand All @@ -86,8 +87,8 @@
),
'sAjaxSource'=> route('api.hardware.list', Input::get('status')),
'dom' =>'CT<"clear">lfrtip',
'colVis'=> array('showAll'=>'Show All','restore'=>'Restore','exclude'=>array(0,10,11),'activate'=>'mouseover'),
'columnDefs'=> array(array('visible'=>false,'targets'=>array(7,8,9)),array('orderable'=>false,'targets'=>array(0,10,11))),
'colVis'=> array('showAll'=>'Show All','restore'=>'Restore','exclude'=>array(0,11,12),'activate'=>'mouseover'),
'columnDefs'=> array(array('visible'=>false,'targets'=>array(7,8,9)),array('orderable'=>false,'targets'=>array(0,11,12))),
'order'=>array(array(1,'asc')),
)
)
Expand Down

0 comments on commit de62db5

Please sign in to comment.