From 0b0002704ea1545b7691716885b3fcfca3861629 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Tue, 8 Aug 2017 22:12:52 -0400 Subject: [PATCH] recent patrons wip Signed-off-by: Bill Erickson --- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 5 ----- Open-ILS/src/sql/Pg/upgrade/XXXX.data.recent-patrons.sql | 5 ----- Open-ILS/web/js/ui/default/staff/circ/patron/app.js | 4 ++-- Open-ILS/web/js/ui/default/staff/services/navbar.js | 4 ++-- Open-ILS/web/js/ui/default/staff/services/startup.js | 4 ++++ 5 files changed, 8 insertions(+), 14 deletions(-) diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql index 34ca281fb2..7771591bc9 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -17125,9 +17125,4 @@ VALUES ( 'integer' ); --- For backwards compat apply a max count value of 1 globally. -INSERT INTO actor.org_unit_setting (org_unit, name, value) - SELECT id, 'ui.staff.max_recent_patrons', '1' - FROM actor.org_unit WHERE parent_ou IS NULL; - diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.recent-patrons.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.recent-patrons.sql index 81798796f3..3cf897d60b 100644 --- a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.recent-patrons.sql +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.recent-patrons.sql @@ -23,9 +23,4 @@ VALUES ( 'integer' ); --- For backwards compat apply a max count value of 1 globally. -INSERT INTO actor.org_unit_setting (org_unit, name, value) - SELECT id, 'ui.staff.max_recent_patrons', '1' - FROM actor.org_unit WHERE parent_ou IS NULL; - COMMIT; diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/app.js b/Open-ILS/web/js/ui/default/staff/circ/patron/app.js index 34acd7fcda..3329e20ef7 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/patron/app.js +++ b/Open-ILS/web/js/ui/default/staff/circ/patron/app.js @@ -683,10 +683,10 @@ function($scope, $q , $location , $filter , egCore , egNet , egUser , egAlertDi $scope.aous = egCore.env.aous; $scope.auth_user_id = egCore.auth.user().id(); - // max recents setting is loaded during startup. + // max recents setting is loaded and scrubbed during startup. // cache it in a local variable for ease of access. egCore.org.settings('ui.staff.max_recent_patrons').then(function(s) { - patronSvc.maxRecentPatrons = s['ui.staff.max_recent_patrons'] || 0; + patronSvc.maxRecentPatrons = s['ui.staff.max_recent_patrons']; }); if (patron_id) { diff --git a/Open-ILS/web/js/ui/default/staff/services/navbar.js b/Open-ILS/web/js/ui/default/staff/services/navbar.js index fa022b8586..1d90691956 100644 --- a/Open-ILS/web/js/ui/default/staff/services/navbar.js +++ b/Open-ILS/web/js/ui/default/staff/services/navbar.js @@ -120,8 +120,8 @@ angular.module('egCoreMod') egCore.org.settings('ui.staff.max_recent_patrons') .then(function(s) { var val = s['ui.staff.max_recent_patrons']; - $scope.showRecentPatron = (val && val > 0); - $scope.showRecentPatrons = (val && val > 1); + $scope.showRecentPatron = val > 0; + $scope.showRecentPatrons = val > 1; }); } } diff --git a/Open-ILS/web/js/ui/default/staff/services/startup.js b/Open-ILS/web/js/ui/default/staff/services/startup.js index 891962bcf2..e5db76d820 100644 --- a/Open-ILS/web/js/ui/default/staff/services/startup.js +++ b/Open-ILS/web/js/ui/default/staff/services/startup.js @@ -40,6 +40,10 @@ function($q, $rootScope, $location, $window, egIDL, egAuth, egEnv , egOrg set['webstaff.format.dates'] || 'shortDate'; $rootScope.egDateAndTimeFormat = set['webstaff.format.date_and_time'] || 'short'; + + // default to 1 for backwards compat. + if (set['ui.staff.max_recent_patrons'] === null) + set['ui.staff.max_recent_patrons'] = 1 } ); } -- 2.11.0