From: phasefx Date: Wed, 29 Jul 2009 22:18:31 +0000 (+0000) Subject: UI for patron deletion X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=67227402def0cfbce34e28a3b6e24f3a68b59f7c;p=evergreen%2Fmasslnc.git UI for patron deletion git-svn-id: svn://svn.open-ils.org/ILS/trunk@13779 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index e98d640491..daedd4c0d4 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -1198,6 +1198,8 @@ + + diff --git a/Open-ILS/xul/staff_client/chrome/content/main/constants.js b/Open-ILS/xul/staff_client/chrome/content/main/constants.js index 94fafdc9e6..ee51102d46 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/constants.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/constants.js @@ -149,6 +149,7 @@ const api = { 'FM_AU_MERGE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.merge' }, 'FM_AU_NEW_USERGROUP' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.usergroup.new' }, 'FM_AU_UPDATE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.patron.update' }, + 'FM_AU_DELETE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.delete' }, 'FM_AUN_RETRIEVE_ALL' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.note.retrieve.all', 'cacheable' : false, 'ttl' : 60000 }, 'FM_AUN_RETRIEVE_ALL.authoritative' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.note.retrieve.all.authoritative', 'cacheable' : false, 'ttl' : 60000 }, 'FM_AUN_CREATE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.note.create' }, 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 0b2ed7edc9..579cc25413 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 @@ -54,7 +54,14 @@ staff.patron.bills.void_all_billings.error_voiding_bills=Error voiding bills. staff.patron.bills.void_all_billings.billings_voided=Billings voided. staff.patron.bill_wizard.patron_bill_finish.billing_added=Billing added. staff.patron.display.cmd_search_form.no_patron=No Patron Selected -staff.patron.display.cmd_patron_edit.edit_search=Editor would like to search for: %1$s +staff.patron.display.cmd_patron_delete.edit_search=Editor would like to search for: %1$s +staff.patron.display.cmd_patron_delete.dialog.title=Delete Patron Account +staff.patron.display.cmd_patron_delete.dialog.message=Completely OBLITERATE this patron account? This is IRREVERSIBLE. +staff.patron.display.cmd_patron_delete.dialog.confirmation=Check here to confirm this action. +staff.patron.display.cmd_patron_delete.dialog.cancel=Cancel Deletion +staff.patron.display.cmd_patron_delete.dialog.okay=Delete Account +staff.patron.display.cmd_patron_delete.deny_deletion_of_super_user=You may not delete a super user through this interface. +staff.patron.display.cmd_patron_delete.deny_deletion_of_self=You may not delete your own account. 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 216f39729e..945922c076 100644 --- a/Open-ILS/xul/staff_client/server/patron/display.js +++ b/Open-ILS/xul/staff_client/server/patron/display.js @@ -119,6 +119,39 @@ patron.display.prototype = { document.getElementById('splitter_grippy').doCommand(); } ], + 'cmd_patron_delete' : [ + ['command'], + function(ev) { + try { + if (get_bool( obj.patron.super_user() )) { + alert($("patronStrings").getString('staff.patron.display.cmd_patron_delete.deny_deletion_of_super_user')); + return; + } + if (obj.patron.id() == obj.OpenILS.data.list.au[0].id()) { + alert($("patronStrings").getString('staff.patron.display.cmd_patron_delete.deny_deletion_of_self')); + return; + } + var rv = obj.error.yns_alert_original( + $("patronStrings").getString('staff.patron.display.cmd_patron_delete.dialog.message'), + $("patronStrings").getString('staff.patron.display.cmd_patron_delete.dialog.title'), + $("patronStrings").getString('staff.patron.display.cmd_patron_delete.dialog.okay'), + $("patronStrings").getString('staff.patron.display.cmd_patron_delete.dialog.cancel'), + null, + $("patronStrings").getString('staff.patron.display.cmd_patron_delete.dialog.confirmation') + ); + //alert('rv = ' + rv + ' (' + typeof rv + ')'); + if (rv == 0) { + obj.network.simple_request( + 'FM_AU_DELETE', + [ ses(), obj.patron.id() ] + ); + } + obj.refresh_all(); + } catch(E) { + obj.error.standard_unexpected_error_alert('Error in server/patron/display.js -> cmd_patron_delete: ',E); + } + } + ], 'cmd_search_form' : [ ['command'], function(ev) { diff --git a/Open-ILS/xul/staff_client/server/patron/display.xul b/Open-ILS/xul/staff_client/server/patron/display.xul index 0f6afe897f..a2feb787ce 100644 --- a/Open-ILS/xul/staff_client/server/patron/display.xul +++ b/Open-ILS/xul/staff_client/server/patron/display.xul @@ -106,6 +106,7 @@ + diff --git a/Open-ILS/xul/staff_client/server/patron/display_horiz.xul b/Open-ILS/xul/staff_client/server/patron/display_horiz.xul index 393625049b..e1b97c0ac8 100644 --- a/Open-ILS/xul/staff_client/server/patron/display_horiz.xul +++ b/Open-ILS/xul/staff_client/server/patron/display_horiz.xul @@ -106,6 +106,7 @@ + diff --git a/Open-ILS/xul/staff_client/server/patron/display_horiz_overlay.xul b/Open-ILS/xul/staff_client/server/patron/display_horiz_overlay.xul index 13bd810fe3..e631d187e7 100644 --- a/Open-ILS/xul/staff_client/server/patron/display_horiz_overlay.xul +++ b/Open-ILS/xul/staff_client/server/patron/display_horiz_overlay.xul @@ -95,8 +95,9 @@ + + - diff --git a/Open-ILS/xul/staff_client/server/patron/display_overlay.xul b/Open-ILS/xul/staff_client/server/patron/display_overlay.xul index 1c81e5705b..bd71644266 100644 --- a/Open-ILS/xul/staff_client/server/patron/display_overlay.xul +++ b/Open-ILS/xul/staff_client/server/patron/display_overlay.xul @@ -95,8 +95,9 @@ + + -