From 804d7ff61e82cf7d600070d3ba97db12c9b7d21f Mon Sep 17 00:00:00 2001 From: phasefx Date: Tue, 22 Sep 2009 03:11:24 +0000 Subject: [PATCH] Org unit setting (not wired into Settings Editor), circ.staff_client.do_not_auto_attempt_print: Disable automatic print attempts from staff client interfaces for the receipt types in this list. Possible values: "Checkout", "Bill Pay", "Hold Slip", "Transit Slip", and/or "Hold/Transit Slip". This is different from the Auto-Print checkbox in the pertinent interfaces in that it disables automatic print attempts altogether, rather than encouraging silent printing by suppressing the print dialog. The Auto-Print checkbox in these interfaces have no effect on the behavior for this setting. In the case of the Hold, Transit, and Hold/Transit slips, this also suppresses the alert dialogs that precede the print dialog (the ones that offer Print and Do Not Print as options). git-svn-id: svn://svn.open-ils.org/ILS/trunk@14079 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 5 +++++ Open-ILS/xul/staff_client/server/circ/checkout.js | 8 ++++++++ Open-ILS/xul/staff_client/server/circ/util.js | 12 ++++++++++++ Open-ILS/xul/staff_client/server/patron/bills.js | 4 ++++ 4 files changed, 29 insertions(+) diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql index 8b4dd5506..5a8877c43 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -1812,6 +1812,11 @@ INSERT into config.org_unit_setting_type 'List of checkout/renewal events that the selfcheck interface should automatically override instead instead of alerting and stopping the transaction', 'array' ), +( 'circ.staff_client.do_not_auto_attempt_print', + 'Disable Automatic Print Attempt Type List', + 'Disable automatic print attempts from staff client interfaces for the receipt types in this list. Possible values: "Checkout", "Bill Pay", "Hold Slip", "Transit Slip", and "Hold/Transit Slip". This is different from the Auto-Print checkbox in the pertinent interfaces in that it disables automatic print attempts altogether, rather than encouraging silent printing by suppressing the print dialog. The Auto-Print checkbox in these interfaces have no effect on the behavior for this setting. In the case of the Hold, Transit, and Hold/Transit slips, this also suppresses the alert dialogs that precede the print dialog (the ones that offer Print and Do Not Print as options).', + 'array' ), + ( 'ui.patron.default_inet_access_level', 'Default level of patrons'' internet access', null, diff --git a/Open-ILS/xul/staff_client/server/circ/checkout.js b/Open-ILS/xul/staff_client/server/circ/checkout.js index fb962e455..1b151946c 100644 --- a/Open-ILS/xul/staff_client/server/circ/checkout.js +++ b/Open-ILS/xul/staff_client/server/circ/checkout.js @@ -231,6 +231,14 @@ circ.checkout.prototype = { ['command'], function() { try { + var no_print_prompting = obj.data.hash.aous['circ.staff_client.do_not_auto_attempt_print']; + if (no_print_prompting) { + if (no_print_prompting.indexOf( "Checkout" ) > -1) { + obj.list.clear(); + xulG.set_tab(urls.XUL_PATRON_BARCODE_ENTRY,{},{}); + return; + } + } if (document.getElementById('checkout_auto').checked) { obj.print(true,function() { obj.list.clear(); diff --git a/Open-ILS/xul/staff_client/server/circ/util.js b/Open-ILS/xul/staff_client/server/circ/util.js index b812be44a..df8e2d51d 100644 --- a/Open-ILS/xul/staff_client/server/circ/util.js +++ b/Open-ILS/xul/staff_client/server/circ/util.js @@ -2312,6 +2312,12 @@ circ.util.checkin_via_barcode2 = function(session,params,backdate,auto_print,che msg += '\n'; } var rv = 0; + var no_print_prompting = data.hash.aous['circ.staff_client.do_not_auto_attempt_print']; + if (no_print_prompting) { + if (no_print_prompting.indexOf( "Hold Slip" ) > -1) { + rv = -1; auto_print = true; // DO NOT PRINT and skip dialog + } + } print_data.slip_date = util.date.formatted_date(new Date(),'%F'); print_data.slip_date_msg = document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.hold.slip_date', [print_data.slip_date]); msg += print_data.slip_date_msg; @@ -2510,6 +2516,12 @@ circ.util.checkin_via_barcode2 = function(session,params,backdate,auto_print,che msg += '\n'; } var rv = 0; + var no_print_prompting = data.hash.aous['circ.staff_client.do_not_auto_attempt_print']; + if (no_print_prompting) { + if (no_print_prompting.indexOf( check.payload.hold ? "Hold/Transit Slip" : "Transit Slip" ) > -1) { + rv = -1; auto_print = true; // DO NOT PRINT and skip dialog + } + } print_data.slip_date = util.date.formatted_date(new Date(),'%F'); print_data.slip_date_msg = document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.hold.slip_date', [print_data.slip_date]); msg += print_data.slip_date_msg; diff --git a/Open-ILS/xul/staff_client/server/patron/bills.js b/Open-ILS/xul/staff_client/server/patron/bills.js index e639f0356..bfae49bc1 100644 --- a/Open-ILS/xul/staff_client/server/patron/bills.js +++ b/Open-ILS/xul/staff_client/server/patron/bills.js @@ -517,6 +517,10 @@ patron.bills.prototype = { obj.data.voided_billings = []; obj.data.stash('voided_billings'); obj.refresh(); try { + var no_print_prompting = obj.data.hash.aous['circ.staff_client.do_not_auto_attempt_print']; + if (no_print_prompting) { + if (no_print_prompting.indexOf( "Bill Pay" ) > -1) return; // Skip print attempt + } netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); obj.data.stash_retrieve(); var template = 'bill_payment'; -- 2.11.0