mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-24 04:03:34 -08:00
wip
This commit is contained in:
parent
cdda4a56d8
commit
815c77f943
|
@ -223,7 +223,7 @@ class BulkAssetsController extends Controller
|
|||
$asset->save();
|
||||
}
|
||||
if (!$asset->save()) {
|
||||
$error_bag[] = $asset->getErrors();
|
||||
$error_bag[] = $asset->getErrors()->toArray();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -231,14 +231,18 @@ class BulkAssetsController extends Controller
|
|||
}
|
||||
} // endforeach ($assets)
|
||||
if(!empty($error_bag)) {
|
||||
$ids = array_values($assets);
|
||||
// dd($ids);
|
||||
// return redirect()->back()
|
||||
// ->withInput(["ids" => $ids, "bulk_actions" => "edit"])
|
||||
// ->with('error_messages', $error_bag);
|
||||
// return $error_bag;
|
||||
|
||||
return redirect($bulk_back_url)->with('error_messages', $error_bag);
|
||||
// $errors = collect($error_bag)->unique();
|
||||
// foreach ($errors as $key => $value) {
|
||||
// ray($value->message);
|
||||
// }
|
||||
$errors = [];
|
||||
foreach ($error_bag as $key => $value) {
|
||||
foreach($value as $key => $value) {
|
||||
$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'));
|
||||
}
|
||||
|
|
|
@ -115,6 +115,21 @@
|
|||
@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'))
|
||||
<div class="col-md-12">
|
||||
<div class="alert alert-warning fade in">
|
||||
|
|
Loading…
Reference in a new issue