From 71f03426809afe73dd7f2e0dade84353f6492ec9 Mon Sep 17 00:00:00 2001 From: Jason Boyer Date: Thu, 17 Jan 2019 13:33:10 -0500 Subject: [PATCH] LP1798628: Copy alert counts in Holdings Currently the count of all copy alerts ever applied to a copy is displayed in the Holdings view, which can be quite confusing when clicking Manage and not seeing the expected number of alerts. This branch changes the display to only count the number of events currently active since those are the only ones available to manage. Signed-off-by: Jason Boyer Signed-off-by: Garry Collum --- Open-ILS/web/js/ui/default/staff/cat/services/holdings.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Open-ILS/web/js/ui/default/staff/cat/services/holdings.js b/Open-ILS/web/js/ui/default/staff/cat/services/holdings.js index 20ce815faf..a368d87dc2 100644 --- a/Open-ILS/web/js/ui/default/staff/cat/services/holdings.js +++ b/Open-ILS/web/js/ui/default/staff/cat/services/holdings.js @@ -127,7 +127,9 @@ function(egCore , $q) { // create virtual field for copy alert count angular.forEach(svc.copies, function (cp) { - if (cp.copy_alerts) cp.copy_alert_count = cp.copy_alerts.length; + if (cp.copy_alerts) { + cp.copy_alert_count = cp.copy_alerts.filter(function(aca) { return aca.ack_time == null ;}).length; + } else cp.copy_alert_count = 0; }); -- 2.11.0