mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Update LocationsController.php
This commit is contained in:
parent
878cfee5a2
commit
9b3a8c046c
|
@ -265,26 +265,28 @@ class LocationsController extends Controller
|
||||||
return redirect()->route('locations.index')->with('error', trans('admin/locations/message.does_not_exist', compact('id')));
|
return redirect()->route('locations.index')->with('error', trans('admin/locations/message.does_not_exist', compact('id')));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function print_assigned($id)
|
public function print_assigned($id)
|
||||||
{
|
{
|
||||||
|
|
||||||
$show_location = Location::where('id',$id)->withTrashed()->first();
|
$location = Location::where('id',$id)->first();
|
||||||
$manager = User::where('id',$show_location->manager_id)->withTrashed()->first();
|
$parent = Location::where('id',$location->parent_id)->first();
|
||||||
|
$manager = User::where('id',$location->manager_id)->first();
|
||||||
$users = User::where('location_id', $id)->with('company', 'department', 'location')->get();
|
$users = User::where('location_id', $id)->with('company', 'department', 'location')->get();
|
||||||
$assets = Asset::where('assigned_to', $id)->where('assigned_type', Location::class)->with('model', 'model.category')->get();
|
$assets = Asset::where('assigned_to', $id)->where('assigned_type', Location::class)->with('model', 'model.category')->get();
|
||||||
return view('locations/print')->with('assets', $assets)->with('users',$users)->with('show_location', $show_location)->with('manager', $manager);
|
return view('locations/print')->with('assets', $assets)->with('users',$users)->with('location', $location)->with('parent', $parent)->with('manager', $manager);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function print_all_assigned($id)
|
public function print_all_assigned($id)
|
||||||
{
|
{
|
||||||
|
|
||||||
$show_location = Location::where('id',$id)->withTrashed()->first();
|
$location = Location::where('id',$id)->first();
|
||||||
$manager = User::where('id',$show_location->manager_id)->withTrashed()->first();
|
$parent = Location::where('id',$location->parent_id)->first();
|
||||||
$users = User::where('location_id', $id)->with('company', 'department', 'location')->get();
|
$manager = User::where('id',$location->manager_id)->first();
|
||||||
|
$users = User::where('location_id', $id)->with('company', 'department', 'location')->get();
|
||||||
$assets = Asset::where('location_id', $id)->with('model', 'model.category')->get();
|
$assets = Asset::where('location_id', $id)->with('model', 'model.category')->get();
|
||||||
return view('locations/print')->with('assets', $assets)->with('users',$users)->with('show_location', $show_location)->with('manager', $manager);
|
return view('locations/print')->with('assets', $assets)->with('users',$users)->with('location', $location)->with('parent', $parent)->with('manager', $manager);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in a new issue