[open-ils-commits] r14116 - in trunk/Open-ILS/xul/staff_client: chrome/content/OpenILS server/circ server/locale/en-US (phasefx)

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Sep 23 10:59:05 EDT 2009


Author: phasefx
Date: 2009-09-23 10:59:02 -0400 (Wed, 23 Sep 2009)
New Revision: 14116

Modified:
   trunk/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js
   trunk/Open-ILS/xul/staff_client/server/circ/util.js
   trunk/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties
Log:
print patron and staff hold notes in hold and hold/transit slips where hold note slip==true

Modified: trunk/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js	2009-09-23 14:58:25 UTC (rev 14115)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js	2009-09-23 14:59:02 UTC (rev 14116)
@@ -349,9 +349,9 @@
 				},
                 '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 @@
                 },
                 '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'
                 }
 			}; 
 

Modified: trunk/Open-ILS/xul/staff_client/server/circ/util.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/circ/util.js	2009-09-23 14:58:25 UTC (rev 14115)
+++ trunk/Open-ILS/xul/staff_client/server/circ/util.js	2009-09-23 14:59:02 UTC (rev 14116)
@@ -2157,6 +2157,7 @@
 		}
 
 		var msg = '';
+        var print_list = [];
         var print_data = { 
             'error' : '',
             'error_msg' : '',
@@ -2320,6 +2321,30 @@
 							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 @@
                                     '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 @@
 					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 @@
                             '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 );

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	2009-09-23 14:58:25 UTC (rev 14115)
+++ trunk/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties	2009-09-23 14:59:02 UTC (rev 14116)
@@ -307,6 +307,8 @@
 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



More information about the open-ils-commits mailing list