From a9aa2af7a327b55504099542dbc0a3cfde205994 Mon Sep 17 00:00:00 2001 From: phasefx Date: Thu, 5 Nov 2009 21:37:23 +0000 Subject: [PATCH] Use open-ils.circ.renewal_chain.retrieve_by_circ.atomic to retrieve the original circ for a sequence of circ renewals and display the workstation for that original circ in the alternate copy details page git-svn-id: svn://svn.open-ils.org/ILS/trunk@14795 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/opac/locale/en-US/lang.dtd | 2 ++ .../xul/staff_client/chrome/content/main/constants.js | 1 + .../staff_client/server/circ/alternate_copy_summary.js | 15 +++++++++++++++ .../staff_client/server/circ/alternate_copy_summary.xul | 12 ++++++++---- 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index 07c1f8af2..0e6c1812a 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -2931,6 +2931,7 @@ + @@ -2952,6 +2953,7 @@ + diff --git a/Open-ILS/xul/staff_client/chrome/content/main/constants.js b/Open-ILS/xul/staff_client/chrome/content/main/constants.js index 1620d33bd..0be3fae90 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/constants.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/constants.js @@ -178,6 +178,7 @@ const api = { 'FM_BRN_FROM_MARCXML' : { 'app' : 'open-ils.search', 'method' : 'open-ils.search.z3950.marcxml_to_brn', 'secure' : false }, 'FM_CBT_RETRIEVE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.billing_type.ranged.retrieve.all', 'secure' : false }, 'FM_CCS_RETRIEVE' : { 'app' : 'open-ils.search', 'method' : 'open-ils.search.config.copy_status.retrieve.all', 'secure' : false }, + 'FM_CIRC_CHAIN' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.renewal_chain.retrieve_by_circ.atomic' }, 'FM_CIRC_DETAILS' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.fleshed.retrieve' }, 'FM_CIRC_DETAILS.authoritative' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.fleshed.retrieve.authoritative' }, 'FM_CIRC_RETRIEVE_VIA_ID' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.retrieve' }, diff --git a/Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.js b/Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.js index 7b16a15e9..54e0e81b6 100644 --- a/Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.js +++ b/Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.js @@ -271,6 +271,8 @@ function load_item() { set("xact_start", ''); set("create_time", ''); set("workstation", ''); + set("renewal_workstation", ''); + set("checkout_workstation", ''); set("billings", ''); set("payments", ''); set("billable_transaction", ''); @@ -309,6 +311,19 @@ function load_item() { set("xact_start", details.circ.xact_start()); set("create_time", details.circ.create_time()); set("workstation", details.circ.workstation()); + if (get_bool(details.circ.opac_renewal())||get_bool(details.circ.phone_renewal())||get_bool(details.circ.desk_renewal())) { + set("renewal_workstation", typeof details.circ.workstation() == 'object' ? details.circ.workstation().name() : details.circ.workstation() ); + network.simple_request('FM_CIRC_CHAIN', [ses(), details.circ.id() ], function(req) { // Tiny race condition between details.circ and circs[circs.length-1] here, but meh :) + try { + var circs = req.getResultObject(); + set("checkout_workstation", typeof circs[0].workstation() == 'object' ? circs[0].workstation().name() : circs[0].workstation() ); + } catch(E) { + alert('Error in alternate_copy_summary.js, FM_CIRC_CHAIN: ' + E); + } + } ); + } else { + set("checkout_workstation", typeof details.circ.workstation() == 'object' ? details.circ.workstation().name() : details.circ.workstation() ); + } set("billings", details.circ.billings()); set("payments", details.circ.payments()); set("billable_transaction", details.circ.billable_transaction()); diff --git a/Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.xul b/Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.xul index 87cfd8a43..aee96970e 100644 --- a/Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.xul +++ b/Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.xul @@ -106,6 +106,8 @@