From d61dcd4c8018b3784cfe9d1a791f9e6be841b168 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 19 Aug 2015 23:16:46 -0400 Subject: [PATCH] LP#1452950 browser client patron reg additions * generate password * update expire date * phone / email invalide buttons (display only) Signed-off-by: Bill Erickson Signed-off-by: Galen Charlton --- .../src/templates/staff/circ/patron/index.tt2 | 1 + .../templates/staff/circ/patron/register.tt2 | 1 + .../templates/staff/circ/patron/t_edit.tt2 | 27 +++++++++++++------ .../js/ui/default/staff/circ/patron/regctl.js | 20 ++++++++++++++ 4 files changed, 41 insertions(+), 8 deletions(-) diff --git a/Open-ILS/src/templates/staff/circ/patron/index.tt2 b/Open-ILS/src/templates/staff/circ/patron/index.tt2 index 9cfd554108..df0cea5335 100644 --- a/Open-ILS/src/templates/staff/circ/patron/index.tt2 +++ b/Open-ILS/src/templates/staff/circ/patron/index.tt2 @@ -10,6 +10,7 @@ + [% INCLUDE 'staff/circ/share/circ_strings.tt2' %] diff --git a/Open-ILS/src/templates/staff/circ/patron/register.tt2 b/Open-ILS/src/templates/staff/circ/patron/register.tt2 index ddd9da20d9..96332d298d 100644 --- a/Open-ILS/src/templates/staff/circ/patron/register.tt2 +++ b/Open-ILS/src/templates/staff/circ/patron/register.tt2 @@ -6,6 +6,7 @@ [% BLOCK APP_JS %] + diff --git a/Open-ILS/src/templates/staff/circ/patron/t_edit.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_edit.tt2 index 29c15ecc67..9912d59000 100644 --- a/Open-ILS/src/templates/staff/circ/patron/t_edit.tt2 +++ b/Open-ILS/src/templates/staff/circ/patron/t_edit.tt2 @@ -70,19 +70,27 @@ -
+
[% IF field == 'barcode' %] - [% ELSIF field == 'password' %] + [% ELSIF field == 'passwd' %] - + [% ELSE %] + + + [% IF field.match('phone') OR field.match('email') %] + + [% END %] + [% set_str = "org_settings['ui.patron.edit." _ @@ -92,15 +100,14 @@ [% l('Example: [_1]', "{{" _ set_str _ "}}") %] + [% IF field.match('phone') %] - [% l('Example: [_1]', - "{{org_settings['ui.patron.edit.phone.example']}}") %] + "{{org_settings['ui.patron.edit.phone.example']}}") %] [% END %] [% END %] -
[% END %] @@ -200,11 +207,14 @@
  • {{grp.name()}} + ng-click="set_profile(grp)">{{grp.name()}}
  • +
    + +
    @@ -219,7 +229,8 @@ class="form-control" ng-model="patron.expire_date"/>
    - +
    diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js b/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js index f8aef69db8..3a46e61c25 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js +++ b/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js @@ -437,6 +437,26 @@ function PatronRegCtrl($scope, $routeParams, return field_visibility[field_key] >= $scope.edit_passthru.vis_level; } + + // generates a random 4-digit password + $scope.generate_password = function() { + $scope.patron.passwd = Math.floor(Math.random()*9000) + 1000; + } + + $scope.set_expire_date = function() { + if (!$scope.patron.profile) return; + var seconds = egCore.date.intervalToSeconds( + $scope.patron.profile.perm_interval()); + var now_epoch = new Date().getTime(); + $scope.patron.expire_date = new Date( + now_epoch + (seconds * 1000 /* milliseconds */)) + } + + // grp is the pgt object + $scope.set_profile = function(grp) { + $scope.patron.profile = grp; + $scope.set_expire_date(); + } } -- 2.43.2