From: phasefx Date: Wed, 21 Oct 2009 08:37:39 +0000 (+0000) Subject: fix testing of the return value from the backdate.batch.atomic method X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=fa4e16c47b6347c3eed995cf45b210cac1db3e82;p=evergreen%2Fpines.git fix testing of the return value from the backdate.batch.atomic method git-svn-id: svn://svn.open-ils.org/ILS/trunk@14516 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/xul/staff_client/server/circ/util.js b/Open-ILS/xul/staff_client/server/circ/util.js index db5dd67caf..3f99b40b07 100644 --- a/Open-ILS/xul/staff_client/server/circ/util.js +++ b/Open-ILS/xul/staff_client/server/circ/util.js @@ -108,21 +108,30 @@ circ.util.backdate_post_checkin = function(circ_ids) { if (typeof my_xulG.proceed == 'undefined') return; var r = obj.network.simple_request( 'FM_CIRC_BACKDATE_BATCH', [ ses(), circ_ids, my_xulG.backdate ] ); - if (r == 1) { - obj.sound.circ_good(); - var x = $('no_change_label'); - if (x) { - x.hidden = false; - x.setAttribute('value', circStrings.getFormattedString('staff.circ.backdate.success',[circ_ids.join(","),my_xulG.backdate])); - } - } else { - obj.sound.circ_bad(); - var x = $('no_change_label'); - if (x) { - x.hidden = false; - x.setAttribute('value', circStrings.getFormattedString('staff.circ.backdate.failed',[circ_ids.join(","),r.textcode])); + if (typeof r.ilsevent != 'undefined') throw(r); + var bad_sound = false; + dojo.forEach( + r, + function(element,idx,list) { + if (element == 1) { + var x = $('no_change_label'); + if (x) { + x.hidden = false; + var m = x.getAttribute('value'); + x.setAttribute('value', (m ? m + ' : ' : '' ) + circStrings.getFormattedString('staff.circ.backdate.success',[circ_ids[idx],my_xulG.backdate])); + } + } else { + bad_sound = true; + var x = $('no_change_label'); + if (x) { + x.hidden = false; + var m = x.getAttribute('value'); + x.setAttribute('value', (m ? m + ' : ' : '' ) + circStrings.getFormattedString('staff.circ.backdate.failure',[circ_ids[idx],r.textcode])); + } + } } - } + ); + if (bad_sound) obj.sound.circ_bad(); else obj.sound.circ_good(); } catch(E) { obj.error.standard_unexpected_error_alert(circStrings.getString('staff.circ.utils.retrieve_copy.failure'),E);