From 631f6dae8d268874449dd58e7d6ad3e920de1397 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 3 Dec 2015 14:56:30 +0000 Subject: [PATCH] Bug 8352 [QA Followup] --- installer/data/mysql/atomicupdate/bug_8352.sql | 6 +++--- .../data/mysql/en/mandatory/sample_notices.sql | 5 ++--- .../prog/en/includes/printers-toolbar.inc | 4 ++-- .../intranet-tmpl/prog/en/modules/admin/printers.tt | 4 ++-- .../prog/en/modules/help/admin/printers.tt | 6 +++--- misc/cronjobs/holds/print_holds.pl | 21 ++++++++++++++++----- svc/printer | 1 - 7 files changed, 28 insertions(+), 19 deletions(-) diff --git a/installer/data/mysql/atomicupdate/bug_8352.sql b/installer/data/mysql/atomicupdate/bug_8352.sql index 4577e1e..5151094 100644 --- a/installer/data/mysql/atomicupdate/bug_8352.sql +++ b/installer/data/mysql/atomicupdate/bug_8352.sql @@ -1,11 +1,11 @@ ALTER TABLE reserves ADD printed DATETIME NULL AFTER suspend_until; -INSERT INTO letter ( module, code, branchcode, name, is_html, title, content ) VALUES ( - 'reserves', 'HOLD_PLACED_PRINT', '', 'Hold Placed ( Auto-Print )', '0', 'Hold Placed ( Auto-Print )', 'Hold to pull at <> +INSERT INTO letter ( module, code, branchcode, name, is_html, title, content, message_transport_type ) VALUES ( + 'reserves', 'HOLDPLACED', '', 'Hold Placed ( Auto-Print )', '0', 'Hold Placed ( Auto-Print )', 'Hold to pull at <> For <> <> ( <> ) -<> by <>'); +<> by <>', 'print'); ALTER TABLE printers DROP PRIMARY KEY, diff --git a/installer/data/mysql/en/mandatory/sample_notices.sql b/installer/data/mysql/en/mandatory/sample_notices.sql index 11d87bf..c9f44ca 100644 --- a/installer/data/mysql/en/mandatory/sample_notices.sql +++ b/installer/data/mysql/en/mandatory/sample_notices.sql @@ -167,6 +167,5 @@ INSERT INTO `letter` (module, code, branchcode, name, is_html, title, content, m VALUES ('members','PASSWORD_RESET','','Online password reset',1,'Koha password recovery','\r\n

This email has been sent in response to your password recovery request for the account <>.\r\n

\r\n

\r\nYou can now create your new password using the following link:\r\n
>\"><>\r\n

\r\n

This link will be valid for 2 days from this email\'s reception, then you must reapply if you do not change your password.

\r\n

Thank you.

\r\n\r\n','email' ); -INSERT INTO `letter` (`module`,`code`,`branchcode`,`name`,`is_html`,`title`,`content`) -VALUES ('reserves', 'HOLD_PLACED_PRINT', 'Hold Placed ( Auto-Print )', 'Hold Placed ( Auto-Print )', 'Hold to pull at <>\r\nFor <> <> ( <> )\r\n<> by <>'); - +INSERT INTO letter ( module, code, branchcode, name, is_html, title, content, message_transport_type ) +VALUES ('reserves', 'HOLDPLACED', 'Hold Placed ( Auto-Print )', 'Hold Placed ( Auto-Print )', 'Hold to pull at <>\r\nFor <> <> ( <> )\r\n<> by <>', 'print'); diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/printers-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/printers-toolbar.inc index 416de09..6a07794 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/printers-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/printers-toolbar.inc @@ -1,4 +1,4 @@ diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/printers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/printers.tt index 57926b5..aa2cc0c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/printers.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/printers.tt @@ -1,5 +1,5 @@ [% INCLUDE 'doc-head-open.inc' %] -Koha › Administration › Printer editor +Koha › Administration › Printers [% INCLUDE 'doc-head-close.inc' %] [% INCLUDE 'datatables.inc' %] @@ -147,7 +147,7 @@ $(document).ready(function() { if (!idsToDelete) { alert(_("No printers selected!")); } - else if (confirm(_("Are you sure you wish to delete printer(s) ") + idsToDelete + "?")) { + else if (confirm(_("Are you sure you wish to delete printer(s) %s?").format(idsToDelete))) { oTable.$('.selected').each(function(){ var printerID = $(this).attr('id'); $.ajax({ diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/printers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/printers.tt index 36abeed..29e14dca 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/printers.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/printers.tt @@ -8,7 +8,7 @@

Click on any field to edit the contents; Press the <Enter> key to save edit.

Click on one or more printer IDs to select entire printers for deletion; Click the 'Delete printer(s)' button to delete selected printers.

-

Printers defined in this area can be used to print automatic reserve notices

+

Printers defined in this area can be used to print automatic hold notices

How printers are defined

Printers can be utilized in two ways, either by sending the data directly to a networked printer via lpr, or by printing to a printer set up on the Koha server via CUPS.

@@ -25,10 +25,10 @@

Caveats

- Printing plain text is supported by both methods. When printing HTML, the output will be sent to the printer as PostScript. If you are printing via LPR, and you want to print HTML, you will need to ensure that your printer can recieve and print PostScript data. + Printing plain text is supported by both methods. When printing HTML, the output will be sent to the printer as PostScript. If you are printing via LPR, and you want to print HTML, you will need to ensure that your printer can receive and print PostScript data.

- For printing slips and notices, this behavior can be controlled via the "HTML message" flag of the HOLD_PLACED_PRINT notice. Leaving this checkbox unchecked will result in plain text being printed, whereas checking this checkbox will result in HTML converted to PostScript being printed. + For printing slips and notices, this behavior can be controlled via the "HTML message" flag of the HOLDPLACED print notice. Leaving this checkbox unchecked will result in plain text being printed, whereas checking this checkbox will result in HTML converted to PostScript being printed.

[% INCLUDE 'help-bottom.inc' %] diff --git a/misc/cronjobs/holds/print_holds.pl b/misc/cronjobs/holds/print_holds.pl index e9cc3ea..a2e0de5 100755 --- a/misc/cronjobs/holds/print_holds.pl +++ b/misc/cronjobs/holds/print_holds.pl @@ -72,10 +72,11 @@ while ( my $hold = $holds->next() ) { my $borrower = Koha::Borrowers->find( $hold->borrowernumber ); my $letter = GetPreparedLetter( - module => 'reserves', - letter_code => 'HOLD_PLACED_PRINT', - branchcode => $hold->branchcode, - tables => { + module => 'reserves', + letter_code => 'HOLDPLACED', + branchcode => $hold->branchcode, + message_transport_type => 'print', + tables => { branches => $hold->branchcode, biblio => $hold->biblionumber, biblioitems => $hold->biblionumber, @@ -83,7 +84,7 @@ while ( my $hold = $holds->next() ) { borrowers => $borrower->unblessed, reserves => $hold->unblessed, - } + }, ); if ( defined( $printers{ $hold->branchcode } ) ) { @@ -143,6 +144,16 @@ e.g. print_holds.pl --printer MPL:1 --printer CPL:2 would add printers for branchcodes MPL and CPL. If a printer is not defined for a given branch, notices for that branch will not be printed. +=item B<--test> + +Run in test mode. Holds will not actually be printed. + +=item B<--confirm> + +Run in production mode. Holds will be printed to printers. + +=back + =head1 DESCRIPTION B will print on-demand notices for items in the holds queue as they appear. diff --git a/svc/printer b/svc/printer index 04cd775..ba78af3 100755 --- a/svc/printer +++ b/svc/printer @@ -1,7 +1,6 @@ #!/usr/bin/perl # Copyright 2014 ByWater Solutions -# Copyright 2012 Foundations Bible College Inc. # # This file is part of Koha. # -- 2.7.0