Lines 1328-1333
Link Here
|
1328 |
}); |
1328 |
}); |
1329 |
|
1329 |
|
1330 |
$('.modal-save').click(function() { |
1330 |
$('.modal-save').click(function() { |
|
|
1331 |
|
1332 |
//We need to validate the item forms here - if one is opened with missing subfields at |
1333 |
//confirm, it would be submitted without this |
1334 |
var _alertString= _("Form not submitted because of the following problem(s)")+"\n"; |
1335 |
_alertString +="-------------------------------------------------------------------\n\n"; |
1336 |
var empty_mandatory_fields = 0; |
1337 |
$('div[id^="itemblock"]').each(function(){ |
1338 |
var item_form = $(this); |
1339 |
var empty_item_mandatory = CheckMandatorySubfields(item_form); |
1340 |
empty_mandatory_fields += empty_item_mandatory; |
1341 |
}); |
1342 |
if (empty_mandatory_fields > 0) { |
1343 |
_alertString +="\n- " + _("%s item mandatory fields empty").format(empty_mandatory_fields); |
1344 |
alert(_alertString); |
1345 |
return false; |
1346 |
} |
1347 |
|
1331 |
var saved_rows = save_row(); |
1348 |
var saved_rows = save_row(); |
1332 |
if(Object.keys(saved_rows).length) $('.save').prop('disabled', false); |
1349 |
if(Object.keys(saved_rows).length) $('.save').prop('disabled', false); |
1333 |
$("#order_edit").modal('hide'); |
1350 |
$("#order_edit").modal('hide'); |