diff -r 77f1617b6994 -r 18e5cfe5d126 www/js/prod_edit.js --- a/www/js/prod_edit.js Fri Sep 13 20:24:31 2019 +0200 +++ b/www/js/prod_edit.js Fri Sep 13 20:48:35 2019 +0200 @@ -4169,8 +4169,7 @@ } }); - function saveRecord() { - console.log('saveRecord()'); + function saveRecord(goback) { var row = { record: my_record, uuid: dataRecord.uuid, @@ -4384,10 +4383,15 @@ async: false, type: 'POST', success: function(data, status, xhr) { - console.log('saveRecord() success'); + console.log('saveRecord(' + goback + ') success'); + if (goback) + window.location.href = my_return; + else + window.location.href = + 'prod_export.php?record=' + my_record + '&return=' + my_return + '&select=' + my_select + '&code=' + dataRecord.code + '&name=' + dataRecord.name; }, error: function(jqXHR, textStatus, errorThrown) { - console.log('saveRecord() error'); + console.log('saveRecord() ' + textStatus); } }); }; @@ -6023,9 +6027,7 @@ // Buttons below $('#Export').jqxButton({ template: 'info', width: '80px', theme: theme }); $('#Export').bind('click', function() { - saveRecord(); - window.location.href = - 'prod_export.php?record=' + my_record + '&return=' + my_return + '&select=' + my_select + '&code=' + dataRecord.code + '&name=' + dataRecord.name; + saveRecord(0); }); $('#Delete').jqxButton({ template: 'danger', width: '80px', theme: theme }); @@ -6057,8 +6059,7 @@ $('#Save').jqxButton({ template: 'success', width: '80px', theme: theme }); $('#Save').bind('click', function() { - saveRecord(); - window.location.href = my_return; + saveRecord(1); }); createDelElements(); });