mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-24 12:17:05 -08:00
Update Assets locations when user's location changes whey they got bulk-edited
This commit is contained in:
parent
4b255ada70
commit
6529a75683
|
@ -109,12 +109,15 @@ class BulkUsersController extends Controller
|
|||
if (!$manager_conflict) {
|
||||
$this->conditionallyAddItem('manager_id');
|
||||
}
|
||||
|
||||
|
||||
// Save the updated info
|
||||
User::whereIn('id', $user_raw_array)
|
||||
->where('id', '!=', Auth::id())->update($this->update_array);
|
||||
|
||||
if(array_key_exists('location_id', $this->update_array)){
|
||||
Asset::where('assigned_type', User::class)
|
||||
->whereIn('assigned_to', $user_raw_array)
|
||||
->update(['location_id' => $this->update_array['location_id']]);
|
||||
}
|
||||
// Only sync groups if groups were selected
|
||||
if ($request->filled('groups')) {
|
||||
foreach ($users as $user) {
|
||||
|
|
Loading…
Reference in a new issue