ConsumablesController.php
Go to the documentation of this file.
55 $category_list = array('' => '') + DB::table('categories')->where('category_type', '=', 'consumable')->whereNull('deleted_at')->orderBy('name', 'ASC')->lists('name', 'id');
103 return Redirect::to("admin/consumables")->with('success', trans('admin/consumables/message.create.success'));
125 return Redirect::to('admin/consumables')->with('error', trans('admin/consumables/message.does_not_exist'));
127 return Redirect::to('admin/consumables')->with('error', trans('general.insufficient_permissions'));
153 return Redirect::to('admin/consumables')->with('error', trans('admin/consumables/message.does_not_exist'));
155 return Redirect::to('admin/consumables')->with('error', trans('general.insufficient_permissions'));
180 return Redirect::to("admin/consumables")->with('success', trans('admin/consumables/message.update.success'));
200 return Redirect::to('admin/consumables')->with('error', trans('admin/consumables/message.not_found'));
202 return Redirect::to('admin/consumables')->with('error', trans('general.insufficient_permissions'));
208 return Redirect::to('admin/consumables')->with('success', trans('admin/consumables/message.delete.success'));
231 return Redirect::to('admin/consumables')->with('error', trans('general.insufficient_permissions'));
260 return Redirect::to('consumables')->with('error', trans('admin/consumables/message.not_found'));
262 return Redirect::to('admin/consumables')->with('error', trans('general.insufficient_permissions'));
268 return View::make('consumables/checkout', compact('consumable'))->with('users_list', $users_list);
286 return Redirect::to('consumables')->with('error', trans('admin/consumables/message.not_found'));
288 return Redirect::to('admin/consumables')->with('error', trans('general.insufficient_permissions'));
297 return Redirect::to('admin/consumables')->with('error', trans('admin/consumables/message.user_does_not_exist'));
334 'value' => strtoupper($logaction->asset_type).' <'.config('app.url').'/admin/consumables/'.$consumable->id.'/view'.'|'.$consumable->name.'> checked out to <'.config('app.url').'/admin/users/'.$user->id.'/view|'.$user->fullName().'> by <'.config('app.url').'/admin/users/'.$admin_user->id.'/view'.'|'.$admin_user->fullName().'>.'
351 $consumable_user = DB::table('consumables_users')->where('assigned_to', '=', $consumable->assigned_to)->where('consumable_id', '=', $consumable->id)->first();
373 return Redirect::to("admin/consumables")->with('success', trans('admin/consumables/message.checkout.success'));
410 $allowed_columns = ['id','name','order_number','min_amt','purchase_date','purchase_cost','companyName','category'];
435 $actions = '<nobr><a href="'.route('checkout/consumable', $consumable->id).'" style="margin-right:5px;" class="btn btn-info btn-sm" '.(($consumable->numRemaining() > 0 ) ? '' : ' disabled').'>'.trans('general.checkout').'</a><a href="'.route('update/consumable', $consumable->id).'" class="btn btn-warning btn-sm" style="margin-right:5px;"><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/consumable', $consumable->id).'" data-content="'.trans('admin/consumables/message.delete.confirm').'" data-title="'.trans('general.delete').' '.htmlspecialchars($consumable->name).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a></nobr>';
447 'purchase_cost' => ($consumable->purchase_cost!='') ? number_format($consumable->purchase_cost, 2): '' ,
492 'name' => (string)link_to('/admin/users/'.$consumable_assignment->user->id.'/view', e($consumable_assignment->user->fullName())),
493 'created_at' => ($consumable_assignment->created_at->format('Y-m-d H:i:s')=='-0001-11-30 00:00:00') ? '' : $consumable_assignment->created_at->format('Y-m-d H:i:s'),
Model for the Actionlog (the table that keeps a historical log of checkouts, checkins, and updates).
Definition: Actionlog.php:15
static getIdForCurrentUser($unescaped_input)
Definition: Company.php:81
getCheckout($consumableId)
Return a view to checkout a consumable to a user.
Definition: ConsumablesController.php:255
Definition: AccessoriesController.php:2
postEdit($consumableId=null)
Returns a form view to edit a consumable.
Definition: ConsumablesController.php:150
static isCurrentUserHasAccess($companyable)
Definition: Company.php:96
postCheckout($consumableId)
Saves the checkout information.
Definition: ConsumablesController.php:281
Definition: Controller.php:30
getView($consumableId=null)
Return a view to display component information.
Definition: ConsumablesController.php:223
getCreate()
Return a view to display the form view to create a new consumable.
Definition: ConsumablesController.php:52
Definition: Consumable.php:14
getDataView($consumableId)
Returns a JSON response containing details on the users associated with this consumable.
Definition: ConsumablesController.php:469
getEdit($consumableId=null)
Returns a form view to edit a consumable.
Definition: ConsumablesController.php:120
getDatatable()
Returns the JSON response containing the the consumables data.
Definition: ConsumablesController.php:389
This controller handles all actions related to Consumables for the Snipe-IT Asset Management applicat...
Definition: ConsumablesController.php:28