[open-ils-commits] [GIT] Evergreen ILS branch rel_3_0 updated. f9c8e6ae4315871abc08179c137b8d199261e43c

Evergreen Git git at git.evergreen-ils.org
Mon Apr 30 15:32:16 EDT 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, rel_3_0 has been updated
       via  f9c8e6ae4315871abc08179c137b8d199261e43c (commit)
      from  0c3135c78913e9e55417012b5e84bb8f276c1c6f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit f9c8e6ae4315871abc08179c137b8d199261e43c
Author: Bill Erickson <berickxx at gmail.com>
Date:   Fri Feb 9 14:27:05 2018 -0500

    LP#1748006 Patron edit juv flag manual override
    
    Allow staff to manually override the patron juvenile flag value
    regardless of patron DoB.
    
    Patch removes the ng-blur handler for dob and expire_date, which fires
    too aggressively.  The dob handler is replaced with a $watch handler, so
    the new and old value can be compared.  No watch is applied to
    expire_date, since no code is currently fired when it's changed.
    
    Change the log level of the "field changed" message from log to debug.
    
    To test:
    
    [1] Open a patron in the web staff patron editor.
    [2] Apply a juvenile birth date (less than 18 years by default).
    [3] Confirm the juvenile flag is automatically activated (if it wasn't
        already).
    [4] Confirm it's possible to un-check the juvenile flag and save the
        patron.
    
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Cesar Velez <cesar.velez at equinoxinitiative.org>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

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 eacd477..266ba81 100644
--- a/Open-ILS/src/templates/staff/circ/patron/t_edit.tt2
+++ b/Open-ILS/src/templates/staff/circ/patron/t_edit.tt2
@@ -281,8 +281,7 @@ within the "form" by name for validation.
   <div class="col-md-3 reg-field-input">
     <eg-date-input
       ng-required="field_required('au', 'dob')" 
-      ng-model="patron.dob"
-      ng-blur="handle_field_changed(patron, 'dob')">
+      ng-model="patron.dob">
     </eg-date-input>
   </div>
   <div class="col-md-6 patron-reg-example">
@@ -480,7 +479,6 @@ within the "form" by name for validation.
   [% draw_field_label('au', 'expire_date') %]
   <div class="col-md-3 reg-field-input">
     <eg-date-input 
-      ng-blur="handle_field_changed(patron, 'expire_date')"
       ng-model="patron.expire_date">
     </eg-date-input>
   </div>
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 b49bf27..3b6d81b 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
@@ -1271,8 +1271,24 @@ function($scope , $routeParams , $q , $uibModal , $window , egCore ,
 
         prs.set_field_patterns(field_patterns);
         apply_username_regex();
+
+        add_date_watchers();
     });
 
+    function add_date_watchers() {
+
+        $scope.$watch('patron.dob', function(newVal, oldVal) {
+            // Even though this runs after page data load, there
+            // are still times when it fires unnecessarily.
+            if (newVal === oldVal) return;
+
+            console.debug('dob change: ' + newVal + ' : ' + oldVal);
+            maintain_juvenile_flag();
+        });
+
+        // No need to watch expire_date
+    }
+
 
     // update the currently displayed field documentation
     $scope.set_selected_field_doc = function(cls, field) {
@@ -1741,7 +1757,7 @@ function($scope , $routeParams , $q , $uibModal , $window , egCore ,
         var cls = obj.classname; // set by egIdl
         var value = obj[field_name];
 
-        console.log('changing field ' + field_name + ' to ' + value);
+        console.debug('changing field ' + field_name + ' to ' + value);
 
         switch (field_name) {
             case 'day_phone' : 
@@ -1791,10 +1807,6 @@ function($scope , $routeParams , $q , $uibModal , $window , egCore ,
                 $scope.barcode_changed(value);
                 apply_username_regex();
                 break;
-
-            case 'dob':
-                maintain_juvenile_flag();
-                break;
         }
     }
 

-----------------------------------------------------------------------

Summary of changes:
 .../src/templates/staff/circ/patron/t_edit.tt2     |    4 +--
 .../web/js/ui/default/staff/circ/patron/regctl.js  |   22 +++++++++++++++----
 2 files changed, 18 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list