diff --git a/app/controllers/account/ViewAssetsController.php b/app/controllers/account/ViewAssetsController.php index cd026be158..48325f9f95 100755 --- a/app/controllers/account/ViewAssetsController.php +++ b/app/controllers/account/ViewAssetsController.php @@ -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')); } diff --git a/app/controllers/admin/AssetsController.php b/app/controllers/admin/AssetsController.php index aa9784bc2a..37ba3636e5 100755 --- a/app/controllers/admin/AssetsController.php +++ b/app/controllers/admin/AssetsController.php @@ -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); } diff --git a/app/lang/en/general.php b/app/lang/en/general.php index 429bfa288a..3fae109081 100755 --- a/app/lang/en/general.php +++ b/app/lang/en/general.php @@ -100,6 +100,7 @@ 'ready_to_deploy' => 'Ready to Deploy', 'recent_activity' => 'Recent Activity', 'reports' => 'Reports', + 'requested' => 'Requested', 'save' => 'Save', 'select' => 'Select', 'search' => 'Search', diff --git a/app/views/backend/dashboard.blade.php b/app/views/backend/dashboard.blade.php index b9cb4d0d42..53f057162a 100755 --- a/app/views/backend/dashboard.blade.php +++ b/app/views/backend/dashboard.blade.php @@ -45,7 +45,12 @@ @foreach ($recent_activity as $activity) {{{ date("M d", strtotime($activity->created_at)) }}} - {{{ $activity->adminlog->fullName() }}} + + @if ($activity->action_type!='requested') + {{{ $activity->adminlog->fullName() }}} + @endif + + @if (($activity->assetlog) && ($activity->asset_type=="hardware")) @@ -65,9 +70,11 @@ {{ strtolower(Lang::get('general.'.str_replace(' ','_',$activity->action_type))) }} - @if ($activity->userlog) + @if ($activity->action_type=='requested') + {{{ $activity->adminlog->fullName() }}} + @elseif ($activity->userlog) {{{ $activity->userlog->fullName() }}} - @endif + @endif