Skip to content

Commit

Permalink
Added request to dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
snipe committed Jul 30, 2015
1 parent 9f81792 commit 305c22f
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 6 deletions.
12 changes: 12 additions & 0 deletions app/controllers/account/ViewAssetsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@ public function getRequestAsset($assetId = null) {
// Redirect to the asset management page
return Redirect::route('requestable-assets')->with('error', Lang::get('admin/hardware/message.does_not_exist_or_not_requestable'));
} else {

$logaction = new Actionlog();
$logaction->asset_id = $asset->id;
$logaction->asset_type = 'hardware';
$logaction->created_at = date("Y-m-d h:i:s");

if ($user->location_id) {
$logaction->location_id = $user->location_id;
}
$logaction->user_id = Sentry::getUser()->id;
$log = $logaction->logaction('requested');

return Redirect::route('requestable-assets')->with('success')->with('success', Lang::get('admin/hardware/message.asset_requested'));
}

Expand Down
6 changes: 3 additions & 3 deletions app/controllers/admin/AssetsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -969,10 +969,10 @@ public function postBulkEdit($assets = null)
$assets = Input::get('edit_asset');

$supplier_list = array('' => '') + Supplier::orderBy('name', 'asc')->lists('name', 'id');
$statuslabel_list = array('' => '') + Statuslabel::lists('name', 'id');
$location_list = array('' => '') + Location::lists('name', 'id');
$statuslabel_list = array('' => '') + Statuslabel::lists('name', 'id');
$location_list = array('' => '') + Location::lists('name', 'id');

return View::make('backend/hardware/bulk')->with('assets',$assets)->with('supplier_list',$supplier_list)->with('statuslabel_list',$statuslabel_list)->with('location_list',$location_list);
return View::make('backend/hardware/bulk')->with('assets',$assets)->with('supplier_list',$supplier_list)->with('statuslabel_list',$statuslabel_list)->with('location_list',$location_list);


}
Expand Down
1 change: 1 addition & 0 deletions app/lang/en/general.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
'ready_to_deploy' => 'Ready to Deploy',
'recent_activity' => 'Recent Activity',
'reports' => 'Reports',
'requested' => 'Requested',
'save' => 'Save',
'select' => 'Select',
'search' => 'Search',
Expand Down
13 changes: 10 additions & 3 deletions app/views/backend/dashboard.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,12 @@
@foreach ($recent_activity as $activity)
<tr>
<td>{{{ date("M d", strtotime($activity->created_at)) }}}</td>
<td>{{{ $activity->adminlog->fullName() }}}</td>
<td>
@if ($activity->action_type!='requested')
{{{ $activity->adminlog->fullName() }}}
@endif

</td>

<td>
@if (($activity->assetlog) && ($activity->asset_type=="hardware"))
Expand All @@ -65,9 +70,11 @@
{{ strtolower(Lang::get('general.'.str_replace(' ','_',$activity->action_type))) }}
</td>
<td>
@if ($activity->userlog)
@if ($activity->action_type=='requested')
{{{ $activity->adminlog->fullName() }}}
@elseif ($activity->userlog)
{{{ $activity->userlog->fullName() }}}
@endif
@endif

</td>

Expand Down

0 comments on commit 305c22f

Please sign in to comment.