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