[open-ils-commits] [GIT] Evergreen ILS branch master updated. 357aabae410bbe25160947acd52693841d690e92

Evergreen Git git at git.evergreen-ils.org
Fri Jul 22 17:56:11 EDT 2016


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, master has been updated
       via  357aabae410bbe25160947acd52693841d690e92 (commit)
      from  8b77b6841833b7448fc2afdcea31911833581b72 (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 357aabae410bbe25160947acd52693841d690e92
Author: Galen Charlton <gmc at esilibrary.com>
Date:   Thu May 12 15:58:49 2016 -0400

    LP#1581196: webstaff: fix dirty form detection in patron editor
    
    This patch fixes a problem wherein the patron editor
    form would think that it had been modified by the
    user immediately after initialization.
    
    To test
    -------
    [1] Load the patron editor, then refresh the page. Note that
        you are warned that there is unsaved input.
    [2] As above, but hit the save button. Note that after saving,
        you still get a warning that there is unsaved input.
    [3] Apply the page, then repeat tests 1 and 2. This time, you
        shouldn't get inappropriate unsaved data warnings.
    
    Signed-off-by: Galen Charlton <gmc at esilibrary.com>
    Signed-off-by: Bill Erickson <berickxx at gmail.com>

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 c7427a0..d6345b0 100644
--- a/Open-ILS/src/templates/staff/circ/patron/t_edit.tt2
+++ b/Open-ILS/src/templates/staff/circ/patron/t_edit.tt2
@@ -262,7 +262,6 @@ within the "form" by name for validation.
   <div class="col-md-3 reg-field-input">
     <eg-date-input 
       ng-model="patron.dob"
-      ng-change="field_modified()" 
       ng-blur="handle_field_changed(patron, 'dob')">
     </eg-date-input>
   </div>
@@ -435,7 +434,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-change="field_modified()" 
       ng-blur="handle_field_changed(patron, 'expire_date')"
       ng-model="patron.expire_date">
     </eg-date-input>
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 b0b3486..0e6629e 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
@@ -1608,6 +1608,12 @@ function($scope , $routeParams , $q , $uibModal , $window , egCore ,
         egUnloadPrompt.attach($scope);
     }
 
+    // also monitor when form is changed *by the user*, as using
+    // an ng-change handler doesn't work with eg-date-input
+    $scope.$watch('reg_form.$pristine', function(newVal, oldVal) {
+        if (!newVal) egUnloadPrompt.attach($scope);
+    });
+
     // username regex (if present) must be removed any time
     // the username matches the barcode to avoid firing the
     // invalid field handlers.

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

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


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list