From 224cc9e739e67c9e27b0fd85e996e04aff6f0f98 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 31 Mar 2016 20:35:00 -0400 Subject: [PATCH] PEdit stat cats local only Signed-off-by: Bill Erickson --- Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js b/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js index 106bdb09c0..437c4019c2 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js +++ b/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js @@ -611,6 +611,19 @@ angular.module('egCoreMod') angular.forEach(patron.addresses, function(addr) { service.ingest_address(patron, addr) }); + // Remove stat cat entries that link to out-of-scope stat + // cats. With this, we avoid unnecessarily updating (or worse, + // modifying) stat cat values that are not ours to modify. + patron.stat_cat_entries = patron.stat_cat_entries.filter( + function(map) { + return Boolean( + // service.stat_cats only contains in-scope stat cats. + service.stat_cats.filter(function(cat) { + return (cat.id() == map.stat_cat.id) })[0] + ); + } + ); + // toss entries for existing stat cat maps into our living // stat cat entry map, which is modified within the template. angular.forEach(patron.stat_cat_entries, function(map) { -- 2.11.0