mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Prevent duplicate bulk submission
This commit is contained in:
parent
fc1afe05a5
commit
9a4af6c889
@ -2601,6 +2601,7 @@ $LANG = array(
|
||||
'promotion_footer' => 'Your promotion will expire soon, :link to upgrade now.',
|
||||
'unable_to_delete_primary' => 'Note: to delete this company first delete all linked companies.',
|
||||
'please_register' => 'Please register your account',
|
||||
'processing_request' => 'Processing request',
|
||||
|
||||
);
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
</div>
|
||||
|
||||
<div class="pull-left">
|
||||
@if (in_array($entityType, [ENTITY_TASK, ENTITY_INVOICE, ENTITY_PRODUCT, ENTITY_PROJECT]))
|
||||
@if (in_array($entityType, [ENTITY_TASK, ENTITY_EXPENSE, ENTITY_PRODUCT, ENTITY_PROJECT]))
|
||||
@can('create', 'invoice')
|
||||
{!! Button::primary(trans('texts.invoice'))->withAttributes(['class'=>'invoice', 'onclick' =>'submitForm_'.$entityType.'("invoice")'])->appendIcon(Icon::create('check')) !!}
|
||||
@endcan
|
||||
@ -128,7 +128,15 @@
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
var submittedForm;
|
||||
function submitForm_{{ $entityType }}(action, id) {
|
||||
// prevent duplicate form submissions
|
||||
if (submittedForm) {
|
||||
swal("{{ trans('texts.processing_request') }}")
|
||||
return;
|
||||
}
|
||||
submittedForm = true;
|
||||
|
||||
if (id) {
|
||||
$('#public_id_{{ $entityType }}').val(id);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user