From 60826097e4bf8692297c09efc666978e3786ccec Mon Sep 17 00:00:00 2001 From: Cesar Velez Date: Fri, 10 Nov 2017 16:01:41 -0500 Subject: [PATCH 1/1] LP#1732275: Add a Last Notice date and a Notices count column This adds the above 2 columns to Patron Items Out grid, and preps the frontend for using the new service method. Signed-off-by: Cesar Velez Signed-off-by: Galen Charlton Signed-off-by: Kathy Lussier Conflicts: Open-ILS/src/templates/staff/circ/patron/t_items_out.tt2 Signed-off-by: Kathy Lussier --- .../staff/circ/patron/t_items_out.tt2 | 2 ++ .../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 2f705cea6e..45c467cf5c 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 b209d18c60..4543797b83 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 @@ -141,12 +141,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.43.2