LP1798628: Copy alert counts in Holdings
authorJason Boyer <jboyer@library.in.gov>
Thu, 17 Jan 2019 18:33:10 +0000 (13:33 -0500)
committerChris Sharp <csharp@georgialibraries.org>
Fri, 8 Mar 2019 19:35:24 +0000 (14:35 -0500)
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 <jboyer@library.in.gov>
Signed-off-by: Garry Collum <gcollum@gmail.com>
Signed-off-by: Chris Sharp <csharp@georgialibraries.org>

Open-ILS/web/js/ui/default/staff/cat/services/holdings.js

index ad16b5d..d78c049 100644 (file)
@@ -132,7 +132,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;
                 });