Skip to content

A free open source IT asset/license management system

Merge branch 'master' of https://github.com/ajsy/snipe-it into ajsy-master

snipeb9bab05ac3ec
diff --cc app/Http/Controllers/LocationsController.php
index 03e1a26e28,abe7ee43ad..e0b7754837
--- a/app/Http/Controllers/LocationsController.php
+++ b/app/Http/Controllers/LocationsController.php
@@@ -208,7 -262,31 +208,31 @@@ class LocationsController extends Contr
return view('locations/view', compact('location'));
}
- 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'));
}
+
+ public function print_assigned($id)
+ {
+
+ $location = Location::where('id',$id)->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();
+ $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('location', $location)->with('parent', $parent)->with('manager', $manager);
+
+ }
+
+ public function print_all_assigned($id)
+ {
+
+ $location = Location::where('id',$id)->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();
+ $assets = Asset::where('location_id', $id)->with('model', 'model.category')->get();
+ return view('locations/print')->with('assets', $assets)->with('users',$users)->with('location', $location)->with('parent', $parent)->with('manager', $manager);
+
+ }
- }
+ }
diff --cc resources/views/users/print.blade.php
index 814f29ca72,76b7dab57f..2be381f52e
--- a/resources/views/users/print.blade.php
+++ b/resources/views/users/print.blade.php
@@@ -141,13 -117,7 +141,13 @@@
<tr>
<td>{{ $lcounter }}</td>
<td>{{ $license->name }}</td>
- <td>{{ preg_replace ('/[a-zA-Z\d-]/', 'x', $license->serial, strlen($license->serial) -5) }}</td>
+ <td>
+ @can('viewKeys', $license)
+ {{ $license->serial }}
+ @else
- ------------
++ <i class="fa-lock" aria-hidden="true"></i> {{ str_repeat('x', 15) }}
+ @endcan
+ </td>
<td>{{ $license->assetlog->first()->created_at }}</td>
</tr>
@php