mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 21:54:14 -08:00
this should more or less work, but i need to determine if this is the best way
This commit is contained in:
parent
ff145abbe7
commit
cc3b8e0681
|
@ -263,7 +263,16 @@ class UsersController extends Controller
|
||||||
$user->activated = $request->input('activated', 0);
|
$user->activated = $request->input('activated', 0);
|
||||||
$user->jobtitle = $request->input('jobtitle', null);
|
$user->jobtitle = $request->input('jobtitle', null);
|
||||||
$user->phone = $request->input('phone');
|
$user->phone = $request->input('phone');
|
||||||
$user->location_id = $request->input('location_id', null); //here
|
$user->location_id = $request->input('location_id', null);
|
||||||
|
if ($request->has('company_id')) {
|
||||||
|
if ($user->assets->count() > 0) {
|
||||||
|
if ($user->assets()->pluck('company_id') != $user->getRawOriginal('company_id')) {
|
||||||
|
{
|
||||||
|
return back()->with('error', 'this user has assets, check them in first');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
$user->company_id = Company::getIdForUser($request->input('company_id', null));
|
$user->company_id = Company::getIdForUser($request->input('company_id', null));
|
||||||
$user->manager_id = $request->input('manager_id', null);
|
$user->manager_id = $request->input('manager_id', null);
|
||||||
$user->notes = $request->input('notes');
|
$user->notes = $request->input('notes');
|
||||||
|
|
Loading…
Reference in a new issue