AccessoriesController.php
  
Go to the documentation of this file.
   55         $category_list = array('' => '') + DB::table('categories')->where('category_type', '=', 'accessory')->whereNull('deleted_at')->orderBy('name', 'ASC')->lists('name', 'id');
  104             return Redirect::to("admin/accessories")->with('success', trans('admin/accessories/message.create.success'));
  123             return Redirect::to('admin/accessories')->with('error', trans('admin/accessories/message.does_not_exist'));
  125             return Redirect::to('admin/accessories')->with('error', trans('general.insufficient_permissions'));
  128         $category_list = array('' => '') + DB::table('categories')->where('category_type', '=', 'accessory')->whereNull('deleted_at')->orderBy('name', 'ASC')->lists('name', 'id');
  151             return Redirect::to('admin/accessories')->with('error', trans('admin/accessories/message.does_not_exist'));
  153             return Redirect::to('admin/accessories')->with('error', trans('general.insufficient_permissions'));
  186             return Redirect::to("admin/accessories")->with('success', trans('admin/accessories/message.update.success'));
  206             return Redirect::to('admin/accessories')->with('error', trans('admin/accessories/message.not_found'));
  208             return Redirect::to('admin/accessories')->with('error', trans('general.insufficient_permissions'));
  213              return Redirect::to('admin/accessories')->with('error', trans('admin/accessories/message.assoc_users', array('count'=> $accessory->hasUsers())));
  218             return Redirect::to('admin/accessories')->with('success', trans('admin/accessories/message.delete.success'));
  242                 return Redirect::to('admin/accessories')->with('error', trans('general.insufficient_permissions'));
  269             return Redirect::to('accessories')->with('error', trans('admin/accessories/message.not_found'));
  271             return Redirect::to('admin/accessories')->with('error', trans('general.insufficient_permissions'));
  277         return View::make('accessories/checkout', compact('accessory'))->with('users_list', $users_list);
  296             return Redirect::to('accessories')->with('error', trans('admin/accessories/message.user_not_found'));
  298             return Redirect::to('admin/accessories')->with('error', trans('general.insufficient_permissions'));
  302             return Redirect::to('admin/accessories')->with('error', trans('admin/accessories/message.not_found'));
  343                   'value' => strtoupper($logaction->asset_type).' <'.config('app.url').'/admin/accessories/'.$accessory->id.'/view'.'|'.$accessory->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().'>.'
  361         $accessory_user = DB::table('accessories_users')->where('assigned_to', '=', $accessory->assigned_to)->where('accessory_id', '=', $accessory->id)->first();
  383         return Redirect::to("admin/accessories")->with('success', trans('admin/accessories/message.checkout.success'));
  402             return Redirect::to('admin/accessories')->with('error', trans('admin/accessories/message.not_found'));
  408             return Redirect::to('admin/accessories')->with('error', trans('general.insufficient_permissions'));
  428             return Redirect::to('admin/accessories')->with('error', trans('admin/accessories/message.not_found'));
  435             return Redirect::to('admin/accessories')->with('error', trans('general.insufficient_permissions'));
  472                                 'value' => strtoupper($logaction->asset_type).' <'.config('app.url').'/admin/accessories/'.e($accessory->id).'/view'.'|'.e($accessory->name).'> checked in by <'.config('app.url').'/admin/users/'.e($admin_user->id).'/view'.'|'.e($admin_user->fullName()).'>.'
  511                 return Redirect::to("admin/users/".$return_to.'/view')->with('success', trans('admin/accessories/message.checkin.success'));
  513                 return Redirect::to("admin/accessories/".$accessory->id."/view")->with('success', trans('admin/accessories/message.checkin.success'));
  518         return Redirect::to("admin/accessories")->with('error', trans('admin/accessories/message.checkin.error'));
  570         $allowed_columns = ['name','min_amt','order_number','purchase_date','purchase_cost','companyName','category'];
  592             $actions = '<nobr><a href="'.route('checkout/accessory', $accessory->id).'" style="margin-right:5px;" class="btn btn-info btn-sm" '.(($accessory->numRemaining() > 0 ) ? '' : ' disabled').'>'.trans('general.checkout').'</a><a href="'.route('update/accessory', $accessory->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/accessory', $accessory->id).'" data-content="'.trans('admin/accessories/message.delete.confirm').'" data-title="'.trans('general.delete').' '.htmlspecialchars($accessory->name).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a></nobr>';
  596             'name'          => '<a href="'.url('admin/accessories/'.$accessory->id).'/view">'. $accessory->name.'</a>',
  597             'category'      => ($accessory->category) ? (string)link_to('admin/settings/categories/'.$accessory->category->id.'/view', $accessory->category->name) : '',
  655             $actions = '<a href="'.route('checkin/accessory', $user->pivot->id).'" class="btn btn-info btn-sm">Checkin</a>';
getCheckout(Request $request, $accessoryId)
Return the form to checkout an Accessory to a user. 
Definition: AccessoriesController.php:264
getEdit(Request $request, $accessoryId=null)
Return view for the Accessory update form, prepopulated with existing data. 
Definition: AccessoriesController.php:118
getIndex(Request $request)
Returns a view that invokes the ajax tables which actually contains the content for the accessories l...
Definition: AccessoriesController.php:40
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
postEdit(Request $request, $accessoryId=null)
Save edited Accessory from form post. 
Definition: AccessoriesController.php:146
This controller handles all actions related to Accessories for the Snipe-IT Asset Management applicat...
Definition: AccessoriesController.php:28
Definition: AccessoriesController.php:2
getDataView(Request $request, $accessoryID)
Generates the JSON response for accessory detail view. 
Definition: AccessoriesController.php:641
static isCurrentUserHasAccess($companyable)
Definition: Company.php:96
getDelete(Request $request, $accessoryId)
Delete the given accessory. 
Definition: AccessoriesController.php:201
Definition: Controller.php:30
getView(Request $request, $accessoryID=null)
Returns a view that invokes the ajax table which contains the content for the accessory detail view...
Definition: AccessoriesController.php:235
getDatatable(Request $request)
Generates the JSON response for accessories listing view. 
Definition: AccessoriesController.php:548
getCreate(Request $request)
Returns a view with a form to create a new Accessory. 
Definition: AccessoriesController.php:52
postCheckout(Request $request, $accessoryId)
Save the Accessory checkout information. 
Definition: AccessoriesController.php:291
postCheckin(Request $request, $accessoryUserId=null, $backto=null)
Check in the item so that it can be checked out again to someone else. 
Definition: AccessoriesController.php:423
getCheckin(Request $request, $accessoryUserId=null, $backto=null)
Check the accessory back into inventory. 
Definition: AccessoriesController.php:397
postCreate(Request $request)
Validate and save new Accessory from form post. 
Definition: AccessoriesController.php:72
 
          
          