From e58ab0880cf3ba7a1798a1592443203fa37449e5 Mon Sep 17 00:00:00 2001 From: Cesar Velez Date: Wed, 7 Feb 2018 12:05:10 -0500 Subject: [PATCH] LP1746566 - Enable 500, 1K, and ALL-the-Rows in patron grids This adds to the Items out, holds, and ItemStatus grids the 'allowAll' grid feature which will enable the 500, 1K, and ALL (really 10K) rows/pagesize. For the ALL option a modal has been wired to that the action can be confirmed, since it might be a very slow operation. Signed-off by: Cesar Velez --- Open-ILS/src/templates/staff/base_js.tt2 | 2 ++ Open-ILS/src/templates/staff/cat/item/t_list.tt2 | 2 +- .../src/templates/staff/circ/patron/t_holds_list.tt2 | 2 +- Open-ILS/src/templates/staff/circ/patron/t_items_out.tt2 | 2 +- Open-ILS/src/templates/staff/share/t_autogrid.tt2 | 7 ++++++- Open-ILS/web/js/ui/default/staff/services/grid.js | 16 ++++++++++++++-- 6 files changed, 25 insertions(+), 6 deletions(-) diff --git a/Open-ILS/src/templates/staff/base_js.tt2 b/Open-ILS/src/templates/staff/base_js.tt2 index 2932e453f8..a58ae8d314 100644 --- a/Open-ILS/src/templates/staff/base_js.tt2 +++ b/Open-ILS/src/templates/staff/base_js.tt2 @@ -203,6 +203,8 @@ UpUp.start({ s.CONFIRM_IN_HOUSE_NUM_USES_COUNT_TITLE = "[% l('Are you sure you want to record {{num_uses}} uses for this?') %]"; s.PAGE_TITLE_DEFAULT = "[% l('Evergreen Staff Client') %]"; s.PAGE_TITLE_DYNAMIC_AND_CONTEXT = "[% l('[_1] - [_2]', '{{dynamic}}', '{{context}}') %]"; + s.CONFIRM_LONG_RUNNING_ACTION_MSG = "[% l('This action might take a while to complete. Continue?') %]"; + s.CONFIRM_LONG_RUNNING_ACTION_ALL_ROWS_TITLE = "[% l('Are you sure you want to load ALL items?') %]"; }]); diff --git a/Open-ILS/src/templates/staff/cat/item/t_list.tt2 b/Open-ILS/src/templates/staff/cat/item/t_list.tt2 index eb584c95e5..324ef223c6 100644 --- a/Open-ILS/src/templates/staff/cat/item/t_list.tt2 +++ b/Open-ILS/src/templates/staff/cat/item/t_list.tt2 @@ -1,7 +1,7 @@ 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..b2adc1a2c2 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 @@ -29,7 +29,7 @@ ng-if="items_out_display == 'noncat'" idl-class="ancc" id-field="id" - features="clientsort" + features="clientsort,allowAll" items-provider="gridDataProvider" persist-key="circ.patron.items_out.noncat" dateformat="{{$root.egDateAndTimeFormat}}"> diff --git a/Open-ILS/src/templates/staff/share/t_autogrid.tt2 b/Open-ILS/src/templates/staff/share/t_autogrid.tt2 index e8f94d77bd..195ec1a612 100644 --- a/Open-ILS/src/templates/staff/share/t_autogrid.tt2 +++ b/Open-ILS/src/templates/staff/share/t_autogrid.tt2 @@ -119,8 +119,13 @@ {{t}} +
  • + + {{t}} + +
  • - [% l('All') %] + [% l('All') %]
  • diff --git a/Open-ILS/web/js/ui/default/staff/services/grid.js b/Open-ILS/web/js/ui/default/staff/services/grid.js index fab8679d69..cf0aacf708 100644 --- a/Open-ILS/web/js/ui/default/staff/services/grid.js +++ b/Open-ILS/web/js/ui/default/staff/services/grid.js @@ -119,10 +119,10 @@ angular.module('egGridMod', controller : [ '$scope','$q','egCore','egGridFlatDataProvider','$location', 'egGridColumnsProvider','$filter','$window','$sce','$timeout', - 'egProgressDialog', + 'egProgressDialog', 'egConfirmDialog', 'egStrings', function($scope, $q , egCore, egGridFlatDataProvider , $location, egGridColumnsProvider , $filter , $window , $sce , $timeout, - egProgressDialog) { + egProgressDialog, egConfirmDialog, egStrings) { var grid = this; @@ -1123,6 +1123,18 @@ angular.module('egGridMod', $scope.collect = function() { grid.collect() } + + $scope.confirmAllowAllAndCollect = function(){ + egConfirmDialog.open(egStrings.CONFIRM_LONG_RUNNING_ACTION_ALL_ROWS_TITLE, + egStrings.CONFIRM_LONG_RUNNING_ACTION_MSG) + .result + .then(function(){ + $scope.offset(0); + $scope.limit(10000); + grid.collect(); + }); + } + // asks the dataProvider for a page of data grid.collect = function() { -- 2.11.0