From a2f33fedb3efb8a91775541084a963141f6b8cda Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 29 Jun 2017 17:53:56 -0400 Subject: [PATCH] LP#1694529 Patron editor friendly xact ID collision alert Display a friendly alert dialog message to staff when attempting to save a patron record that has been externally modified during editing. This is an improvement over the existing debug alert with JSON data. Signed-off-by: Bill Erickson Signed-off-by: Galen Charlton --- Open-ILS/src/templates/staff/circ/patron/index.tt2 | 1 + Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/Open-ILS/src/templates/staff/circ/patron/index.tt2 b/Open-ILS/src/templates/staff/circ/patron/index.tt2 index 9f2d4cc24c..ea11be0e01 100644 --- a/Open-ILS/src/templates/staff/circ/patron/index.tt2 +++ b/Open-ILS/src/templates/staff/circ/patron/index.tt2 @@ -61,6 +61,7 @@ angular.module('egCoreMod').run(['egStrings', function(s) { s.PATRON_PURGE_OVERRIDE_PROMPT = "[% l('The account has open transactions (circulations and/or unpaid bills). Purge anyway?') %]"; s.OPT_IN_DIALOG_TITLE = "[% l('Verify Permission to Share Personal Information') %]"; s.OPT_IN_DIALOG = "[% l('Does patron [_1], [_2] from [_3] ([_4]) consent to having their personal information shared with your library?', '{{family_name}}', '{{first_given_name}}', '{{org_name}}', '{{org_shortname}}') %]"; + s.PATRON_EDIT_COLLISION = "[% l('Patron record was modified while editing. Please reapply changes.') %]"; }]); 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 3cc9348bf4..f40a9c0e04 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 @@ -1810,6 +1810,14 @@ function($scope , $routeParams , $q , $uibModal , $window , egCore , return patronRegSvc.save_user_settings( new_user, $scope.user_settings); } else { + var evt = egCore.evt.parse(new_user); + + if (evt && evt.textcode == 'XACT_COLLISION') { + return egAlertDialog.open( + egCore.strings.PATRON_EDIT_COLLISION).result; + } + + // debug only -- should not get here. alert('Patron update failed. \n\n' + js2JSON(new_user)); } -- 2.11.0