From 3cc482777b4dd794b0a8bd5f5ba4120aadfffae0 Mon Sep 17 00:00:00 2001 From: phasefx Date: Wed, 23 Sep 2009 14:59:02 +0000 Subject: [PATCH] print patron and staff hold notes in hold and hold/transit slips where hold note slip==true git-svn-id: svn://svn.open-ils.org/ILS/trunk@14116 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../staff_client/chrome/content/OpenILS/data.js | 12 ++--- Open-ILS/xul/staff_client/server/circ/util.js | 53 +++++++++++++++++++++- .../server/locale/en-US/circ.properties | 2 + 3 files changed, 59 insertions(+), 8 deletions(-) diff --git a/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js b/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js index 00334f1445..3c79bedab3 100644 --- a/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js +++ b/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js @@ -349,9 +349,9 @@ OpenILS.data.prototype = { }, 'hold_slip' : { 'type' : 'holds', - 'header' : 'This item needs to be routed to %route_to%:
\r\n', - 'line_item' : 'Barcode: %item_barcode%
\r\nTitle: %item_title%
\r\n
\r\n%hold_for_msg%
\r\nBarcode: %PATRON_BARCODE%
\r\nNotify by phone: %notify_by_phone%
\r\nNotify by email: %notify_by_email%
\r\n
\r\nRequest date:
\r\n', - 'footer' : 'Slip Date: %TODAY_TRIM%
\r\nPrinted by %STAFF_FIRSTNAME% at %SHORTNAME%
\r\n
\r\n' + 'header' : 'This item needs to be routed to %route_to%:
\r\nBarcode: %item_barcode%
\r\nTitle: %item_title%
\r\n
\r\n%hold_for_msg%
\r\nBarcode: %PATRON_BARCODE%
\r\nNotify by phone: %notify_by_phone%
\r\nNotify by email: %notify_by_email%
\r\n', + 'line_item' : '%formatted_note%
\r\n', + 'footer' : '
\r\nRequest date: %request_date%
\r\nSlip Date: %TODAY_TRIM%
\r\nPrinted by %STAFF_FIRSTNAME% at %SHORTNAME%
\r\n
\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 %route_to%:
\r\n%route_to_org_fullname%
\r\n%street1%
\r\n%street2%
\r\n%city_state_zip%
\r\n
\r\n', - 'line_item' : 'Barcode: %item_barcode%
\r\nTitle: %item_title%
\r\nAuthor: %item_author%
\r\n
\r\n%hold_for_msg%
\r\nBarcode: %PATRON_BARCODE%
\r\nNotify by phone: %notify_by_phone%
\r\nNotify by email: %notify_by_email%
\r\n
\r\nRequest date:
\r\n', - 'footer' : 'Slip Date: %TODAY_TRIM%
\r\nPrinted by %STAFF_FIRSTNAME% at %SHORTNAME%
\r\n
\r\n' + 'header' : 'This item needs to be routed to %route_to%:
\r\n%route_to_org_fullname%
\r\n%street1%
\r\n%street2%
\r\n%city_state_zip%
\r\n
\r\nBarcode: %item_barcode%
\r\nTitle: %item_title%
\r\nAuthor: %item_author%
\r\n
\r\n%hold_for_msg%
\r\nBarcode: %PATRON_BARCODE%
\r\nNotify by phone: %notify_by_phone%
\r\nNotify by email: %notify_by_email%
\r\n', + 'line_item' : '%formatted_note%
\r\n', + 'footer' : '
\r\nRequest date: %request_date%
\r\nSlip Date: %TODAY_TRIM%
\r\nPrinted by %STAFF_FIRSTNAME% at %SHORTNAME%
\r\n
\r\n' } }; diff --git a/Open-ILS/xul/staff_client/server/circ/util.js b/Open-ILS/xul/staff_client/server/circ/util.js index f05a37d1fc..5a65b52670 100644 --- a/Open-ILS/xul/staff_client/server/circ/util.js +++ b/Open-ILS/xul/staff_client/server/circ/util.js @@ -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 ); diff --git a/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties b/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties index 88a91e13fc..c81be643ac 100644 --- a/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties +++ b/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties @@ -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 -- 2.11.0