From e9c99529139cccc25dd7a086096d68873329f31f Mon Sep 17 00:00:00 2001 From: phasefx Date: Thu, 5 Jul 2007 11:11:28 +0000 Subject: [PATCH] 'mo better consortial copy; it updates when the tree refreshes.. but also found a pesky race condition with the copy_count call returning null git-svn-id: svn://svn.open-ils.org/ILS/trunk@7516 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/xul/staff_client/server/cat/copy_browser.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 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 8f430ae1bb..d3376ed94b 100644 --- a/Open-ILS/xul/staff_client/server/cat/copy_browser.js +++ b/Open-ILS/xul/staff_client/server/cat/copy_browser.js @@ -919,6 +919,16 @@ cat.copy_browser.prototype = { obj.show_my_libs( ml.value ); + obj.show_consortial_count(); + + } catch(E) { + this.error.standard_unexpected_error_alert('cat.copy_browser.init: ',E); + } + }, + + 'show_consortial_count' : function() { + var obj = this; + try { obj.network.simple_request('FM_ACP_COUNT',[ obj.data.tree.aou.id(), obj.docid ],function(req){ try { var robj = req.getResultObject(); @@ -930,9 +940,8 @@ cat.copy_browser.prototype = { obj.error.standard_unexpected_error_alert('Error retrieving consortial copy count.',E); } }); - } catch(E) { - this.error.standard_unexpected_error_alert('cat.copy_browser.init: ',E); + this.error.standard_unexpected_error_alert('cat.copy_browser.show_consortial_count: ',E); } }, @@ -1633,6 +1642,8 @@ cat.copy_browser.prototype = { obj.show_libs( org ); */ obj.show_my_libs( document.getElementById('lib_menu').value ); + // FIXME - we get a null from the copy_count call if we call it too quickly here + setTimeout( function() { obj.show_consortial_count(); }, 2000 ); } catch(E) { this.error.standard_unexpected_error_alert('Problem refreshing the volume/copy tree.',E); } -- 2.11.0