From a0c569a4401f81a19022e0368369149d827ac18e Mon Sep 17 00:00:00 2001 From: Jason Boyer Date: Wed, 18 Oct 2017 22:05:05 -0500 Subject: [PATCH] LP1724725: Handle ident_type2 in Web Staff User Editor While it was fairly harmless to not be able to set an ident_type2 value in the webstaff editor, the way things worked out if a user had one set from the XUL client or direct manipulation an attempt to save such a user would crash the cstore backend. To test ------- [1] Use the patron editor to edit a patron that has a value set for ident_value2. Save a change, but note that nothing is displayed and that eventually an open-ils.cstore error is reported in the browser console. [2] Apply the patch and repeat step 1. This time, the patron editor will display the secondary identification type field and allow you to save changes to the record. Signed-off-by: Jason Boyer Signed-off-by: Galen Charlton --- .../src/templates/staff/circ/patron/t_edit.tt2 | 15 +++++++++++++++ .../web/js/ui/default/staff/circ/patron/regctl.js | 4 ++++ 2 files changed, 19 insertions(+) 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 23977d9bee..ce8da85675 100644 --- a/Open-ILS/src/templates/staff/circ/patron/t_edit.tt2 +++ b/Open-ILS/src/templates/staff/circ/patron/t_edit.tt2 @@ -317,6 +317,21 @@ within the "form" by name for validation. + + +
+ [% draw_field_label('au', 'ident_type2') %] +
+ +
+
+
[% draw_field_label('au', 'ident_value2') %] 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 861488d310..adf5c7148d 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 @@ -639,6 +639,7 @@ angular.module('egCoreMod') patron.profile = current.profile(); // pre-hash version patron.net_access_level = current.net_access_level(); patron.ident_type = current.ident_type(); + patron.ident_type2 = current.ident_type2(); patron.groups = current.groups(); // pre-hash angular.forEach( @@ -755,6 +756,8 @@ angular.module('egCoreMod') if (user.profile) user.profile = egCore.env.pgt.map[user.profile]; if (user.ident_type) user.ident_type = egCore.env.cit.map[user.ident_type]; + if (user.ident_type2) + user.ident_type2 = egCore.env.cit.map[user.ident_type2]; user.dob = service.parse_dob(user.dob); // Clear the usrname if it looks like a UUID @@ -1286,6 +1289,7 @@ function($scope , $routeParams , $q , $uibModal , $window , egCore , 'au.first_given_name' : 3, 'au.family_name' : 3, 'au.ident_type' : 3, + 'au.ident_type2' : 2, 'au.home_ou' : 3, 'au.profile' : 3, 'au.expire_date' : 3, -- 2.43.2