ComponentsController.php
Go to the documentation of this file.
57 $category_list = array('' => '') + DB::table('categories')->where('category_type', '=', 'component')->whereNull('deleted_at')->orderBy('name', 'ASC')->lists('name', 'id');
109 return Redirect::to("admin/components")->with('success', trans('admin/components/message.create.success'));
131 return Redirect::to('admin/components')->with('error', trans('admin/components/message.does_not_exist'));
133 return Redirect::to('admin/components')->with('error', trans('general.insufficient_permissions'));
161 return Redirect::to('admin/components')->with('error', trans('admin/components/message.does_not_exist'));
163 return Redirect::to('admin/components')->with('error', trans('general.insufficient_permissions'));
192 return Redirect::to("admin/components")->with('success', trans('admin/components/message.update.success'));
215 return Redirect::to('admin/components')->with('error', trans('admin/components/message.not_found'));
217 return Redirect::to('admin/components')->with('error', trans('general.insufficient_permissions'));
223 return Redirect::to('admin/components')->with('success', trans('admin/components/message.delete.success'));
255 return Redirect::to('admin/components')->with('error', trans('general.insufficient_permissions'));
286 return Redirect::to('admin/components')->with('error', trans('general.insufficient_permissions'));
292 return View::make('components/checkout', compact('component'))->with('assets_list', $assets_list);
312 return Redirect::to('admin/components')->with('error', trans('general.insufficient_permissions'));
321 return Redirect::to('admin/components')->with('error', trans('admin/components/message.asset_does_not_exist'));
360 'value' => strtoupper($logaction->asset_type).' <'.config('app.url').'/admin/components/'.$component->id.'/view'.'|'.$component->name.'> checked out to <'.config('app.url').'/hardware/'.$asset->id.'/view|'.$asset->name.'> by <'.config('app.url').'/admin/users/'.$admin_user->id.'/view'.'|'.$admin_user->fullName().'>.'
378 return Redirect::to("admin/components")->with('success', trans('admin/components/message.checkout.success'));
415 $allowed_columns = ['id','name','min_amt','order_number','purchase_date','purchase_cost','companyName','category','total_qty'];
440 $actions = '<nobr><a href="'.route('checkout/component', $component->id).'" style="margin-right:5px;" class="btn btn-info btn-sm" '.(($component->numRemaining() > 0 ) ? '' : ' disabled').'>'.trans('general.checkout').'</a><a href="'.route('update/component', $component->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/component', $component->id).'" data-content="'.trans('admin/components/message.delete.confirm').'" data-title="'.trans('general.delete').' '.htmlspecialchars($component->name).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a></nobr>';
444 'checkbox' =>'<div class="text-center"><input type="checkbox" name="component['.$component->id.']" class="one_required"></div>',
453 'purchase_cost' => ($component->purchase_cost!='') ? number_format($component->purchase_cost, 2): '' ,
489 'name' => (string)link_to('/hardware/'.$component_assignment->id.'/view', e($component_assignment->name)),
491 'created_at' => ($component_assignment->created_at->format('Y-m-d H:i:s')=='-0001-11-30 00:00:00') ? '' : $component_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
getView($componentId=null)
Return a view to display component information.
Definition: ComponentsController.php:247
postBulk($componentId=null)
Definition: ComponentsController.php:227
static getIdForCurrentUser($unescaped_input)
Definition: Company.php:81
postBulkSave($componentId=null)
Definition: ComponentsController.php:232
getIndex()
Returns a view that invokes the ajax tables which actually contains the content for the components li...
Definition: ComponentsController.php:40
Definition: AccessoriesController.php:2
postEdit($componentId=null)
Return a view to edit a component.
Definition: ComponentsController.php:156
This class controls all actions related to Components for the Snipe-IT Asset Management application...
Definition: ComponentsController.php:29
static isCurrentUserHasAccess($companyable)
Definition: Company.php:96
getCheckout($componentId)
Returns a view that allows the checkout of a component to an asset.
Definition: ComponentsController.php:279
postCheckout(ComponentCheckoutRequest $request, $componentId)
Validate and store checkout data.
Definition: ComponentsController.php:305
Definition: Controller.php:30
getEdit($componentId=null)
Return a view to edit a component.
Definition: ComponentsController.php:126
getDatatable()
Generates the JSON response for accessories listing view.
Definition: ComponentsController.php:394
getDataView($componentId)
Return JSON data to populate the components view,.
Definition: ComponentsController.php:475