Added request to dashboard

This commit is contained in:
snipe
2015-07-30 14:59:24 -07:00
parent 9f81792e70
commit 305c22f72d
4 changed files with 26 additions and 6 deletions
@@ -54,6 +54,18 @@ class ViewAssetsController extends AuthorizedController
// 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'));
}
+3 -3
View File
@@ -969,10 +969,10 @@ class AssetsController extends AdminController
$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);
}
+1
View File
@@ -100,6 +100,7 @@
'ready_to_deploy' => 'Ready to Deploy',
'recent_activity' => 'Recent Activity',
'reports' => 'Reports',
'requested' => 'Requested',
'save' => 'Save',
'select' => 'Select',
'search' => 'Search',
+10 -3
View File
@@ -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"))
@@ -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>