print patron and staff hold notes in hold and hold/transit slips where hold note...
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 23 Sep 2009 14:59:02 +0000 (14:59 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 23 Sep 2009 14:59:02 +0000 (14:59 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@14116 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js
Open-ILS/xul/staff_client/server/circ/util.js
Open-ILS/xul/staff_client/server/locale/en-US/circ.properties

index 00334f1..3c79bed 100644 (file)
@@ -349,9 +349,9 @@ OpenILS.data.prototype = {
                                },
                 'hold_slip' : {
                                        'type' : 'holds',
-                                       'header' : 'This item needs to be routed to <b>%route_to%</b>:<br/>\r\n',
-                    'line_item' : 'Barcode: %item_barcode%<br/>\r\nTitle: %item_title%<br/>\r\n<br/>\r\n%hold_for_msg%<br/>\r\nBarcode: %PATRON_BARCODE%<br/>\r\nNotify by phone: %notify_by_phone%<br/>\r\nNotify by email: %notify_by_email%<br/>\r\n<br/>\r\nRequest date: <br/>\r\n',
-                    'footer' : 'Slip Date: %TODAY_TRIM%<br/>\r\nPrinted by %STAFF_FIRSTNAME% at %SHORTNAME%<br/>\r\n<br/>\r\n'
+                                       'header' : 'This item needs to be routed to <b>%route_to%</b>:<br/>\r\nBarcode: %item_barcode%<br/>\r\nTitle: %item_title%<br/>\r\n<br/>\r\n%hold_for_msg%<br/>\r\nBarcode: %PATRON_BARCODE%<br/>\r\nNotify by phone: %notify_by_phone%<br/>\r\nNotify by email: %notify_by_email%<br/>\r\n',
+                    'line_item' : '%formatted_note%<br/>\r\n',
+                    'footer' : '<br/>\r\nRequest date: %request_date%<br/>\r\nSlip Date: %TODAY_TRIM%<br/>\r\nPrinted by %STAFF_FIRSTNAME% at %SHORTNAME%<br/>\r\n<br/>\r\n'
                 },
                 'transit_slip' : {
                                        'type' : 'transits',
@@ -361,9 +361,9 @@ OpenILS.data.prototype = {
                 },
                 'hold_transit_slip' : {
                                        'type' : 'transits',
-                                       'header' : 'This item needs to be routed to <b>%route_to%</b>:<br/>\r\n%route_to_org_fullname%<br/>\r\n%street1%<br/>\r\n%street2%<br/>\r\n%city_state_zip%<br/>\r\n<br/>\r\n',
-                    'line_item' : 'Barcode: %item_barcode%<br/>\r\nTitle: %item_title%<br/>\r\nAuthor: %item_author%<br>\r\n<br/>\r\n%hold_for_msg%<br/>\r\nBarcode: %PATRON_BARCODE%<br/>\r\nNotify by phone: %notify_by_phone%<br/>\r\nNotify by email: %notify_by_email%<br/>\r\n<br/>\r\nRequest date: <br/>\r\n',
-                    'footer' : 'Slip Date: %TODAY_TRIM%<br/>\r\nPrinted by %STAFF_FIRSTNAME% at %SHORTNAME%<br/>\r\n<br/>\r\n'
+                                       'header' : 'This item needs to be routed to <b>%route_to%</b>:<br/>\r\n%route_to_org_fullname%<br/>\r\n%street1%<br/>\r\n%street2%<br/>\r\n%city_state_zip%<br/>\r\n<br/>\r\nBarcode: %item_barcode%<br/>\r\nTitle: %item_title%<br/>\r\nAuthor: %item_author%<br>\r\n<br/>\r\n%hold_for_msg%<br/>\r\nBarcode: %PATRON_BARCODE%<br/>\r\nNotify by phone: %notify_by_phone%<br/>\r\nNotify by email: %notify_by_email%<br/>\r\n',
+                    'line_item' : '%formatted_note%<br/>\r\n',
+                    'footer' : '<br/>\r\nRequest date: %request_date%<br/>\r\nSlip Date: %TODAY_TRIM%<br/>\r\nPrinted by %STAFF_FIRSTNAME% at %SHORTNAME%<br/>\r\n<br/>\r\n'
                 }
                        }; 
 
index f05a37d..5a65b52 100644 (file)
@@ -2157,6 +2157,7 @@ circ.util.checkin_via_barcode2 = function(session,params,backdate,auto_print,che
                }
 
                var msg = '';
+        var print_list = [];
         var print_data = { 
             'error' : '',
             'error_msg' : '',
@@ -2320,6 +2321,30 @@ circ.util.checkin_via_barcode2 = function(session,params,backdate,auto_print,che
                                                        msg += '\n';
                                                }
                                                msg += '\n';
+                        var notes = check.payload.hold.notes();
+                        print_data.notes_raw = notes;
+                        for (var i = 0; i < notes.length; i++) {
+                            if ( get_bool( notes[i].slip() ) ) {
+                                var temp_msg;
+                                if ( get_bool( notes[i].staff() ) ) {
+                                    temp_msg = document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.hold.notes.staff_note', [ notes[i].title(), notes[i].body() ]);
+                                } else {
+                                    temp_msg = document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.hold.notes.patron_note', [ notes[i].title(), notes[i].body() ]);
+                                }
+                                msg += temp_msg + '\n';
+                                print_list.push(
+                                    {
+                                        'formatted_note' : temp_msg,
+                                        'note_title' : notes[i].title(),
+                                        'note_body' : notes[i].body(),
+                                        'note_public' : notes[i].pub(),
+                                        'note_by_staff' : notes[i].staff()
+                                    }
+                                );
+                            }
+                        }
+                                               msg += '\n';
+                                               msg += '\n';
                         print_data.request_date = util.date.formatted_date(check.payload.hold.request_time(),'%F');
                                                print_data.request_date_msg = document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.hold.request_date', [print_data.request_date]);
                         msg += print_data.request_date_msg;
@@ -2366,7 +2391,7 @@ circ.util.checkin_via_barcode2 = function(session,params,backdate,auto_print,che
                                     'line_item' : data.print_list_templates[ template ].line_item,
                                     'footer' : data.print_list_templates[ template ].footer,
                                     'type' : data.print_list_templates[ template ].type,
-                                    'list' : [ {} ],
+                                    'list' : print_list,
                                     'data' : print_data
                                 };
                                 print.tree_list( params );
@@ -2524,6 +2549,30 @@ circ.util.checkin_via_barcode2 = function(session,params,backdate,auto_print,che
                                        msg += '\n';
                                }
                                msg += '\n';
+                var notes = check.payload.hold.notes();
+                print_data.notes_raw = notes;
+                for (var i = 0; i < notes.length; i++) {
+                    if ( get_bool( notes[i].slip() ) ) {
+                        var temp_msg;
+                        if ( get_bool( notes[i].staff() ) ) {
+                            temp_msg = document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.hold.notes.staff_note', [ notes[i].title(), notes[i].body() ]);
+                        } else {
+                            temp_msg = document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.hold.notes.patron_note', [ notes[i].title(), notes[i].body() ]);
+                        }
+                        msg += temp_msg + '\n';
+                        print_list.push(
+                            {
+                                'formatted_note' : temp_msg,
+                                'note_title' : notes[i].title(),
+                                'note_body' : notes[i].body(),
+                                'note_public' : notes[i].pub(),
+                                'note_by_staff' : notes[i].staff()
+                            }
+                        );
+                    }
+                }
+                msg += '\n';
+                msg += '\n';
                 print_data.request_date = util.date.formatted_date(check.payload.hold.request_time(),'%F');
                 print_data.request_date_msg = document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.hold.request_date', [print_data.request_date]);
                 msg += print_data.request_date_msg;
@@ -2569,7 +2618,7 @@ circ.util.checkin_via_barcode2 = function(session,params,backdate,auto_print,che
                             'line_item' : data.print_list_templates[ template ].line_item,
                             'footer' : data.print_list_templates[ template ].footer,
                             'type' : data.print_list_templates[ template ].type,
-                            'list' : [ {} ],
+                            'list' : print_list,
                             'data' : print_data 
                         };
                         print.tree_list( params );
index 88a91e1..c81be64 100644 (file)
@@ -307,6 +307,8 @@ staff.circ.utils.payload.hold.phone_notify=Notify by phone: %1$s
 staff.circ.utils.payload.hold.email_notify=Notify by email: %1$s
 staff.circ.utils.payload.hold.request_date=Request Date: %1$s
 staff.circ.utils.payload.hold.slip_date=Slip Date: %1$s
+staff.circ.utils.payload.hold.notes.staff_note=Staff Note: %1$s : %2$s
+staff.circ.utils.payload.hold.notes.patron_note=Patron Note: %1$s : %2$s
 staff.circ.utils.hold_slip=Hold Slip
 staff.circ.utils.hold_slip.print.yes=Print
 staff.circ.utils.hold_slip.print.no=Do Not Print