From: Michael Peters Date: Thu, 13 Oct 2011 13:25:32 +0000 (-0400) Subject: Link up an error message on attempt to delete a patron with open xacts X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fuser%2Fmrpeters-isl%2Fprevent_user_delete_with_open_xacts;p=working%2FEvergreen.git Link up an error message on attempt to delete a patron with open xacts Signed-off-by: Michael Peters --- diff --git a/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties b/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties index d4996b7e1e..e62c255a78 100644 --- a/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties +++ b/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties @@ -94,6 +94,7 @@ staff.patron.display.cmd_patron_delete.dest_user.default_value= staff.patron.display.cmd_patron_delete.dest_user.title=Destination User staff.patron.display.cmd_patron_delete.dest_user.failure=Failed to retrieve destination user. User deletion aborted. staff.patron.display.cmd_patron_delete.dest_user.self_reference_failure=Cannot specify the deleted user as the destination user. User deletion aborted. +staff.patron.display.cmd_patron_delete.open_xact=The user you have attempted to delete cannot be deleted because it has open circulations and/or unpaid bills. staff.patron.display.spawn_editor.editing_related_patron=Editing Related Patron staff.patron.display.init.retrieving_patron=Retrieving Patron... staff.patron.display.init.retrieving=Retrieving... diff --git a/Open-ILS/xul/staff_client/server/patron/display.js b/Open-ILS/xul/staff_client/server/patron/display.js index 3cf9f96f69..8eea7cd821 100644 --- a/Open-ILS/xul/staff_client/server/patron/display.js +++ b/Open-ILS/xul/staff_client/server/patron/display.js @@ -123,7 +123,16 @@ patron.display.prototype = { } params.push( dest_usr.id() ); } - obj.network.simple_request( 'FM_AU_DELETE', params ); + var robj = obj.network.simple_request( 'FM_AU_DELETE', params ); + alert(js2JSON(robj)); + if (typeof robj.ilsevent != 'undefined') { + switch(Number(robj.ilsevent)) { + case 2004 /* ACTOR_USER_DELETE_OPEN_XACTS */ : + alert(document.getElementById('patronStrings').getString('staff.patron.display.cmd_patron_delete.open_xact')); + return; + break; + } + } obj.refresh_all(); } } catch(E) {