Merge remote-tracking branch 'origin/develop'

Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	public/css/build/app.css
#	public/css/build/overrides.css
#	public/css/dist/all.css
#	public/mix-manifest.json
This commit is contained in:
snipe 2023-12-12 04:33:04 +00:00
commit f8a56f6dc2
8 changed files with 28 additions and 13 deletions

View file

@ -885,13 +885,17 @@ class AssetsController extends Controller
public function checkin(Request $request, $asset_id) public function checkin(Request $request, $asset_id)
{ {
$this->authorize('checkin', Asset::class); $this->authorize('checkin', Asset::class);
$asset = Asset::findOrFail($asset_id); $asset = Asset::with('model')->findOrFail($asset_id);
$this->authorize('checkin', $asset); $this->authorize('checkin', $asset);
$target = $asset->assignedTo; $target = $asset->assignedTo;
if (is_null($target)) { if (is_null($target)) {
return response()->json(Helper::formatStandardApiResponse('error', ['asset'=> e($asset->asset_tag)], trans('admin/hardware/message.checkin.already_checked_in'))); return response()->json(Helper::formatStandardApiResponse('error', [
'asset_tag'=> e($asset->asset_tag),
'model' => e($asset->model->name),
'model_number' => e($asset->model->model_number)
], trans('admin/hardware/message.checkin.already_checked_in')));
} }
$asset->expected_checkin = null; $asset->expected_checkin = null;
@ -925,7 +929,11 @@ class AssetsController extends Controller
if ($asset->save()) { if ($asset->save()) {
event(new CheckoutableCheckedIn($asset, $target, Auth::user(), $request->input('note'), $checkin_at, $originalValues)); event(new CheckoutableCheckedIn($asset, $target, Auth::user(), $request->input('note'), $checkin_at, $originalValues));
return response()->json(Helper::formatStandardApiResponse('success', ['asset'=> e($asset->asset_tag)], trans('admin/hardware/message.checkin.success'))); return response()->json(Helper::formatStandardApiResponse('success', [
'asset_tag'=> e($asset->asset_tag),
'model' => e($asset->model->name),
'model_number' => e($asset->model->model_number)
], trans('admin/hardware/message.checkin.success')));
} }
return response()->json(Helper::formatStandardApiResponse('error', ['asset'=> e($asset->asset_tag)], trans('admin/hardware/message.checkin.error'))); return response()->json(Helper::formatStandardApiResponse('error', ['asset'=> e($asset->asset_tag)], trans('admin/hardware/message.checkin.error')));

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -1,8 +1,8 @@
{ {
"/js/build/app.js": "/js/build/app.js?id=72071a8a4dc754c61b0440d3c4119cbf", "/js/build/app.js": "/js/build/app.js?id=72071a8a4dc754c61b0440d3c4119cbf",
"/css/dist/skins/skin-blue.css": "/css/dist/skins/skin-blue.css?id=392cc93cfc0be0349bab9697669dd091", "/css/dist/skins/skin-blue.css": "/css/dist/skins/skin-blue.css?id=392cc93cfc0be0349bab9697669dd091",
"/css/build/overrides.css": "/css/build/overrides.css?id=1b392b587d6d9c6c3208cee77dd50c24", "/css/build/overrides.css": "/css/build/overrides.css?id=c8c36239d8ef77849c8c42c7edcb9d2e",
"/css/build/app.css": "/css/build/app.css?id=def81f26a041542b7831129c1935678b", "/css/build/app.css": "/css/build/app.css?id=63bae107587455323cedd08aff2e387d",
"/css/build/AdminLTE.css": "/css/build/AdminLTE.css?id=f25c77ed07053646a42e9c19923d24fa", "/css/build/AdminLTE.css": "/css/build/AdminLTE.css?id=f25c77ed07053646a42e9c19923d24fa",
"/css/dist/skins/skin-orange.css": "/css/dist/skins/skin-orange.css?id=268041e902b019730c23ee3875838005", "/css/dist/skins/skin-orange.css": "/css/dist/skins/skin-orange.css?id=268041e902b019730c23ee3875838005",
"/css/dist/skins/skin-orange-dark.css": "/css/dist/skins/skin-orange-dark.css?id=d409d9b1a3b69247df8b98941ba06e33", "/css/dist/skins/skin-orange-dark.css": "/css/dist/skins/skin-orange-dark.css?id=d409d9b1a3b69247df8b98941ba06e33",
@ -18,7 +18,7 @@
"/css/dist/skins/skin-green.css": "/css/dist/skins/skin-green.css?id=b48f4d8af0e1ca5621c161e93951109f", "/css/dist/skins/skin-green.css": "/css/dist/skins/skin-green.css?id=b48f4d8af0e1ca5621c161e93951109f",
"/css/dist/skins/skin-contrast.css": "/css/dist/skins/skin-contrast.css?id=f0fbbb0ac729ea092578fb05ca615460", "/css/dist/skins/skin-contrast.css": "/css/dist/skins/skin-contrast.css?id=f0fbbb0ac729ea092578fb05ca615460",
"/css/dist/skins/skin-red.css": "/css/dist/skins/skin-red.css?id=b9a74ec0cd68f83e7480d5ae39919beb", "/css/dist/skins/skin-red.css": "/css/dist/skins/skin-red.css?id=b9a74ec0cd68f83e7480d5ae39919beb",
"/css/dist/all.css": "/css/dist/all.css?id=ae9bfb0457654b249e68a445ebad6409", "/css/dist/all.css": "/css/dist/all.css?id=76de0dc7f2e51d5ea594f0c21c296790",
"/css/dist/signature-pad.css": "/css/dist/signature-pad.css?id=6a89d3cd901305e66ced1cf5f13147f7", "/css/dist/signature-pad.css": "/css/dist/signature-pad.css?id=6a89d3cd901305e66ced1cf5f13147f7",
"/css/dist/signature-pad.min.css": "/css/dist/signature-pad.min.css?id=6a89d3cd901305e66ced1cf5f13147f7", "/css/dist/signature-pad.min.css": "/css/dist/signature-pad.min.css?id=6a89d3cd901305e66ced1cf5f13147f7",
"/css/webfonts/fa-brands-400.ttf": "/css/webfonts/fa-brands-400.ttf?id=a656b2d865fe379d8851757e8e4001ef", "/css/webfonts/fa-brands-400.ttf": "/css/webfonts/fa-brands-400.ttf?id=a656b2d865fe379d8851757e8e4001ef",

View file

@ -399,7 +399,7 @@ img.navbar-brand-img, .navbar-brand>img {
} }
.icon-med { .icon-med {
font-size: 20px; font-size: 14px;
color: #889195; color: #889195;
} }

View file

@ -81,6 +81,8 @@
<thead> <thead>
<tr> <tr>
<th>{{ trans('general.asset_tag') }}</th> <th>{{ trans('general.asset_tag') }}</th>
<th>{{ trans('general.asset_model') }}</th>
<th>{{ trans('general.model_no') }}</th>
<th>{{ trans('general.quickscan_checkin_status') }}</th> <th>{{ trans('general.quickscan_checkin_status') }}</th>
<th></th> <th></th>
</tr> </tr>
@ -126,7 +128,7 @@
data : formData, data : formData,
success : function (data) { success : function (data) {
if (data.status == 'success') { if (data.status == 'success') {
$('#checkedin tbody').prepend("<tr class='success'><td>" + data.payload.asset + "</td><td>" + data.messages + "</td><td><i class='fas fa-check text-success'></i></td></tr>"); $('#checkedin tbody').prepend("<tr class='success'><td>" + data.payload.asset_tag + "</td><td>" + data.payload.model + "</td><td>" + data.payload.model_number + "</td><td>" + data.messages + "</td><td><i class='fas fa-check text-success'></i></td></tr>");
incrementOnSuccess(); incrementOnSuccess();
} else { } else {
handlecheckinFail(data); handlecheckinFail(data);
@ -146,17 +148,21 @@
}); });
function handlecheckinFail (data) { function handlecheckinFail (data) {
if (data.payload.asset) { if (data.payload.asset_tag) {
var asset = data.payload.asset; var asset_tag = data.payload.asset_tag;
var model = data.payload.model;
var model_number = data.payload.model_number;
} else { } else {
var asset = ''; var asset_tag = '';
var model = '';
var model_number = '';
} }
if (data.messages) { if (data.messages) {
var messages = data.messages; var messages = data.messages;
} else { } else {
var messages = ''; var messages = '';
} }
$('#checkedin tbody').prepend("<tr class='danger'><td>" + asset + "</td><td>" + messages + "</td><td><i class='fas fa-times text-danger'></i></td></tr>"); $('#checkedin tbody').prepend("<tr class='danger'><td>" + asset_tag + "</td><td>" + model + "</td><td>" + model_number + "</td><td>" + messages + "</td><td><i class='fas fa-times text-danger'></i></td></tr>");
} }
function incrementOnSuccess() { function incrementOnSuccess() {

View file

@ -40,7 +40,8 @@
data-id-table="system-backups" data-id-table="system-backups"
data-search="true" data-search="true"
data-side-pagination="client" data-side-pagination="client"
data-sort-order="asc" data-sort-order="desc"
data-sort-name="modified_display"
id="system-backups" id="system-backups"
class="table table-striped snipe-table"> class="table table-striped snipe-table">
<thead> <thead>