From 0fe68625140052b77ed6c031a1eca3713f7e45ad Mon Sep 17 00:00:00 2001 From: Cesar Velez Date: Fri, 10 Nov 2017 16:01:41 -0500 Subject: [PATCH] Add a Last Notice date and a Notices count column This adds the above 2 columns to Patron Itemsout grid, and preps the frontend for using the new service method. Signed-off by: Cesar Velez --- .../src/templates/staff/circ/patron/t_items_out.tt2 | 2 ++ .../js/ui/default/staff/circ/patron/items_out.js | 21 +++++++++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/Open-ILS/src/templates/staff/circ/patron/t_items_out.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_items_out.tt2 index 4efa432bca..73c270f39c 100644 --- a/Open-ILS/src/templates/staff/circ/patron/t_items_out.tt2 +++ b/Open-ILS/src/templates/staff/circ/patron/t_items_out.tt2 @@ -103,6 +103,8 @@ + + diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js b/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js index 6679af6b1d..eb929d52e0 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js +++ b/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js @@ -134,12 +134,21 @@ function($scope, $q, $routeParams, $timeout, egCore , egUser, patronSvc , $ }) } - patronSvc.items_out.push(circ); // toss it into the cache - - // We fetch all circs for client-side sorting, but only - // notify the caller for the page of requested circs. - if (rendered++ >= offset && rendered <= count) - deferred.notify(circ); + // call open-ils to get overdue notice count and Last notice date + + egCore.net.request( + 'open-ils.actor', + 'open-ils.actor.user.itemsout.notices', + egCore.auth.token(), circ.id(), $scope.patron_id) + .then(function(notice){ + if (notice.numNotices){ + circ.action_trigger_event_count = notice.numNotices; + circ.action_trigger_latest_event_date = notice.lastDt; + } + patronSvc.items_out.push(circ); + }); + + if (rendered++ >= offset && rendered <= count){ deferred.notify(circ) }; }); return deferred.promise; -- 2.11.0