LocationsController.php
Go to the documentation of this file.
37 $locations = Location::orderBy('created_at', 'DESC')->with('parent', 'assets', 'assignedassets')->get();
100 return Redirect::to("admin/settings/locations")->with('success', trans('admin/locations/message.create.success'));
143 return JsonResponse::create(["error" => "Failed validation: ".print_r($location->getErrors(), true)], 500);
161 return Redirect::to('admin/settings/locations')->with('error', trans('admin/locations/message.does_not_exist'));
170 return View::make('locations/edit', compact('location'))->with('location_options', $location_options);
188 return Redirect::to('admin/settings/locations')->with('error', trans('admin/locations/message.does_not_exist'));
209 return Redirect::to("admin/settings/locations/")->with('success', trans('admin/locations/message.update.success'));
230 return Redirect::to('admin/settings/locations')->with('error', trans('admin/locations/message.not_found'));
235 return Redirect::to('admin/settings/locations')->with('error', trans('admin/locations/message.assoc_users'));
237 return Redirect::to('admin/settings/locations')->with('error', trans('admin/locations/message.assoc_child_loc'));
239 return Redirect::to('admin/settings/locations')->with('error', trans('admin/locations/message.assoc_assets'));
241 return Redirect::to('admin/settings/locations')->with('error', trans('admin/locations/message.assoc_assets'));
244 return Redirect::to('admin/settings/locations')->with('success', trans('admin/locations/message.delete.success'));
291 $locations = Location::select(array('locations.id','locations.name','locations.address','locations.address2','locations.city','locations.state','locations.zip','locations.country','locations.parent_id','locations.currency'))->with('assets');
333 $actions = '<nobr><a href="'.route('update/location', $location->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/location', $location->id).'" data-content="'.trans('admin/locations/message.delete.confirm').'" data-title="'.trans('general.delete').' '.htmlspecialchars($location->name).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a></nobr>';
337 'name' => (string)link_to('admin/settings/locations/'.$location->id.'/view', e($location->name)),
getIndex()
Returns a view that invokes the ajax tables which actually contains the content for the locations lis...
Definition: LocationsController.php:34
getDataViewUsers($locationID)
Returns a JSON response that contains the users association with the selected location, to be used by the location detail view.
Definition: LocationsController.php:368
Definition: Location.php:10
getDataViewAssets($locationID)
Returns a JSON response that contains the assets association with the selected location, to be used by the location detail view.
Definition: LocationsController.php:396
Definition: AccessoriesController.php:2
getEdit($locationId=null)
Makes a form view to edit location information.
Definition: LocationsController.php:157
This controller handles all actions related to Locations for the Snipe-IT Asset Management applicatio...
Definition: LocationsController.php:22
Definition: Controller.php:30
getView($locationId=null)
Returns a view that invokes the ajax tables which actually contains the content for the locations det...
Definition: LocationsController.php:263
store()
Validates and stores a new location created via the Create Asset form modal.
Definition: LocationsController.php:116
static getLocationHierarchy($locations, $parent_id=null)
Definition: Location.php:68
getCreate()
Returns a form view used to create a new location.
Definition: LocationsController.php:52
static flattenLocationsArray($location_options_array=null)
Definition: Location.php:96
getDelete($locationId)
Validates and deletes selected location.
Definition: LocationsController.php:225
postEdit($locationId=null)
Validates and stores updated location data from edit form.
Definition: LocationsController.php:183
getDatatable()
Returns the JSON response to populate the bootstrap tables on the locationa view. ...
Definition: LocationsController.php:289