[open-ils-commits] r16157 - in trunk/Open-ILS: web/opac/locale/en-US xul/staff_client/chrome/content/main xul/staff_client/chrome/locale/en-US xul/staff_client/server/circ xul/staff_client/server/locale/en-US xul/staff_client/server/patron (phasefx)

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Apr 7 14:15:56 EDT 2010


Author: phasefx
Date: 2010-04-07 14:15:52 -0400 (Wed, 07 Apr 2010)
New Revision: 16157

Modified:
   trunk/Open-ILS/web/opac/locale/en-US/lang.dtd
   trunk/Open-ILS/xul/staff_client/chrome/content/main/menu.js
   trunk/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties
   trunk/Open-ILS/xul/staff_client/server/circ/util.js
   trunk/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties
   trunk/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties
   trunk/Open-ILS/xul/staff_client/server/patron/display.js
   trunk/Open-ILS/xul/staff_client/server/patron/info_group.js
   trunk/Open-ILS/xul/staff_client/server/patron/staged.js
   trunk/Open-ILS/xul/staff_client/server/patron/util.js
Log:
Log more actions for Admin -> Local Administration -> Work Log

* work log entries for checkin attempts
* tweaked wording to be more truthful
* work log entries for patron edit and registration


Modified: trunk/Open-ILS/web/opac/locale/en-US/lang.dtd
===================================================================
--- trunk/Open-ILS/web/opac/locale/en-US/lang.dtd	2010-04-07 15:09:50 UTC (rev 16156)
+++ trunk/Open-ILS/web/opac/locale/en-US/lang.dtd	2010-04-07 18:15:52 UTC (rev 16157)
@@ -178,8 +178,8 @@
 <!ENTITY staff.admin.survey.save_question.label "Save this Question">
 <!ENTITY staff.admin.survey.staff_client.label "Staff Client:">
 <!ENTITY staff.admin.survey.start.label "Start:">
-<!ENTITY staff.admin.work_log.list1.header "Most Recent Staff Actions">
-<!ENTITY staff.admin.work_log.list2.header "Most Recently Affected Patrons and Last Action for each">
+<!ENTITY staff.admin.work_log.list1.header "Most Recently Logged Staff Actions">
+<!ENTITY staff.admin.work_log.list2.header "Most Recently Affected Patrons for Logged Staff Actions and Last Action for each">
 <!ENTITY staff.admin.work_log.refresh_btn.label "Refresh">
 <!ENTITY staff.admin.work_log.refresh_btn.accesskey "">
 <!ENTITY staff.admin.work_log.list1.retrieve_item_btn.label "Retrieve Item">

Modified: trunk/Open-ILS/xul/staff_client/chrome/content/main/menu.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/main/menu.js	2010-04-07 15:09:50 UTC (rev 16156)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/main/menu.js	2010-04-07 18:15:52 UTC (rev 16157)
@@ -349,6 +349,28 @@
             'cmd_patron_register' : [
                 ['oncommand'],
                 function() {
+
+                    function log_registration(p) {
+                        try {
+                            obj.error.work_log(
+                                document.getElementById('offlineStrings').getFormattedString(
+                                    'staff.circ.work_log_patron_registration.message',
+                                    [
+                                        ses('staff_usrname'),
+                                        p.family_name(),
+                                        p.card().barcode()
+                                    ]
+                                ), {
+                                    'au_id' : p.id(),
+                                    'au_family_name' : p.family_name(),
+                                    'au_barcode' : p.card().barcode()
+                                }
+                            );
+                        } catch(E) {
+                            obj.error.sdump('D_ERROR','Error with work_logging in menu.js, cmd_patron_register:' + E);
+                        }
+                    }
+
                     function spawn_editor(p) {
                         var url = urls.XUL_PATRON_EDIT;
                         var param_count = 0;
@@ -366,6 +388,7 @@
                                 'passthru_content_params' : {
                                     'spawn_search' : function(s) { obj.spawn_search(s); },
                                     'spawn_editor' : spawn_editor,
+                                    'on_save' : function(p) { log_registration(p); }
                                 }
                             }
                         );
@@ -384,6 +407,7 @@
                                 'ses' : ses(),
                                 'spawn_search' : function(s) { obj.spawn_search(s); },
                                 'spawn_editor' : spawn_editor,
+                                'on_save' : function(p) { log_registration(p); }
                             }
                         }
                     );

Modified: trunk/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties	2010-04-07 15:09:50 UTC (rev 16156)
+++ trunk/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties	2010-04-07 18:15:52 UTC (rev 16157)
@@ -108,6 +108,8 @@
 menu.cmd_search_tcn.deleted.error="%1$s" is deleted.  Show the deleted record anyway?
 menu.cmd_patron_register.related.tab=Editing Related Patron
 menu.cmd_patron_register.tab=Register Patron
+# 1 - Staff Username  2 - Patron Family  3 - Patron Barcode
+staff.circ.work_log_patron_registration.message=%1$s registered %3$s (%2$s)
 menu.cmd_browse_holds.tab=Hold Browser
 menu.cmd_browse_holds_shelf.tab=Holds Shelf
 menu.cmd_browse_hold_pull_list.tab=On Shelf Pull List

Modified: trunk/Open-ILS/xul/staff_client/server/circ/util.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/circ/util.js	2010-04-07 15:09:50 UTC (rev 16156)
+++ trunk/Open-ILS/xul/staff_client/server/circ/util.js	2010-04-07 18:15:52 UTC (rev 16157)
@@ -2208,6 +2208,28 @@
             try {
                 var check = req.getResultObject();
                 var r = circ.util.checkin_via_barcode2(session,params,backdate,auto_print,check);
+                try {
+                    error.work_log(
+                        document.getElementById('circStrings').getFormattedString(
+                            'staff.circ.work_log_checkin_attempt.' + r.what_happened + '.message',
+                            [
+                                ses('staff_usrname'),
+                                r.payload.patron ? r.payload.patron.family_name() : '',
+                                r.payload.patron ? r.payload.patron.card().barcode() : '',
+                                r.payload.copy ? r.payload.copy.barcode() : '',
+                                r.route_to ? r.route_to : ''
+                            ]
+                        ), {
+                            'au_id' : r.payload.patron ? r.payload.patron.id() : '',
+                            'au_family_name' : r.payload.patron ? r.payload.patron.family_name() : '',
+                            'au_barcode' : r.payload.patron ? r.payload.patron.card().barcode() : '',
+                            'acp_barcode' : r.payload.copy ? r.payload.copy.barcode() : ''
+                        }
+                    );
+                } catch(E) {
+                    error.sdump('D_ERROR','Error with work_logging in server/circ/checkout.js, _checkout:' + E);
+                }
+
                 if (typeof params.checkin_result == 'function') {
                     try { params.checkin_result(r); } catch(E) { error.sdump('D_ERROR','params.checkin_result() = ' + E); };
                 }
@@ -2351,6 +2373,7 @@
             }
             if (check.ilsevent == 3 /* NO_CHANGE */) {
                 //msg = 'This item is already checked in.\n';
+                check.what_happened = 'no_change';
                 if (document.getElementById('no_change_label')) {
                     var m = document.getElementById('no_change_label').getAttribute('value');
                     document.getElementById('no_change_label').setAttribute('value', m + document.getElementById('circStrings').getFormattedString('staff.circ.utils.item_checked_in', [params.barcode]) + '  ');
@@ -2358,6 +2381,7 @@
                 }
             }
             if (check.ilsevent == 1202 /* ITEM_NOT_CATALOGED */ && check.copy.status() != 11) {
+                check.what_happened = 'error';
                 var copy_status = (data.hash.ccs[ check.copy.status() ] ? data.hash.ccs[ check.copy.status() ].name() : check.copy.status().name() );
                 var err_msg = document.getElementById('commonStrings').getString('common.error');
                 err_msg += '\nFIXME --';
@@ -2369,6 +2393,7 @@
             switch(Number(check.copy.status())) {
                 case 0: /* AVAILABLE */
                 case 7: /* RESHELVING */
+                    check.what_happened = 'success';
                     if (msg) {
                         print_data.route_to_msg = document.getElementById('circStrings').getFormattedString('staff.circ.utils.route_to.msg', [check.route_to]);
                         print_data.route_to = check.route_to;
@@ -2377,9 +2402,11 @@
                     }
                 break;
                 case 8: /* ON HOLDS SHELF */
+                    check.what_happened = 'hold_shelf';
                     check.route_to = document.getElementById('circStrings').getString('staff.circ.route_to.hold_shelf');
                     if (check.payload.hold) {
                         if (check.payload.hold.pickup_lib() != data.list.au[0].ws_ou()) {
+                            check.what_happened = 'error';
                             var err_msg = document.getElementById('commonStrings').getString('common.error');
                             err_msg += '\nFIXME: ';
                             err_msg += document.getElementById('circStrings').getString('staff.circ.utils.route_item_error');
@@ -2407,6 +2434,7 @@
                             msg += '\n';
                         }
                     } else {
+                        check.what_happened = 'error';
                         var err_msg = document.getElementById('commonStrings').getString('common.error');
                         err_msg += '\nFIXME: ';
                         err_msg += document.getElementById('circStrings').getString('staff.circ.utils.route_item_status_error');
@@ -2551,6 +2579,7 @@
                     }
                 break;
                 case 6: /* IN TRANSIT */
+                    check.what_happened = 'error';
                     check.route_to = 'TRANSIT SHELF??';
                     print_data.route_to;
                     var err_msg = document.getElementById('commonStrings').getString('common.error');
@@ -2559,6 +2588,7 @@
                     msg += err_msg;
                 break;
                 case 11: /* CATALOGING */
+                    check.what_happened = 'cataloging';
                     check.route_to = 'CATALOGING';
                     print_data.route_to;
                     if (document.getElementById('do_not_alert_on_precat')) {
@@ -2579,6 +2609,7 @@
                     }
                 break;
                 default:
+                    check.what_happened = 'error';
                     msg += document.getElementById('commonStrings').getString('common.error');
                     var copy_status = data.hash.ccs[check.copy.status()] ? data.hash.ccs[check.copy.status()].name() : check.copy.status().name();
                     msg += '\n';
@@ -2602,6 +2633,7 @@
             }
         } else /* ROUTE_ITEM */ if (check.ilsevent == 7000) {
 
+            check.what_happened = 'transit';
             var lib = data.hash.aou[ check.org ];
             check.route_to = lib.shortname();
             print_data.route_to = check.route_to;
@@ -2658,6 +2690,7 @@
             msg += '\n';
             JSAN.use('util.date');
             if (check.payload.hold) {
+                check.what_happened = 'transit_for_hold';
                 JSAN.use('patron.util');
                 var au_obj = patron.util.retrieve_fleshed_au_via_id( session, check.payload.hold.usr() );
                 print_data.user = au_obj;
@@ -2782,6 +2815,7 @@
 
         } else /* ASSET_COPY_NOT_FOUND */ if (check.ilsevent == 1502) {
 
+            check.what_happened = 'not_found';
             check.route_to = 'CATALOGING';
             var mis_scan_msg = document.getElementById('circStrings').getFormattedString('staff.circ.copy_status.status.copy_not_found', [params.barcode]);
             error.yns_alert(
@@ -2800,6 +2834,7 @@
 
         } else /* HOLD_CAPTURE_DELAYED */ if (check.ilsevent == 7019) {
 
+            check.what_happened = 'hold_capture_delayed';
             var rv = 0;
             msg += document.getElementById('circStrings').getString('staff.circ.utils.hold_capture_delayed.description');
             rv = error.yns_alert_formatted(
@@ -2816,6 +2851,7 @@
             return circ.util.checkin_via_barcode(session,params,backdate,auto_print,false);
 
         } else /* NETWORK TIMEOUT */ if (check.ilsevent == -1) {
+            check.what_happened = 'error';
             error.standard_network_error_alert(document.getElementById('circStrings').getString('staff.circ.checkin.suggest_offline'));
         } else {
 

Modified: trunk/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties	2010-04-07 15:09:50 UTC (rev 16156)
+++ trunk/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties	2010-04-07 18:15:52 UTC (rev 16157)
@@ -377,8 +377,26 @@
 staff.circ.utils.total_holds=Total Number of Holds
 staff.circ.work_log_column.message=Message
 staff.circ.work_log_column.when=When
+# 1 - Staff Username  2 - Patron Family  3 - Patron Barcode  4 - Item Barcode 
 staff.circ.work_log_checkout.message=%1$s circulated %4$s to %3$s (%2$s)
+# 1 - Staff Username  2 - Patron Family  3 - Patron Barcode  4 - Item Barcode 
 staff.circ.work_log_renew.message=%1$s renewed %4$s for %3$s (%2$s)
+# 1 - Staff Username  2 - Patron Family  3 - Patron Barcode  4 - Item Barcode  5 - Route To text
+staff.circ.work_log_checkin_attempt.transit.message=%1$s attempted checkin of %4$s, resulting in transit.  Route To = %5$s
+# 1 - Staff Username  2 - Patron Family  3 - Patron Barcode  4 - Item Barcode  5 - Route To text
+staff.circ.work_log_checkin_attempt.transit_for_hold.message=%1$s attempted checkin of %4$s, resulting in a hold-transit.  Route To = %5$s
+# 1 - Staff Username  2 - Patron Family  3 - Patron Barcode  4 - Item Barcode  5 - Route To text
+staff.circ.work_log_checkin_attempt.no_change.message=%1$s attempted checkin of %4$s, but nothing happened.  Route To = %5$s
+# 1 - Staff Username  2 - Patron Family  3 - Patron Barcode  4 - Item Barcode  5 - Route To text
+staff.circ.work_log_checkin_attempt.error.message=%1$s attempted checkin of %4$s, and an error occurred.  Route To = %5$s
+# 1 - Staff Username  2 - Patron Family  3 - Patron Barcode  4 - Item Barcode  5 - Route To text
+staff.circ.work_log_checkin_attempt.success.message=%1$s attempted checkin of %4$s, which succeeded.  Route To = %5$s
+# 1 - Staff Username  2 - Patron Family  3 - Patron Barcode  4 - Item Barcode  5 - Route To text
+staff.circ.work_log_checkin_attempt.hold_shelf.message=%1$s attempted checkin of %4$s, which routed the item to the Holds Shelf.  Route To = %5$s
+# 1 - Staff Username  2 - Patron Family  3 - Patron Barcode  4 - Item Barcode  5 - Route To text
+staff.circ.work_log_checkin_attempt.cataloging.message=%1$s attempted checkin of %4$s, which is a pre-cat and was routed to Cataloging.  Route To = %5$s
+# 1 - Staff Username  2 - Patron Family  3 - Patron Barcode  4 - Item Barcode  5 - Route To text
+staff.circ.work_log_checkin_attempt.cataloging.message=%1$s attempted checkin of %4$s, which was not found, and so was routed to Cataloging.  Route To = %5$s
 staff.circ.checkin.hold_capture=Hold Capture
 staff.circ.checkin.check_in.tab=Item Check In
 staff.circ.renew.tab.label=Renew Items

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	2010-04-07 15:09:50 UTC (rev 16156)
+++ trunk/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties	2010-04-07 18:15:52 UTC (rev 16157)
@@ -386,3 +386,6 @@
 web.staff.patron.ue.session_no_defined=User session is not defined
 web.staff.patron.ue.uedit_show_search.search_would_be=Search would be:\n%1$s
 web.staff.patron.ue.uedit_show_addr_replacement=<div>Replaces address <b>%1$s</b><br/> %2$s %3$s<br/> %4$s, %5$s %6$s</div>
+
+# 1 - Staff Username  2 - Patron Family  3 - Patron Barcode
+staff.circ.work_log_patron_edit.message=%1$s edited %3$s (%2$s)

Modified: trunk/Open-ILS/xul/staff_client/server/patron/display.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/display.js	2010-04-07 15:09:50 UTC (rev 16156)
+++ trunk/Open-ILS/xul/staff_client/server/patron/display.js	2010-04-07 18:15:52 UTC (rev 16157)
@@ -244,7 +244,11 @@
                                                 'url_prefix' : xulG.url_prefix,
                                                 'new_tab' : xulG.new_tab,
                                                 'new_patron_tab' : xulG.new_patron_tab,
-                                                'params' : p
+                                                'params' : p,
+                                                'on_save' : function(p_obj) {
+                                                    JSAN.use('patron.util');
+                                                    patron.util.work_log_patron_edit(p_obj);
+                                                }
                                             }
                                         }
                                     );
@@ -267,6 +271,8 @@
                                         },
                                         'on_save' : function(p) {
                                             try {
+                                                JSAN.use('patron.util'); 
+                                                patron.util.work_log_patron_edit(p);
                                                 if (obj.barcode) obj.barcode = p.card().barcode();
                                                 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                                                 //obj.summary_window.g.summary.retrieve();

Modified: trunk/Open-ILS/xul/staff_client/server/patron/info_group.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/info_group.js	2010-04-07 15:09:50 UTC (rev 16156)
+++ trunk/Open-ILS/xul/staff_client/server/patron/info_group.js	2010-04-07 18:15:52 UTC (rev 16157)
@@ -327,7 +327,7 @@
                         'clone' : g.sel_list[i],
                         'spawn_search' : spawn_search,
                         'spawn_editor' : spawn_editor,
-                        'on_save' : function() { refresh(); },
+                        'on_save' : function(p) { patron.util.work_log_patron_edit(p); refresh(); },
                         'url_prefix' : xulG.url_prefix,
                         'new_tab' : xulG.new_tab,
                     },
@@ -346,7 +346,7 @@
     var passthru = {
         'spawn_search' : spawn_search,
         'spawn_editor' : spawn_editor,
-        'on_save' : function() { refresh(); },
+        'on_save' : function(p) { patron.util.work_log_patron_edit(p); refresh(); },
         'url_prefix' : xulG.url_prefix,
         'new_tab' : xulG.new_tab,
     };

Modified: trunk/Open-ILS/xul/staff_client/server/patron/staged.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/staged.js	2010-04-07 15:09:50 UTC (rev 16156)
+++ trunk/Open-ILS/xul/staff_client/server/patron/staged.js	2010-04-07 18:15:52 UTC (rev 16157)
@@ -159,7 +159,7 @@
                 'url_prefix' : xulG.url_prefix,
                 'new_tab' : xulG.new_tab,
                 'new_patron_tab' : xulG.new_patron_tab,
-                'on_save' : function() { if (typeof func == 'function') { func(); } },
+                'on_save' : function(p) { patron.util.work_log_patron_edit(p); if (typeof func == 'function') { func(p); } },
                 'params' : p
             }
         }

Modified: trunk/Open-ILS/xul/staff_client/server/patron/util.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/util.js	2010-04-07 15:09:50 UTC (rev 16156)
+++ trunk/Open-ILS/xul/staff_client/server/patron/util.js	2010-04-07 18:15:52 UTC (rev 16157)
@@ -6,7 +6,7 @@
 patron.util.EXPORT_OK    = [ 
     'columns', 'mbts_columns', 'mb_columns', 'mp_columns', /*'std_map_row_to_column',*/ 'std_map_row_to_columns',
     'retrieve_au_via_id', 'retrieve_fleshed_au_via_id', 'retrieve_fleshed_au_via_barcode', 'set_penalty_css', 'retrieve_name_via_id',
-    'merge', 'ausp_columns', 'format_name'
+    'merge', 'ausp_columns', 'format_name', 'work_log_patron_edit'
 ];
 patron.util.EXPORT_TAGS    = { ':all' : patron.util.EXPORT_OK };
 
@@ -820,4 +820,29 @@
     return patron_name;
 }
 
+patron.util.work_log_patron_edit = function(p) {
+    var error;
+    try {
+        netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserWrite');
+        JSAN.use('util.error'); error = new util.error();
+        error.work_log(
+            document.getElementById('patronStrings').getFormattedString(
+                'staff.circ.work_log_patron_edit.message',
+                [
+                    ses('staff_usrname'),
+                    p.family_name(),
+                    p.card().barcode()
+                ]
+            ), {
+                'au_id' : p.id(),
+                'au_family_name' : p.family_name(),
+                'au_barcode' : p.card().barcode()
+            }
+        );
+    } catch(E) {
+        error.sdump('D_ERROR','Error with work_logging in menu.js, cmd_patron_register:' + E);
+    }
+}
+
+
 dump('exiting patron/util.js\n');



More information about the open-ils-commits mailing list