@@ -, +, @@ --- koha-tmpl/intranet-tmpl/prog/en/js/acq.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/en/js/acq.js +++ a/koha-tmpl/intranet-tmpl/prog/en/js/acq.js @@ -728,7 +728,6 @@ for (i=1;i<=2;i++) { url: url, mimeType: 'text/xml', success: function (data, textStatus, xmlhttp) { - // rc = eval ( xmlhttp.responseText ); var retRootType = jQuery(xmlhttp.responseXML).children().first().get(0).nodeName.toLowerCase(); var hasInputs = $sort_zone.has('input').length > 0; if (hasInputs && retRootType == 'input') { @@ -757,7 +756,7 @@ function totalExceedsBudget(budgetId, total) { mimeType: 'text/xml', async: false, // non-async because we need to return a value based on the result success: function(data, textStatus, xmlhttp) { - actTotal = eval ( xmlhttp.responseText ); + actTotal = parseFloat ( xmlhttp.responseText ); if ( Math.abs(actTotal) < Math.abs(total) ) { // if budget is to low :( @@ -788,11 +787,11 @@ if ( newBudgetParent ) { url += '&parent_id=' + newBudgetParent}; mimeType: 'text/xml', async: false, // non-async because we need to return a value based on the result success: function(data, textStatus, xmlhttp) { - var result = eval ( xmlhttp.responseText ); + var result = parseInt ( xmlhttp.responseText ); - if (result == '1') { + if (result == 1) { ret = _("- Budget total exceeds parent allocation\n"); - } else if (result == '2') { + } else if (result == 2) { ret = _("- Budget total exceeds period allocation\n"); } else { ret = false; @@ -814,11 +813,11 @@ function checkBudgetParent(budgetId, newBudgetParent) { mimeType: 'text/xml', async: false, // non-async because we need to return a value based on the result success: function(data, textStatus, xmlhttp) { - var result = eval ( xmlhttp.responseText ); + var result = parseInt ( xmlhttp.responseText ); - if (result == '1') { + if (result == 1) { return _("- New budget-parent is beneath budget\n"); -// } else if (result == '2') { +// } else if (result == 2) { // return "- New budget-parent has insufficent funds\n"; // } else { // return false; --