From 11d7f2206e4583db64626f9761c00c7746242cbe Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 3 Aug 2016 13:52:33 -0400 Subject: [PATCH] LP#1497335 Browser client item details aged circs 1. Use all_circulation (combcirc) class (now accessible via pcrud) to render the item Circ History List tab. In cases where a combcirc object has no 'usr' value, the interface displays where the patron's name would normally be and disables the 'Add Billing' button. 2. Handle null 'usr' values in the item status Recent Circ History tab. When a renewal chain summary has no 'usr' value, the interface displays where the patron's name would normally be. Signed-off-by: Bill Erickson --- .../templates/staff/cat/item/t_circ_list_pane.tt2 | 7 +++++-- .../src/templates/staff/cat/item/t_circs_pane.tt2 | 13 ++++++++----- Open-ILS/web/js/ui/default/staff/cat/item/app.js | 20 +++++++++++--------- 3 files changed, 24 insertions(+), 16 deletions(-) diff --git a/Open-ILS/src/templates/staff/cat/item/t_circ_list_pane.tt2 b/Open-ILS/src/templates/staff/cat/item/t_circ_list_pane.tt2 index 05ee925df1..698869b110 100644 --- a/Open-ILS/src/templates/staff/cat/item/t_circ_list_pane.tt2 +++ b/Open-ILS/src/templates/staff/cat/item/t_circ_list_pane.tt2 @@ -17,17 +17,20 @@
-
diff --git a/Open-ILS/src/templates/staff/cat/item/t_circs_pane.tt2 b/Open-ILS/src/templates/staff/cat/item/t_circs_pane.tt2 index 24a3241537..512f5c3890 100644 --- a/Open-ILS/src/templates/staff/cat/item/t_circs_pane.tt2 +++ b/Open-ILS/src/templates/staff/cat/item/t_circs_pane.tt2 @@ -14,13 +14,16 @@
[% l('Patron') %]
diff --git a/Open-ILS/web/js/ui/default/staff/cat/item/app.js b/Open-ILS/web/js/ui/default/staff/cat/item/app.js index 922a531f8e..7a266357ed 100644 --- a/Open-ILS/web/js/ui/default/staff/cat/item/app.js +++ b/Open-ILS/web/js/ui/default/staff/cat/item/app.js @@ -902,6 +902,7 @@ function($scope , $q , $location , $routeParams , $timeout , $window , egCore , delete $scope.circ; delete $scope.circ_summary; delete $scope.prev_circ_summary; + delete $scope.prev_circ_usr; if (!copyId) return; egCore.pcrud.search('circ', @@ -945,12 +946,12 @@ function($scope , $q , $location , $routeParams , $timeout , $window , egCore , ).then(null, null, function(summary) { $scope.prev_circ_summary = summary.summary; - egCore.pcrud.retrieve('au', summary.usr, - {flesh : 1, flesh_fields : {au : ['card']}}) + if (summary.usr) { // aged circs have no 'usr'. + egCore.pcrud.retrieve('au', summary.usr, + {flesh : 1, flesh_fields : {au : ['card']}}) - .then(function(user) { - $scope.prev_circ_usr = user; - }); + .then(function(user) { $scope.prev_circ_usr = user }); + } }); }); } @@ -976,7 +977,8 @@ function($scope , $q , $location , $routeParams , $timeout , $window , egCore , $scope.retrieveAllPatrons = function() { var users = new Set(); angular.forEach($scope.circ_list.map(function(circ) { return circ.usr(); }),function(usr) { - users.add(usr); + // aged circs have no 'usr'. + if (usr) users.add(usr); }); users.forEach(function(usr) { $timeout(function() { @@ -1010,11 +1012,11 @@ function($scope , $q , $location , $routeParams , $timeout , $window , egCore , }).then(function(count) { - egCore.pcrud.search('circ', + egCore.pcrud.search('combcirc', {target_copy : copyId}, { flesh : 2, flesh_fields : { - circ : [ + combcirc : [ 'usr', 'workstation', 'checkin_workstation', @@ -1022,7 +1024,7 @@ function($scope , $q , $location , $routeParams , $timeout , $window , egCore , ], au : ['card'] }, - order_by : {circ : 'xact_start desc'}, + order_by : {combcirc : 'xact_start desc'}, limit : count } -- 2.11.0