From f88fc0324397975ffd35d61cae6d81f08fc8c4b5 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 25 Jun 2014 15:24:36 -0400 Subject: [PATCH] retrieve last patron Signed-off-by: Bill Erickson --- .../src/templates/staff/circ/patron/t_last_patron.tt2 | 9 +++++++++ Open-ILS/src/templates/staff/navbar.tt2 | 6 ++++++ Open-ILS/web/js/ui/default/staff/circ/patron/app.js | 17 +++++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 Open-ILS/src/templates/staff/circ/patron/t_last_patron.tt2 diff --git a/Open-ILS/src/templates/staff/circ/patron/t_last_patron.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_last_patron.tt2 new file mode 100644 index 0000000000..9a917d859e --- /dev/null +++ b/Open-ILS/src/templates/staff/circ/patron/t_last_patron.tt2 @@ -0,0 +1,9 @@ +
+
+ [% l('No patrons recently accessed.') %] + + [% l('Try Patron Search') %] + +
+
+
diff --git a/Open-ILS/src/templates/staff/navbar.tt2 b/Open-ILS/src/templates/staff/navbar.tt2 index ffe08f6f26..0d1981d7a7 100644 --- a/Open-ILS/src/templates/staff/navbar.tt2 +++ b/Open-ILS/src/templates/staff/navbar.tt2 @@ -73,6 +73,12 @@ [% l('Check In') %] +
  • + + + [% l('Retrieve Last Patron') %] + +
  • 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 c8318181a7..faf9203ccf 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 @@ -75,6 +75,12 @@ angular.module('egPatronApp', ['ngRoute', 'ui.bootstrap', resolve : resolver }); + $routeProvider.when('/circ/patron/last', { + templateUrl: './circ/patron/t_last_patron', + controller: 'PatronFetchLastCtrl', + resolve : resolver + }); + // the following require a patron ID $routeProvider.when('/circ/patron/:id/alerts', { @@ -204,6 +210,7 @@ function($q , $timeout , $location , egCore, egUser , $locale) { var user_id = id ? id : (user ? user.id() : null); console.debug('setting primary user to: ' + user_id); + egCore.hatch.setLocalItem('eg.circ.last_patron', user_id); // avoid running multiple retrievals for the same patron, which // can happen during dbl-click by maintaining a single running @@ -1355,3 +1362,13 @@ function($scope, $routeParams , $q , egCore , patronSvc) { }); }]) +.controller('PatronFetchLastCtrl', + ['$scope','$location','egCore', +function($scope , $location , egCore) { + + var id = egCore.hatch.getLocalItem('eg.circ.last_patron'); + if (id) return $location.path('/circ/patron/' + id + '/checkout'); + + $scope.no_last = true; +}]) + -- 2.11.0