UI for patron deletion
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 29 Jul 2009 22:18:31 +0000 (22:18 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 29 Jul 2009 22:18:31 +0000 (22:18 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@13779 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/opac/locale/en-US/lang.dtd
Open-ILS/xul/staff_client/chrome/content/main/constants.js
Open-ILS/xul/staff_client/server/locale/en-US/patron.properties
Open-ILS/xul/staff_client/server/patron/display.js
Open-ILS/xul/staff_client/server/patron/display.xul
Open-ILS/xul/staff_client/server/patron/display_horiz.xul
Open-ILS/xul/staff_client/server/patron/display_horiz_overlay.xul
Open-ILS/xul/staff_client/server/patron/display_overlay.xul

index e98d640..daedd4c 100644 (file)
 <!ENTITY staff.patron_display.verify_password.accesskey 'P'>
 <!ENTITY staff.patron_display.toggle_summary.label 'Toggle Summary'>
 <!ENTITY staff.patron_display.toggle_summary.accesskey 'T'>
+<!ENTITY staff.patron_display.delete_patron.label 'Delete Patron Account'>
+<!ENTITY staff.patron_display.delete_patron.accesskey 'D'>
 <!ENTITY staff.patron_display.mailing.city.label 'Mailing City:'>
 <!ENTITY staff.patron_display.mailing.post_code.label 'Mailing ZIP:'>
 <!ENTITY staff.patron_display.mailing.state.label 'Mailing State:'>
index 94fafdc..ee51102 100644 (file)
@@ -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' },
index 0b2ed7e..579cc25 100644 (file)
@@ -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...
index 216f397..945922c 100644 (file)
@@ -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) {
index 0f6afe8..a2feb78 100644 (file)
                <command id="cmd_patron_retrieve" />
                <command id="cmd_patron_merge" />
                <command id="cmd_patron_toggle_summary" />
+               <command id="cmd_patron_delete" />
                <command id="cmd_search_form" />
                <command id="cmd_verify_credentials" />
                <command id="cmd_perm_editor" />
index 3936250..e1b97c0 100644 (file)
                <command id="cmd_patron_retrieve" />
                <command id="cmd_patron_merge" />
                <command id="cmd_patron_toggle_summary" />
+               <command id="cmd_patron_delete" />
                <command id="cmd_search_form" />
                <command id="cmd_verify_credentials" />
                <command id="cmd_perm_editor" />
index 13bd810..e631d18 100644 (file)
@@ -95,8 +95,9 @@
                                     <menuitem label="&staff.patron.info.group.label;" accesskey="&staff.patron.info.group.accesskey;" command="cmd_patron_info_groups"/>
                                     <menuitem label="&staff.patron_display.verify_password.label;" accesskey="&staff.patron_display.verify_password.accesskey;" command="cmd_verify_credentials"/>
                                     <menuitem label="&staff.main.menu.admin.user_edit.label;" accesskey="&staff.main.menu.admin.user_edit.accesskey;" command="cmd_perm_editor"/>
+                                    <menuitem label="&staff.patron_display.toggle_summary.label;" accesskey="&staff.patron_display.toggle_summary.accesskey;" command="cmd_patron_toggle_summary"/>
+                                    <menuitem label="&staff.patron_display.delete_patron.label;" accesskey="&staff.patron_display.delete_patron.accesskey;" command="cmd_patron_delete"/>
                                     <menuitem label="&staff.patron.display_overlay.exit.label;" accesskey="&staff.patron.display_overlay.exit.accesskey;" command="cmd_patron_exit"/>
-                                    <menuitem label="&staff.patron_display.toggle_summary.label;" accesskey="&staff.patron_display.toggle_summary.label;" command="cmd_patron_toggle_summary"/>
                                 </menupopup>
                             </button>
                         </row>
index 1c81e57..bd71644 100644 (file)
@@ -95,8 +95,9 @@
                                     <menuitem label="&staff.patron.info.group.label;" accesskey="&staff.patron.info.group.accesskey;" command="cmd_patron_info_groups"/>
                                     <menuitem label="&staff.patron_display.verify_password.label;" accesskey="&staff.patron_display.verify_password.accesskey;" command="cmd_verify_credentials"/>
                                     <menuitem label="&staff.main.menu.admin.user_edit.label;" accesskey="&staff.main.menu.admin.user_edit.accesskey;" command="cmd_perm_editor"/>
+                                    <menuitem label="&staff.patron_display.toggle_summary.label;" accesskey="&staff.patron_display.toggle_summary.accesskey;" command="cmd_patron_toggle_summary"/>
+                                    <menuitem label="&staff.patron_display.delete_patron.label;" accesskey="&staff.patron_display.delete_patron.accesskey;" command="cmd_patron_delete"/>
                                     <menuitem label="&staff.patron.display_overlay.exit.label;" accesskey="&staff.patron.display_overlay.exit.accesskey;" command="cmd_patron_exit"/>
-                                    <menuitem label="&staff.patron_display.toggle_summary.label;" accesskey="&staff.patron_display.toggle_summary.label;" command="cmd_patron_toggle_summary"/>
                                 </menupopup>
                             </button>
                         </row>