From ab70fb8adb3dd86fa06f3796e8f8cb9c8fb6f58d Mon Sep 17 00:00:00 2001 From: phasefx Date: Sat, 16 Apr 2011 21:35:46 +0000 Subject: [PATCH] fix Add Items off of volumes by changing the label key in copy_shortcut to callnumber composite key git-svn-id: svn://svn.open-ils.org/ILS/trunk@20136 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/xul/staff_client/server/cat/copy_browser.js | 17 ++++++++++++++--- Open-ILS/xul/staff_client/server/circ/copy_status.js | 20 ++++++++++++++++---- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/Open-ILS/xul/staff_client/server/cat/copy_browser.js b/Open-ILS/xul/staff_client/server/cat/copy_browser.js index 4e7fcf77b..6aa724113 100644 --- a/Open-ILS/xul/staff_client/server/cat/copy_browser.js +++ b/Open-ILS/xul/staff_client/server/cat/copy_browser.js @@ -256,11 +256,22 @@ cat.copy_browser.prototype = { list = util.functional.map_list( list, function (o) { - var ou_id = obj.map_acn['acn_' + o].owning_lib(); + var call_number = obj.map_acn['acn_'+o]; + var ou_id = call_number.owning_lib(); var volume_id = o; - var label = obj.map_acn['acn_' + o].label(); + var label = call_number.label(); + var acnc_id = typeof call_number.label_class() == 'object' + ? call_number.label_class().id() + : call_number.label_class(); + var acnp_id = typeof call_number.prefix() == 'object' + ? call_number.prefix().id() + : call_number.prefix(); + var acns_id = typeof call_number.suffix() == 'object' + ? call_number.suffix().id() + : call_number.suffix(); if (!copy_shortcut[ou_id]) copy_shortcut[ou_id] = {}; - copy_shortcut[ou_id][ label ] = volume_id; + var callnumber_composite_key = acnc_id + ':' + acnp_id + ':' + label + ':' + acns_id; + copy_shortcut[ou_id][ callnumber_composite_key ] = volume_id; return ou_id; } diff --git a/Open-ILS/xul/staff_client/server/circ/copy_status.js b/Open-ILS/xul/staff_client/server/circ/copy_status.js index 632e77dba..f94c6a1b5 100644 --- a/Open-ILS/xul/staff_client/server/circ/copy_status.js +++ b/Open-ILS/xul/staff_client/server/circ/copy_status.js @@ -492,16 +492,28 @@ circ.copy_status.prototype = { if (! map_acn[volume_id]) { map_acn[ volume_id ] = obj.network.simple_request('FM_ACN_RETRIEVE.authoritative',[ volume_id ]); } - var record_id = map_acn[ volume_id ].record(); - var ou_id = map_acn[ volume_id ].owning_lib(); - var label = map_acn[ volume_id ].label(); + var call_number = obj.map_acn[volume_id]; + var record_id = call_number.record(); + var ou_id = call_number.owning_lib(); + var label = call_number.label(); + var acnc_id = typeof call_number.label_class() == 'object' + ? call_number.label_class().id() + : call_number.label_class(); + var acnp_id = typeof call_number.prefix() == 'object' + ? call_number.prefix().id() + : call_number.prefix(); + var acns_id = typeof call_number.suffix() == 'object' + ? call_number.suffix().id() + : call_number.suffix(); + if (!copy_shortcut[ou_id]) copy_shortcut[ou_id] = {}; + var callnumber_composite_key = acnc_id + ':' + acnp_id + ':' + label + ':' + acns_id; if (!copy_shortcut[record_id]) { copy_shortcut[record_id] = {}; } if (!copy_shortcut[record_id][ou_id]) { copy_shortcut[record_id][ou_id] = {}; } - copy_shortcut[record_id][ou_id][ label ] = volume_id; + copy_shortcut[record_id][ou_id][ callnumber_composite_key ] = volume_id; } -- 2.11.0