From 11396ae4c549812170d01b43c61a4630218e6ba6 Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Wed, 20 Jun 2012 11:47:54 -0400 Subject: [PATCH] lp1010187 eliminate redundant/unnecessary calls Particularly invocations of open-ils.circ.stat_cat.asset.retrieve.all in the Item Attribute Editor To test: login with a BR1 workstation load a pristine (non-stat-cat-laden) BR1 item with the editor there should be no call to open-ils.circ.stat_cat.asset.retrieve.all change the Circ Lib on the item to BR4 reload the item in the editor there should be a call to open-ils.circ.stat_cat.asset.retrieve.all reload the item in the editor there should be no call to open-ils.circ.stat_cat.asset.retrieve.all assign the item a stat cat entry owned by CONS reload the item in the editor there should be no call to open-ils.circ.stat_cat.asset.retrieve.all Signed-off-by: Jason Etheridge Signed-off-by: Jason Stephenson --- Open-ILS/xul/staff_client/server/cat/copy_editor.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Open-ILS/xul/staff_client/server/cat/copy_editor.js b/Open-ILS/xul/staff_client/server/cat/copy_editor.js index 15a9b95bd7..260d647406 100644 --- a/Open-ILS/xul/staff_client/server/cat/copy_editor.js +++ b/Open-ILS/xul/staff_client/server/cat/copy_editor.js @@ -1639,6 +1639,9 @@ g.populate_stat_cats = function() { var entries = g.copies[i].stat_cat_entries(); if (!entries) entries = []; for (var j = 0; j < entries.length; j++) { + if (typeof g.data.hash.asc[ entries[j].stat_cat() ] != 'undefined') { + continue; // We already have this stat cat, so assume we have everything we need for this lib + } var lib = entries[j].owner(); if (typeof lib == 'object') lib = lib.id(); sc_libs[ lib ] = true; } @@ -1649,6 +1652,9 @@ g.populate_stat_cats = function() { sc_libs = {}; for (var i = 0; i < g.copies.length; i++) { var circ_lib = g.copies[i].circ_lib(); if (typeof circ_lib == 'object') circ_lib = circ_lib.id(); + if (typeof g.data.hash.my_aou[ circ_lib ] != 'undefined') { + continue; // We should already have everything we need for this lib + } sc_libs[ circ_lib ] = true; } add_common_ancestors(sc_libs); @@ -1667,6 +1673,9 @@ g.populate_stat_cats = function() { } } var owning_lib = g.map_acn[ cn_id ].owning_lib(); if (typeof owning_lib == 'object') owning_lib = owning_lib.id(); + if (typeof g.data.hash.my_aou[ owning_lib ] != 'undefined') { + continue; // We should already have everything we need for this lib + } sc_libs[ owning_lib ] = true; } } -- 2.43.2