mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
wip
This commit is contained in:
parent
cdda4a56d8
commit
815c77f943
|
@ -223,7 +223,7 @@ class BulkAssetsController extends Controller
|
||||||
$asset->save();
|
$asset->save();
|
||||||
}
|
}
|
||||||
if (!$asset->save()) {
|
if (!$asset->save()) {
|
||||||
$error_bag[] = $asset->getErrors();
|
$error_bag[] = $asset->getErrors()->toArray();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -231,14 +231,18 @@ class BulkAssetsController extends Controller
|
||||||
}
|
}
|
||||||
} // endforeach ($assets)
|
} // endforeach ($assets)
|
||||||
if(!empty($error_bag)) {
|
if(!empty($error_bag)) {
|
||||||
$ids = array_values($assets);
|
// $errors = collect($error_bag)->unique();
|
||||||
// dd($ids);
|
// foreach ($errors as $key => $value) {
|
||||||
// return redirect()->back()
|
// ray($value->message);
|
||||||
// ->withInput(["ids" => $ids, "bulk_actions" => "edit"])
|
// }
|
||||||
// ->with('error_messages', $error_bag);
|
$errors = [];
|
||||||
// return $error_bag;
|
foreach ($error_bag as $key => $value) {
|
||||||
|
foreach($value as $key => $value) {
|
||||||
return redirect($bulk_back_url)->with('error_messages', $error_bag);
|
$errors[] = $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ray($errors);
|
||||||
|
return redirect($bulk_back_url)->with('bulk_errors', $errors);
|
||||||
}
|
}
|
||||||
return redirect($bulk_back_url)->with('success', trans('admin/hardware/message.update.success'));
|
return redirect($bulk_back_url)->with('success', trans('admin/hardware/message.update.success'));
|
||||||
}
|
}
|
||||||
|
|
|
@ -115,6 +115,21 @@
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
|
||||||
|
@if ($messages = Session::get('bulk_errors'))
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="alert alert alert-danger fade in">
|
||||||
|
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||||
|
<i class="fas fa-exclamation-triangle faa-pulse animated"></i>
|
||||||
|
<strong>{{ trans('general.notification_error') }} </strong>
|
||||||
|
The following fields had validation errors and were not edited:
|
||||||
|
@foreach($messages as $message => $value)
|
||||||
|
<br> {{ $value. }}
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
|
||||||
@if ($message = Session::get('warning'))
|
@if ($message = Session::get('warning'))
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="alert alert-warning fade in">
|
<div class="alert alert-warning fade in">
|
||||||
|
|
Loading…
Reference in a new issue