This controller handles all actions related to Accessories for the Snipe-IT Asset Management application. More...

Public Member Functions | |
getIndex (Request $request) | |
Returns a view that invokes the ajax tables which actually contains the content for the accessories listing, which is generated in getDatatable. More... | |
getCreate (Request $request) | |
Returns a view with a form to create a new Accessory. More... | |
postCreate (Request $request) | |
Validate and save new Accessory from form post. More... | |
getEdit (Request $request, $accessoryId=null) | |
Return view for the Accessory update form, prepopulated with existing data. More... | |
postEdit (Request $request, $accessoryId=null) | |
Save edited Accessory from form post. More... | |
getDelete (Request $request, $accessoryId) | |
Delete the given accessory. More... | |
getView (Request $request, $accessoryID=null) | |
Returns a view that invokes the ajax table which contains the content for the accessory detail view, which is generated in getDataView. More... | |
getCheckout (Request $request, $accessoryId) | |
Return the form to checkout an Accessory to a user. More... | |
postCheckout (Request $request, $accessoryId) | |
Save the Accessory checkout information. More... | |
getCheckin (Request $request, $accessoryUserId=null, $backto=null) | |
Check the accessory back into inventory. More... | |
postCheckin (Request $request, $accessoryUserId=null, $backto=null) | |
Check in the item so that it can be checked out again to someone else. More... | |
getDatatable (Request $request) | |
Generates the JSON response for accessories listing view. More... | |
getDataView (Request $request, $accessoryID) | |
Generates the JSON response for accessory detail view. More... | |
Detailed Description
This controller handles all actions related to Accessories for the Snipe-IT Asset Management application.
- Version
- v1.0
Definition at line 28 of file AccessoriesController.php.
Member Function Documentation
App\Http\Controllers\AccessoriesController::getCheckin | ( | Request | $request, |
$accessoryUserId = null , |
|||
$backto = null |
|||
) |
Check the accessory back into inventory.
- Parameters
-
int $accessoryId
- Returns
- View
Definition at line 397 of file AccessoriesController.php.
App\Http\Controllers\AccessoriesController::getCheckout | ( | Request | $request, |
$accessoryId | |||
) |
Return the form to checkout an Accessory to a user.
- Parameters
-
int $accessoryId
- Returns
- View
Definition at line 264 of file AccessoriesController.php.
App\Http\Controllers\AccessoriesController::getCreate | ( | Request | $request | ) |
Returns a view with a form to create a new Accessory.
- Returns
- View
Definition at line 52 of file AccessoriesController.php.
App\Http\Controllers\AccessoriesController::getDatatable | ( | Request | $request | ) |
Generates the JSON response for accessories listing view.
Example: { "actions": "(links to available actions)", "category": "(link to category)", "companyName": "My Company", "location": "My Location", "min_amt": 2, "name": "(link to accessory), "numRemaining": 6, "order_number": null, "purchase_cost": "0.00", "purchase_date": null, "qty": 7 },
The names of the fields in the returns JSON correspond directly to the the names of the fields in the bootstrap-tables in the view.
For debugging, see at /api/accessories/list
- Parameters
-
int $accessoryId
- Returns
- string JSON containing accessories and their associated atrributes.
Definition at line 548 of file AccessoriesController.php.
App\Http\Controllers\AccessoriesController::getDataView | ( | Request | $request, |
$accessoryID | |||
) |
Generates the JSON response for accessory detail view.
Example: { "rows": [ { "actions": "(link to available actions)", "name": "(link to user)" } ], "total": 1 }
The names of the fields in the returns JSON correspond directly to the the names of the fields in the bootstrap-tables in the view.
For debugging, see at /api/accessories/$accessoryID/view
- Parameters
-
int $accessoryId
- Returns
- string JSON containing accessories and their associated atrributes.
Definition at line 641 of file AccessoriesController.php.
App\Http\Controllers\AccessoriesController::getDelete | ( | Request | $request, |
$accessoryId | |||
) |
Delete the given accessory.
- Parameters
-
int $accessoryId
- Returns
- Redirect
Definition at line 201 of file AccessoriesController.php.
App\Http\Controllers\AccessoriesController::getEdit | ( | Request | $request, |
$accessoryId = null |
|||
) |
Return view for the Accessory update form, prepopulated with existing data.
- Parameters
-
int $accessoryId
- Returns
- View
Definition at line 118 of file AccessoriesController.php.
App\Http\Controllers\AccessoriesController::getIndex | ( | Request | $request | ) |
Returns a view that invokes the ajax tables which actually contains the content for the accessories listing, which is generated in getDatatable.
- See also
- AccessoriesController::getDatatable() method that generates the JSON response
- Since
- [v1.0]
- Returns
- View
Definition at line 40 of file AccessoriesController.php.
App\Http\Controllers\AccessoriesController::getView | ( | Request | $request, |
$accessoryID = null |
|||
) |
Returns a view that invokes the ajax table which contains the content for the accessory detail view, which is generated in getDataView.
- Parameters
-
int $accessoryId
- See also
- AccessoriesController::getDataView() method that generates the JSON response
- Since
- [v1.0]
- Returns
- View
Definition at line 235 of file AccessoriesController.php.
App\Http\Controllers\AccessoriesController::postCheckin | ( | Request | $request, |
$accessoryUserId = null , |
|||
$backto = null |
|||
) |
Check in the item so that it can be checked out again to someone else.
Accessory::checkin_email() to determine if an email can and should be sent
- Parameters
-
int $accessoryId
- Returns
- Redirect
Definition at line 423 of file AccessoriesController.php.
App\Http\Controllers\AccessoriesController::postCheckout | ( | Request | $request, |
$accessoryId | |||
) |
Save the Accessory checkout information.
If Slack is enabled and/or asset acceptance is enabled, it will also trigger a Slack message and send an email.
- Parameters
-
int $accessoryId
- Returns
- Redirect
Definition at line 291 of file AccessoriesController.php.
App\Http\Controllers\AccessoriesController::postCreate | ( | Request | $request | ) |
Validate and save new Accessory from form post.
- Returns
- Redirect
Definition at line 72 of file AccessoriesController.php.
App\Http\Controllers\AccessoriesController::postEdit | ( | Request | $request, |
$accessoryId = null |
|||
) |
Save edited Accessory from form post.
- Parameters
-
int $accessoryId
- Returns
- Redirect
Definition at line 146 of file AccessoriesController.php.
The documentation for this class was generated from the following file: