Work Log entry for holds placed within patron display
authorJason Etheridge <jason@esilibrary.com>
Fri, 20 Apr 2012 01:02:12 +0000 (21:02 -0400)
committerBill Erickson <berick@esilibrary.com>
Thu, 31 May 2012 15:13:06 +0000 (11:13 -0400)
Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/templates/opac/parts/place_hold_result.tt2
Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties
Open-ILS/xul/staff_client/server/patron/holds.js

index 6504906..b933d6a 100644 (file)
 
                         <div class='success'>[% l("Hold was successfully placed"); %]</div>
 
+                        [% IF ctx.is_staff %]
+                            <script>
+                                window.addEventListener(
+                                    'load',
+                                    function() {
+                                        try {
+                                            if (typeof xulG != 'undefined' && xulG.opac_hold_placed) {
+                                                xulG.opac_hold_placed([% hdata.hold_success %]);
+                                            }
+                                        } catch(E) {
+                                            alert('Error updating Work Log with hold placement: ' + E);
+                                        }
+                                    },
+                                    false
+                                );
+                            </script>
+                        [% END %]
+
                         [% ELSIF hdata.hold_failed; any_failures = 1 %]
 
                             <div><big><strong>[% l("Hold was not successfully placed"); %]</strong></big></div>
index 23cd01a..5a5b0c4 100644 (file)
@@ -120,6 +120,8 @@ 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)
+# 1 - Staff Username  2 - Patron Family  3 - Patron Barcode  4 - Hold ID  5 - Hold Type
+staff.circ.work_log_hold_placed.message=%1$s placed hold %4$s (%5$s) for %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
index cad4e88..a17e247 100644 (file)
@@ -1482,11 +1482,12 @@ patron.holds.prototype = {
                                         },
                                         'opac_hold_placed' : function(hold) {
                                             try {
+                                                var hold_id = typeof hold == 'object' ? hold.id() : hold;
                                                 obj.list.append(
                                                     {
                                                         'row' : {
                                                             'my' : {
-                                                                'hold_id' : typeof hold == 'object' ? hold.id() : hold
+                                                                'hold_id' : hold_id
                                                             }
                                                         }
                                                     }
@@ -1494,6 +1495,30 @@ patron.holds.prototype = {
                                                 if (window.xulG && typeof window.xulG.on_list_change == 'function') {
                                                     window.xulG.on_list_change(); 
                                                 }
+                                                obj.list.wrap_in_full_retrieve(
+                                                    function() {
+                                                        try {
+                                                            obj.error.work_log(
+                                                                $('offlineStrings').getFormattedString(
+                                                                    'staff.circ.work_log_hold_placed.message',
+                                                                    [
+                                                                        ses('staff_usrname'),
+                                                                        obj.holds_map[ hold_id ].patron_last,
+                                                                        obj.holds_map[ hold_id ].patron_barcode,
+                                                                        hold_id,
+                                                                        obj.holds_map[ hold_id ].hold.hold_type()
+                                                                    ]
+                                                                ), {
+                                                                    'au_id' : obj.holds_map[ hold_id ].hold.usr(),
+                                                                    'au_family_name' : obj.holds_map[ hold_id ].patron_family_name,
+                                                                    'au_barcode' : obj.holds_map[ hold_id ].patron_barcode
+                                                                }
+                                                            );
+                                                        } catch(F) {
+                                                            obj.error.standard_unexpected_error_alert('holds.js, opac_hold_placed(), work_log: ',F);
+                                                        }
+                                                    }
+                                                );
                                             } catch(E) {
                                                 obj.error.standard_unexpected_error_alert('holds.js, opac_hold_placed(): ',E);
                                             }