From: pines Date: Thu, 26 Oct 2006 19:06:14 +0000 (+0000) Subject: be more careful with copy objects vs copy ids X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=88d67cfb4c963830a6001d2368b078b2ae16565b;p=evergreen%2Fpines.git be more careful with copy objects vs copy ids git-svn-id: svn://svn.open-ils.org/ILS/trunk@6521 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 9e60e84bf3..983060bb68 100644 --- a/Open-ILS/xul/staff_client/server/circ/util.js +++ b/Open-ILS/xul/staff_client/server/circ/util.js @@ -49,6 +49,8 @@ circ.util.show_copy_details = function(copy_id) { JSAN.use('util.network'); obj.network = new util.network(); JSAN.use('OpenILS.data'); obj.data = new OpenILS.data(); obj.data.init({'via':'stash'}); + if (typeof copy_id == 'object' && copy_id != null) copy_id = copy_id.id(); + try { obj.data.fancy_prompt_data = null; obj.data.stash('fancy_prompt_data'); var url = xulG.url_prefix( urls.XUL_COPY_DETAILS ) + '?copy_id=' + copy_id; diff --git a/Open-ILS/xul/staff_client/server/patron/holds.js b/Open-ILS/xul/staff_client/server/patron/holds.js index a5724df91a..ced1763a5b 100644 --- a/Open-ILS/xul/staff_client/server/patron/holds.js +++ b/Open-ILS/xul/staff_client/server/patron/holds.js @@ -61,10 +61,21 @@ patron.holds.prototype = { row.my.patron_first_given_name = blob.patron_first; row.my.patron_barcode = blob.patron_barcode; + var copy_id = row.my.ahr.current_copy(); + if (typeof copy_id == 'object') { + if (copy_id == null) { + if (typeof row.my.acp == 'object' && row.my.acp != null) copy_id = row.my.acp.id(); + } else { + copy_id = copy_id.id(); + } + } else { + copy_id = row.my.acp.id(); + } + obj.holds_map[ row.my.ahr.id() ] = row.my.ahr; params.row_node.setAttribute('retrieve_id', js2JSON({ - 'copy_id':row.my.ahr.current_copy(), + 'copy_id':copy_id, 'id':row.my.ahr.id(), 'type':row.my.ahr.hold_type(), 'target':row.my.ahr.target(), diff --git a/Open-ILS/xul/staff_client/server/patron/items.js b/Open-ILS/xul/staff_client/server/patron/items.js index e05d296c15..22cc58734d 100644 --- a/Open-ILS/xul/staff_client/server/patron/items.js +++ b/Open-ILS/xul/staff_client/server/patron/items.js @@ -519,8 +519,19 @@ patron.items.prototype = { row.my.acp = robj.copy; row.my.mvr = robj.mvr; row.my.acn = robj.volume; + + var copy_id = row.my.circ.target_copy(); + if (typeof copy_id == 'object') { + if (copy_id != null) { + copy_id = copy_id.id(); + } else { + if (typeof robj.copy == 'object' && robj.copy != null) copy_id = robj.copy.id(); + } + } else { + if (typeof robj.copy == 'object' && robj.copy != null) copy_id = robj.copy.id(); + } - params.row_node.setAttribute( 'retrieve_id', js2JSON({'copy_id':row.my.circ.target_copy(),'circ_id':row.my.circ.id(),'barcode':row.my.acp.barcode(),'doc_id': (robj.record ? robj.record.id() : null) }) ); + params.row_node.setAttribute( 'retrieve_id', js2JSON({'copy_id':copy_id,'circ_id':row.my.circ.id(),'barcode':row.my.acp.barcode(),'doc_id': (robj.record ? robj.record.id() : null) }) ); if (typeof params.on_retrieve == 'function') { params.on_retrieve(row);