recent patrons wip
authorBill Erickson <berickxx@gmail.com>
Tue, 1 Aug 2017 01:24:58 +0000 (21:24 -0400)
committerBill Erickson <berickxx@gmail.com>
Wed, 9 Aug 2017 02:12:56 +0000 (22:12 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/sql/Pg/upgrade/XXXX.data.recent-patrons.sql [new file with mode: 0644]
Open-ILS/src/templates/staff/navbar.tt2
Open-ILS/web/js/ui/default/staff/circ/patron/app.js
Open-ILS/web/js/ui/default/staff/services/navbar.js
Open-ILS/web/js/ui/default/staff/services/startup.js

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 (file)
index 0000000..26548f4
--- /dev/null
@@ -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;
index ba99321..da27a17 100644 (file)
               [% l('Register Patron') %]
             </a>
           </li>
-          <li>
+          <li ng-if="showRecentPatron">
             <a href="./circ/patron/last" target="_self"
               eg-accesskey="[% l('f8') %]" 
               eg-accesskey-desc="[% l('Retrieve Last Patron') %]">
               [% l('Retrieve Last Patron') %]
             </a>
           </li>
+          <li ng-if="showRecentPatrons">
+            <a href="./circ/patron/recent" target="_self"
+              eg-accesskey="[% l('f8') %]" 
+              eg-accesskey-desc="[% l('Retrieve Recent Patrons') %]">
+              <span class="glyphicon glyphicon-share-alt"></span>
+              [% l('Retrieve Recent Patrons') %]
+            </a>
+          </li>
           <li>
             <a href="./circ/patron/pending/list" target="_self">
               <span class="glyphicon glyphicon-thumbs-up"></span>
index 1452ce5..8c991d9 100644 (file)
@@ -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', {
index 713d9f3..fa022b8 100644 (file)
@@ -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);
+                            });
                         }
                     }
                 );
index ea114d2..891962b 100644 (file)
@@ -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 =