Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions resources/lang/en-US/admin/hardware/form.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
'asset_location_update_default' => 'Update only default location',
'asset_location_update_actual' => 'Update only actual location',
'asset_not_deployable' => 'That asset status is not deployable. This asset cannot be checked out.',
'asset_not_deployable_checkin' => 'That asset status is not deployable. Using this status label will checkin the asset.',
'asset_deployable' => 'This asset can be checked out.',
'asset_not_deployable_checkin' => '{1} That asset status is not deployable. Using this status label will check in the asset.|[2,*] That asset status in not deployable. Using this status label will result in no change.',
'asset_deployable' => '{1} This asset can be checked out.|[2,*] These assets can be checked out.',
'processing_spinner' => 'Processing... (This might take a bit of time on large files)',
'processing' => 'Processing... ',
'optional_infos' => 'Optional Information',
Expand Down
35 changes: 35 additions & 0 deletions resources/views/hardware/bulk.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@
aria-label="status_id"
/>
<p class="help-block">{{ trans('general.status_compatibility') }}</p>
<p id="selected_status_status" style="display:none;"></p>
{!! $errors->first('status_id', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>
Expand Down Expand Up @@ -288,5 +289,39 @@
});
});
});
function status_check() {
var status_id = $('select[name="status_id"]').val();
if (status_id != '') {
$(".status_spinner").css("display", "inline");
$.ajax({
url: "{{config('app.url') }}/api/v1/statuslabels/" + status_id + "/deployable",
headers: {
"X-Requested-With": 'XMLHttpRequest',
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
},
success: function (data) {
$(".status_spinner").css("display", "none");
$("#selected_status_status").fadeIn();

if (data == true) {
$("#selected_status_status").removeClass('text-danger');
$("#selected_status_status").addClass('text-success');
$("#selected_status_status").html('<x-icon type="checkmark" /> {{ trans_choice('admin/hardware/form.asset_deployable', 2)}}');


} else {
$("#assignto_selector").hide();
$("#selected_status_status").removeClass('text-success');
$("#selected_status_status").addClass('text-danger');
$("#selected_status_status").html('<x-icon type="warning" /> {{ trans_choice('admin/hardware/form.asset_not_deployable_checkin', 2) }} ');
}
}
});
}
}
$(function () {
$('select[name="status_id"]').on('change', status_check);
});

</script>
@endsection
Loading