[open-ils-commits] r14229 - in trunk/Open-ILS/xul/staff_client/server: locale/en-US patron (phasefx)
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Sep 30 14:40:08 EDT 2009
Author: phasefx
Date: 2009-09-30 14:40:03 -0400 (Wed, 30 Sep 2009)
New Revision: 14229
Modified:
trunk/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties
trunk/Open-ILS/xul/staff_client/server/patron/display.js
Log:
prompt for destination user (for transfer of misc staff junk) if deleting a staff user
Modified: trunk/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties 2009-09-30 18:39:16 UTC (rev 14228)
+++ trunk/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties 2009-09-30 18:40:03 UTC (rev 14229)
@@ -70,6 +70,11 @@
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.cmd_patron_delete.dest_user.prompt=The user you're attempting to delete has STAFF_LOGIN priviledges. Please enter the barcode for a destination user to receive the deleted user's miscellaneous staff artifacts (reports, etc.):
+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.spawn_editor.editing_related_patron=Editing Related Patron
staff.patron.display.init.retrieving_patron=Retrieving Patron...
staff.patron.display.init.retrieving=Retrieving...
Modified: trunk/Open-ILS/xul/staff_client/server/patron/display.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/display.js 2009-09-30 18:39:16 UTC (rev 14228)
+++ trunk/Open-ILS/xul/staff_client/server/patron/display.js 2009-09-30 18:40:03 UTC (rev 14229)
@@ -142,12 +142,30 @@
);
//alert('rv = ' + rv + ' (' + typeof rv + ')');
if (rv == 0) {
- obj.network.simple_request(
- 'FM_AU_DELETE',
- [ ses(), obj.patron.id() ]
- );
+ var params = [ ses(), obj.patron.id() ];
+ var staff_check = obj.network.simple_request('PERM_RETRIEVE_WORK_OU',[ ses(), 'STAFF_LOGIN', obj.patron.id() ]);
+ if (staff_check.length > 0) {
+ var dest_barcode = window.prompt(
+ $("patronStrings").getString('staff.patron.display.cmd_patron_delete.dest_user.prompt'),
+ $("patronStrings").getString('staff.patron.display.cmd_patron_delete.dest_user.default_value'),
+ $("patronStrings").getString('staff.patron.display.cmd_patron_delete.dest_user.title')
+ );
+ if (!dest_barcode) return;
+ JSAN.use('patron.util');
+ var dest_usr = patron.util.retrieve_fleshed_au_via_barcode( ses(), dest_barcode );
+ if (typeof dest_usr.ilsevent != 'undefined') {
+ alert( $("patronStrings").getString('staff.patron.display.cmd_patron_delete.dest_user.failure') );
+ return;
+ }
+ if (dest_usr.id() == obj.patron.id()) {
+ alert( $("patronStrings").getString('staff.patron.display.cmd_patron_delete.dest_user.self_reference_failure') );
+ return;
+ }
+ params.push( dest_usr.id() );
+ }
+ obj.network.simple_request( 'FM_AU_DELETE', params );
+ obj.refresh_all();
}
- obj.refresh_all();
} catch(E) {
obj.error.standard_unexpected_error_alert('Error in server/patron/display.js -> cmd_patron_delete: ',E);
}
More information about the open-ils-commits
mailing list