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 <berickxx@gmail.com>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
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.') %]";
}]);
</script>
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));
}