From 6c2e45da28bb888356b00f6d75e3d04e7effca37 Mon Sep 17 00:00:00 2001 From: Cesar Velez Date: Fri, 18 Aug 2017 15:36:13 -0400 Subject: [PATCH] LP#1378383 - Improve feedback message when item circ history is limited There was ambiguity for the user to tell the difference (from the displayed message) if an item truly has no circulations, or if they see no circs due to the relevant permission setting being set to 0 (Maximum previous checkouts) Signed-off by: Cesar Velez --- Open-ILS/src/templates/staff/cat/item/t_circ_list_pane.tt2 | 11 ++++++++--- Open-ILS/src/templates/staff/cat/item/t_circs_pane.tt2 | 9 +++++++-- Open-ILS/web/js/ui/default/staff/cat/item/app.js | 12 ++++++++---- 3 files changed, 23 insertions(+), 9 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 3cab22b938..dbf93acf50 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 @@ -1,9 +1,14 @@ -
+
[% l('Item has not circulated.') %]
-
+
+
+ [% l('Circulation History not available for display.') %] +
+
+
-
+
-
+
[% l('No Recent Circ Group') %]
-
+
+
+ [% l('Most Recent Circ Group not available for display.') %] +
+
+
[% l('Most Recent Circ Group') %] 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 8f34c67d1e..5a6a69e8ca 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 @@ -1448,6 +1448,8 @@ function($scope , $q , $location , $routeParams , $timeout , $window , egCore , return fetchMaxCircHistory(); }) .then(function(maxHistCount){ + if(!count) $scope.isMaxCircHistoryZero = true; + egCore.pcrud.search('circ', {target_copy : copyId}, { flesh : 2, @@ -1463,7 +1465,7 @@ function($scope , $q , $location , $routeParams , $timeout , $window , egCore , au : ['card'] }, order_by : {circ : 'xact_start desc'}, - limit : maxHistCount + limit : 1 } ).then(null, null, function(circ) { @@ -1509,7 +1511,7 @@ function($scope , $q , $location , $routeParams , $timeout , $window , egCore , 'circ.item_checkout_history.max') .then(function(set) { maxHistory = set['circ.item_checkout_history.max'] || 4; - return maxHistory; + return Number(maxHistory); }); } @@ -1543,7 +1545,7 @@ function($scope , $q , $location , $routeParams , $timeout , $window , egCore , var copy_org = itemSvc.copy.call_number().id() == -1 ? itemSvc.copy.circ_lib().id() : - itemSvc.copy.call_number().owning_lib().id() + itemSvc.copy.call_number().owning_lib().id(); // there is an extra layer of permissibility over circ // history views @@ -1558,6 +1560,7 @@ function($scope , $q , $location , $routeParams , $timeout , $window , egCore , return fetchMaxCircHistory(); }).then(function(count) { + if(!count) $scope.isMaxCircHistoryZero = true; egCore.pcrud.search('combcirc', {target_copy : copyId}, @@ -1572,7 +1575,8 @@ function($scope , $q , $location , $routeParams , $timeout , $window , egCore , au : ['card'] }, order_by : {combcirc : 'xact_start desc'}, - limit : count + // fetch at least one to see if copy ever circulated + limit : $scope.isMaxCircHistoryZero ? 1 : count } ).then(null, null, function(circ) { -- 2.11.0