Merge remote-tracking branch 'origin/develop'

This commit is contained in:
snipe 2021-04-23 14:27:12 -07:00
commit 138ddfec1c
3 changed files with 5 additions and 2 deletions

View file

@ -49,6 +49,7 @@ class UsersController extends Controller
'users.jobtitle', 'users.jobtitle',
'users.last_login', 'users.last_login',
'users.last_name', 'users.last_name',
'users.locale',
'users.location_id', 'users.location_id',
'users.manager_id', 'users.manager_id',
'users.notes', 'users.notes',

View file

@ -4,6 +4,7 @@ namespace App\Http\Controllers;
use App\Http\Requests\ImageUploadRequest; use App\Http\Requests\ImageUploadRequest;
use App\Models\Location; use App\Models\Location;
use App\Models\User;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Storage; use Illuminate\Support\Facades\Storage;
@ -216,8 +217,8 @@ public function print_assigned($id)
$location = Location::where('id',$id)->first(); $location = Location::where('id',$id)->first();
$parent = Location::where('id',$location->parent_id)->first(); $parent = Location::where('id',$location->parent_id)->first();
$manager = User::where('id',$location->manager_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('location', $location)->with('parent', $parent)->with('manager', $manager); return view('locations/print')->with('assets', $assets)->with('users',$users)->with('location', $location)->with('parent', $parent)->with('manager', $manager);

View file

@ -27,6 +27,7 @@ class UsersTransformer
'first_name' => e($user->first_name), 'first_name' => e($user->first_name),
'last_name' => e($user->last_name), 'last_name' => e($user->last_name),
'username' => e($user->username), 'username' => e($user->username),
'locale' => ($user->locale) ? e($user->locale) : null,
'employee_num' => e($user->employee_num), 'employee_num' => e($user->employee_num),
'manager' => ($user->manager) ? [ 'manager' => ($user->manager) ? [
'id' => (int) $user->manager->id, 'id' => (int) $user->manager->id,