From 158d365bbad58df9783b7ec2338d5f462f2ab7fc Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 31 Dec 2014 16:00:06 -0500 Subject: [PATCH 1/1] LP#1402797 browser client noncat counts in patron summary Signed-off-by: Bill Erickson Signed-off-by: Kathy Lussier --- .../templates/staff/circ/patron/t_summary.tt2 | 5 +++++ .../web/js/ui/default/staff/circ/patron/app.js | 18 +++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/templates/staff/circ/patron/t_summary.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_summary.tt2 index 1f09c7704a..8c803cf508 100644 --- a/Open-ILS/src/templates/staff/circ/patron/t_summary.tt2 +++ b/Open-ILS/src/templates/staff/circ/patron/t_summary.tt2 @@ -81,6 +81,11 @@
[% l('Lost') %]
{{patron_stats().checkouts.lost}}
+
+
[% l('Non-Cataloged') %]
+
{{patron_stats().checkouts.noncat}}
+
[% l('Holds') %]
diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/app.js b/Open-ILS/web/js/ui/default/staff/circ/patron/app.js index d8b373a814..d3c0adde3c 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/patron/app.js +++ b/Open-ILS/web/js/ui/default/staff/circ/patron/app.js @@ -233,6 +233,7 @@ function($q , $timeout , $location , egCore, egUser , $locale) { service.hold_ids = []; service.checkout_overrides = {}; service.patron_stats = null; + service.noncat_ids = []; service.hasAlerts = false; service.alertsShown = false; service.patronExpired = false; @@ -487,6 +488,18 @@ function($q , $timeout , $location , egCore, egUser , $locale) { ); } + // Fetches the IDs of any active non-cat checkouts for the current + // user. Also sets the patron_stats non_cat count value to match. + service.getUserNonCats = function(id) { + return egCore.net.request( + 'open-ils.circ', + 'open-ils.circ.open_non_cataloged_circulation.user.authoritative', + egCore.auth.token(), id + ).then(function(noncat_ids) { + service.noncat_ids = noncat_ids; + service.patron_stats.checkouts.noncat = noncat_ids.length; + }); + } // grab additional circ info service.fetchUserStats = function() { @@ -508,7 +521,10 @@ function($q , $timeout , $location , egCore, egUser , $locale) { } ); - return service.fetchGroupFines(); + // run these two in parallel + var p1 = service.getUserNonCats(service.current.id()); + var p2 = service.fetchGroupFines(); + return $q.all([p1, p2]); }); } -- 2.43.2