From aff911a6987a77a7ddb2969a9fa5772417d5df08 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 31 Jul 2017 21:24:58 -0400 Subject: [PATCH] recent patrons wip Signed-off-by: Bill Erickson --- .../sql/Pg/upgrade/XXXX.data.recent-patrons.sql | 26 ++++++++++++++++++++++ Open-ILS/src/templates/staff/navbar.tt2 | 10 ++++++++- .../web/js/ui/default/staff/circ/patron/app.js | 6 +++++ .../web/js/ui/default/staff/services/navbar.js | 7 ++++++ .../web/js/ui/default/staff/services/startup.js | 3 ++- 5 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.data.recent-patrons.sql 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 new file mode 100644 index 0000000000..26548f48dc --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.recent-patrons.sql @@ -0,0 +1,26 @@ +BEGIN; + +-- SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); +INSERT INTO config.org_unit_setting_type + (name, label, description, grp, datatype) +VALUES ( + 'ui.staff.max_recent_patrons', + oils_i18n_gettext( + 'ui.staff.max_recent_patrons', + 'Number of Retrievable Recent Patrons', + 'coust', + 'label' + ), + oils_i18n_gettext( + 'ui.staff.max_recent_patrons', + 'Number of most recently accessed patrons that can be re-retrieved in the staff client. A value of 0 or less disables the feature', + 'coust', + 'description' + ), + 'opac', + 'integer' +); + + + +COMMIT; diff --git a/Open-ILS/src/templates/staff/navbar.tt2 b/Open-ILS/src/templates/staff/navbar.tt2 index ba99321dd1..da27a17b56 100644 --- a/Open-ILS/src/templates/staff/navbar.tt2 +++ b/Open-ILS/src/templates/staff/navbar.tt2 @@ -114,7 +114,7 @@ [% l('Register Patron') %] -
  • +
  • @@ -122,6 +122,14 @@ [% l('Retrieve Last Patron') %]
  • +
  • + + + [% l('Retrieve Recent Patrons') %] + +
  • 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 1452ce5f43..8c991d9eb9 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 @@ -98,6 +98,12 @@ angular.module('egPatronApp', ['ngRoute', 'ui.bootstrap', resolve : resolver }); + $routeProvider.when('/circ/patron/recent', { + templateUrl: './circ/patron/t_search', + controller: 'PatronSearchCtrl', + resolve : resolver + }); + // the following require a patron ID $routeProvider.when('/circ/patron/:id/alerts', { 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 713d9f39ec..fa022b8586 100644 --- a/Open-ILS/web/js/ui/default/staff/services/navbar.js +++ b/Open-ILS/web/js/ui/default/staff/services/navbar.js @@ -116,6 +116,13 @@ angular.module('egCoreMod') $scope.op_changed = egCore.auth.OCtoken() ? true : false; $scope.username = egCore.auth.user().usrname(); $scope.workstation = egCore.auth.workstation(); + + 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); + }); } } ); 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 ea114d2639..891962bcf2 100644 --- a/Open-ILS/web/js/ui/default/staff/services/startup.js +++ b/Open-ILS/web/js/ui/default/staff/services/startup.js @@ -32,7 +32,8 @@ function($q, $rootScope, $location, $window, egIDL, egAuth, egEnv , egOrg function() { return egOrg.settings([ 'webstaff.format.dates', - 'webstaff.format.date_and_time' + 'webstaff.format.date_and_time', + 'ui.staff.max_recent_patrons' // affects all pages ]).then( function(set) { $rootScope.egDateFormat = -- 2.11.0