From af5ad339f71d80a48baad81d8038e58b1043d731 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Mon, 22 Feb 2010 10:21:31 -0500 Subject: [PATCH 1/6] Bug 3482 Print Notices via HTML Modified overdue_notices.pl to support output of html for printing. The -html option will e-mail notices to those with e-mail, and output html to print for borrowers without e-mail. When system preference PrintNoticesMaxLines is set to a positive integer, it will limit the number of items on the notice to that number, and append a message to the end telling the borrower to check his or her account for the full listing of items. This only affects print notices, not emailed ones. Mandatory SQL: INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) i VALUES ( 'PrintNoticesMaxLines', '0', '', i 'If greater than 0, sets the maximum number of lines an overdue notice will print. If the number of items is greater than this number, the notice will end with a warning asking the borrower to check their online account for a full list of overdue items.', 'Integer' ); Conflicts: installer/data/mysql/en/mandatory/sysprefs.sql installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql misc/cronjobs/overdue_notices.pl --- .../data/mysql/en/mandatory/sysprefs.sql | 1 + .../unimarc_standard_systemprefs.sql | 1 + misc/cronjobs/overdue_notices.pl | 66 +++++++++++++++++-- 3 files changed, 63 insertions(+), 5 deletions(-) diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql b/installer/data/mysql/en/mandatory/sysprefs.sql index 7cbbe9b38f..39a6b004a5 100644 --- a/installer/data/mysql/en/mandatory/sysprefs.sql +++ b/installer/data/mysql/en/mandatory/sysprefs.sql @@ -283,3 +283,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('A INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AutoSelfCheckID','','Staff ID with circulation rights to be used for automatic web-based self-check. Only applies if AutoSelfCheckAllowed syspref is turned on.','','free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AutoSelfCheckPass','','Password to be used for automatic web-based self-check. Only applies if AutoSelfCheckAllowed syspref is turned on.','','free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('soundon','0','Enable circulation sounds during checkin and checkout in the staff interface. Not supported by all web browsers yet.','','YesNo'); +INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'PrintNoticesMaxLines', '0', '', 'If greater than 0, sets the maximum number of lines an overdue notice will print. If the number of items is greater than this number, the notice will end with a warning asking the borrower to check their online account for a full list of overdue items.', 'Integer' ); diff --git a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql index 2ee92a8bfb..57b808ba5b 100644 --- a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql +++ b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql @@ -286,3 +286,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('A INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AutoSelfCheckID','','Identifiant Bibliothécaire avec droits de circulation qui sera utilisé pour les prêt auto-contré. Ne s''applique que dans les cas de l''activation de la préférence AutoSelfCheckout.','','free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AutoSelfCheckPass','','Mot de passe utilisé pour le prêt autocontrôlé. Ne s''applique que dans le cas de l''activation de la préférence AutoSelfCheckout.','','free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('soundon','0','Activer les événements sonores de circulation pendant le prêt et le retour dans l''intranet. N''est pas encore supporté par tous les navigateurs web.','','YesNo'); +INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'PrintNoticesMaxLines', '0', '', 'If greater than 0, sets the maximum number of lines an overdue notice will print. If the number of items is greater than this number, the notice will end with a warning asking the borrower to check their online account for a full list of overdue items.', 'Integer' ); diff --git a/misc/cronjobs/overdue_notices.pl b/misc/cronjobs/overdue_notices.pl index a2f94a2309..75e8b519a1 100755 --- a/misc/cronjobs/overdue_notices.pl +++ b/misc/cronjobs/overdue_notices.pl @@ -56,6 +56,7 @@ overdue_notices.pl [ -n ] [ -library ] [ -library ...] -max maximum days overdue to deal with -library only deal with overdues from this library (repeatable : several libraries can be given) -csv populate CSV file + -html Output html to file -itemscontent item information in templates -borcat category code that must be included -borcatout category code that must be excluded @@ -246,6 +247,7 @@ my $nomail = 0; my $MAX = 90; my @branchcodes; # Branch(es) passed as parameter my $csvfilename; +my $htmlfilename; my $triggered = 0; my $listall = 0; my $itemscontent = join( ',', qw( issuedate title barcode author biblionumber ) ); @@ -260,6 +262,7 @@ GetOptions( 'max=s' => \$MAX, 'library=s' => \@branchcodes, 'csv:s' => \$csvfilename, # this optional argument gets '' if not supplied. + 'html:s' => \$htmlfilename, # this optional argument gets '' if not supplied. 'itemscontent=s' => \$itemscontent, 'list-all' => \$listall, 't|triggered' => \$triggered, @@ -280,6 +283,8 @@ my $branchcount = scalar(@overduebranches); my $overduebranch_word = scalar @overduebranches > 1 ? 'branches' : 'branch'; my $branchcodes_word = scalar @branchcodes > 1 ? 'branches' : 'branch'; +my $PrintNoticesMaxLines = C4::Context->preference('PrintNoticesMaxLines'); + if ($branchcount) { $verbose and warn "Found $branchcount $overduebranch_word with first message enabled: " . join( ', ', map { "'$_'" } @overduebranches ), "\n"; } else { @@ -314,6 +319,7 @@ my @item_content_fields = split( /,/, $itemscontent ); binmode( STDOUT, ":utf8" ); + our $csv; # the Text::CSV_XS object our $csv_fh; # the filehandle to the CSV file. if ( defined $csvfilename ) { @@ -332,6 +338,27 @@ if ( defined $csvfilename ) { } @branches = @overduebranches unless @branches; +our $html_fh; +if ( defined $htmlfilename ) { + if ( $htmlfilename eq '' ) { + $html_fh = *STDOUT; + } else { + open $html_fh, ">", $htmlfilename or die "unable to open $htmlfilename: $!"; + } + + print $html_fh "\n"; + print $html_fh "\n"; + print $html_fh "\n"; + print $html_fh "\n"; + print $html_fh "\n"; +} + foreach my $branchcode (@branches) { my $branch_details = C4::Branch::GetBranchDetail($branchcode); @@ -426,6 +453,7 @@ END_SQL $verbose and warn "borrower $firstname, $lastname ($borrowernumber) has $itemcount items triggering level $i."; my $letter = C4::Letters::getletter( 'circulation', $overdue_rules->{"letter$i"} ); + unless ($letter) { $verbose and warn "Message '$overdue_rules->{letter$i}' content not found"; @@ -445,7 +473,15 @@ END_SQL my $itemcount = 0; my $titles = ""; my @items = (); + + my $i = 0; + my $exceededPrintNoticesMaxLines = 0; while ( my $item_info = $sth2->fetchrow_hashref() ) { + if ( ( !$email || $nomail ) && $PrintNoticesMaxLines && $i >= $PrintNoticesMaxLines ) { + $exceededPrintNoticesMaxLines = 1; + last; + } + $i++; my @item_info = map { $_ =~ /^date|date$/ ? format_date( $item_info->{$_} ) : $item_info->{$_} || '' } @item_content_fields; $titles .= join("\t", @item_info) . "\n"; $itemcount++; @@ -463,7 +499,11 @@ END_SQL } } ); - + + if ( $exceededPrintNoticesMaxLines ) { + $letter->{'content'} .= "List too long for form; please check your account online for a complete list of your overdue items."; + } + my @misses = grep { /./ } map { /^([^>]*)[>]+/; ( $1 || '' ); } split /\{'content'}; if (@misses) { $verbose and warn "The following terms were not matched and replaced: \n\t" . join "\n\t", @misses; @@ -486,7 +526,7 @@ END_SQL email => $email, itemcount => $itemcount, titles => $titles, - outputformat => defined $csvfilename ? 'csv' : '', + outputformat => defined $csvfilename ? 'csv' : defined $htmlfilename ? 'html' : '', } ); } else { @@ -514,7 +554,7 @@ END_SQL email => $email, itemcount => $itemcount, titles => $titles, - outputformat => defined $csvfilename ? 'csv' : '', + outputformat => defined $csvfilename ? 'csv' : defined $htmlfilename ? 'html' : '', } ); } @@ -528,11 +568,17 @@ END_SQL if ($nomail) { if ( defined $csvfilename ) { print $csv_fh @output_chunks; + } elsif ( defined $htmlfilename ) { + print $html_fh @output_chunks; } else { local $, = "\f"; # pagebreak print @output_chunks; } - } else { + } + elsif ( defined $htmlfilename ) { + print $html_fh @output_chunks; + } + else { my $attachment = { filename => defined $csvfilename ? 'attachment.csv' : 'attachment.txt', type => 'text/plain', @@ -556,12 +602,17 @@ END_SQL } if ($csvfilename) { - # note that we're not testing on $csv_fh to prevent closing # STDOUT. close $csv_fh; } +if ( defined $htmlfilename ) { + print $html_fh "\n"; + print $html_fh "\n"; + close $html_fh; +} + =head1 INTERNAL METHODS These methods are internal to the operation of overdue_notices.pl. @@ -589,6 +640,7 @@ sub parse_letter { # FIXME: this code should probably be moved to C4::Letters:pa return unless exists $params->{$required}; } + if ( $params->{'substitute'} ) { while ( my ( $key, $replacedby ) = each %{ $params->{'substitute'} } ) { my $replacefield = "<<$key>>"; @@ -667,6 +719,10 @@ sub prepare_letter_for_printing { } else { $verbose and warn 'combine failed on argument: ' . $csv->error_input; } + } elsif ( exists $params->{'outputformat'} && $params->{'outputformat'} eq 'html' ) { + $return = "
\n";
+      $return .= "$params->{'letter'}->{'content'}\n";
+      $return .= "\n
\n"; } else { $return .= "$params->{'letter'}->{'content'}\n"; From 68bbe0d5964880c617be622c7d32dad633d515a7 Mon Sep 17 00:00:00 2001 From: "J. David Bavousett" Date: Wed, 14 Oct 2009 08:19:37 -0400 Subject: [PATCH 2/6] Modified to use dirspec only This commit modifies overdue_notices so that the -html parameter only requires a directory specification. --- misc/cronjobs/overdue_notices.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/misc/cronjobs/overdue_notices.pl b/misc/cronjobs/overdue_notices.pl index 75e8b519a1..4b959db187 100755 --- a/misc/cronjobs/overdue_notices.pl +++ b/misc/cronjobs/overdue_notices.pl @@ -343,7 +343,8 @@ if ( defined $htmlfilename ) { if ( $htmlfilename eq '' ) { $html_fh = *STDOUT; } else { - open $html_fh, ">", $htmlfilename or die "unable to open $htmlfilename: $!"; + my $today = C4::Dates->new(); + open $html_fh, ">",File::Spec->catdir ($htmlfilename,"notices-".$today->output('iso').".html"); } print $html_fh "\n"; From b7e35a37256054c2a1d07a4fcd965283aa91968e Mon Sep 17 00:00:00 2001 From: Jesse Weaver Date: Thu, 11 Jun 2009 11:40:01 -0600 Subject: [PATCH 3/6] Add expiration date, today to hold notices This adds the new, virtual placeholders <> and < that can be used in letter templates. --- C4/Letters.pm | 16 ++++++++++++++++ C4/Reserves.pm | 3 +++ 2 files changed, 19 insertions(+) diff --git a/C4/Letters.pm b/C4/Letters.pm index fb8de5474b..3c6ff15196 100644 --- a/C4/Letters.pm +++ b/C4/Letters.pm @@ -29,6 +29,9 @@ use C4::Members; use C4::Log; use C4::SMS; use C4::Debug; +use Date::Calc qw( Add_Delta_Days ); +use Encode; +use Carp; use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); @@ -519,6 +522,19 @@ sub parseletter { } my $values = $sth->fetchrow_hashref; + + # TEMPORARY hack until the expirationdate column is added to reserves + if ( $table eq 'reserves' && $values->{'waitingdate'} ) { + my @waitingdate = split /-/, $values->{'waitingdate'}; + + $values->{'expirationdate'} = C4::Dates->new( + sprintf( + '%04d-%02d-%02d', + Add_Delta_Days( @waitingdate, C4::Context->preference( 'ReservesMaxPickUpDelay' ) ) + ), + 'iso' + )->output(); + } # and get all fields from the table diff --git a/C4/Reserves.pm b/C4/Reserves.pm index b10d6b4b18..f25764cb72 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -1714,6 +1714,9 @@ sub _koha_notify_reserve { if ( $reserve->{'itemnumber'} ) { C4::Letters::parseletter( $letter, 'items', $reserve->{'itemnumber'} ); } + my $today = C4::Dates->new()->output(); + $letter->{'title'} =~ s/<>/$today/g; + $letter->{'content'} =~ s/<>/$today/g; $letter->{'content'} =~ s/<<[a-z0-9_]+\.[a-z0-9]+>>//g; #remove any stragglers if ( -1 != firstidx { $_ eq 'email' } @{$messagingprefs->{transports}} ) { From 63e871dd401c33f288202358639bf098af596148 Mon Sep 17 00:00:00 2001 From: Jesse Weaver Date: Thu, 11 Jun 2009 14:49:15 -0600 Subject: [PATCH 4/6] Bug 3482 Allow hold notices to be sent in print form This is done by saving the notices in the message_queue table with type 'print'. The notices are generated from a notice named HOLD_PRINT. At the end of the day, they are dumped to an HTML file and marked as sent by a new cronjob. This setup is intended to be temporary; modules/batch/ shouldn't be around forever. Mandatory SQL: INSERT INTO message_transport_types (message_transport_type) values ('print'); --- C4/Letters.pm | 22 ++++- C4/Reserves.pm | 39 ++++++-- .../en/mandatory/message_transport_types.sql | 1 + .../prog/en/modules/batch/print-notices.tmpl | 24 +++++ misc/cronjobs/gather_print_notices.pl | 90 +++++++++++++++++++ 5 files changed, 166 insertions(+), 10 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/batch/print-notices.tmpl create mode 100755 misc/cronjobs/gather_print_notices.pl diff --git a/C4/Letters.pm b/C4/Letters.pm index 3c6ff15196..cf3e215be1 100644 --- a/C4/Letters.pm +++ b/C4/Letters.pm @@ -41,7 +41,7 @@ BEGIN { $VERSION = 3.01; @ISA = qw(Exporter); @EXPORT = qw( - &GetLetters &getletter &addalert &getalert &delalert &findrelatedto &SendAlerts + &GetLetters &getletter &addalert &getalert &delalert &findrelatedto &SendAlerts GetPrintMessages ); } @@ -667,6 +667,26 @@ sub GetRSSMessages { borrowernumber => $params->{'borrowernumber'}, } ); } +=head2 GetPrintMessages + +=over 4 + +my $message_list = GetPrintMessages( { borrowernumber => $borrowernumber } ) + +Returns a arrayref of all queued print messages (optionally, for a particular +person). + +=back + +=cut + +sub GetPrintMessages { + my $params = shift || {}; + + return _get_unsent_messages( { message_transport_type => 'print', + borrowernumber => $params->{'borrowernumber'}, } ); +} + =head2 GetQueuedMessages ([$hashref]) =over 4 diff --git a/C4/Reserves.pm b/C4/Reserves.pm index f25764cb72..d8f3b0bbb5 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -32,7 +32,7 @@ use C4::Accounts; # for _koha_notify_reserve use C4::Members::Messaging; -use C4::Members qw( GetMember ); +use C4::Members qw(); use C4::Letters; use C4::Branch qw( GetBranchDetail ); use C4::Dates qw( format_date_in_iso ); @@ -1688,9 +1688,19 @@ sub _koha_notify_reserve { my ($itemnumber, $borrowernumber, $biblionumber) = @_; my $dbh = C4::Context->dbh; - my $messagingprefs = C4::Members::Messaging::GetMessagingPreferences( { borrowernumber => $borrowernumber, message_name => 'Hold Filled' } ); + my $borrower = C4::Members::GetMember( $borrowernumber ); + my $letter_code; + my $print_mode = 0; + my $messagingprefs; + if ( $borrower->{'email'} || $borrower->{'smsalertnumber'} ) { + $messagingprefs = C4::Members::Messaging::GetMessagingPreferences( { borrowernumber => $borrowernumber, message_name => 'Hold Filled' } ); - return if ( !defined( $messagingprefs->{'letter_code'} ) ); + return if ( !defined( $messagingprefs->{'letter_code'} ) ); + $letter_code = $messagingprefs->{'letter_code'}; + } else { + $letter_code = 'HOLD_PRINT'; + $print_mode = 1; + } my $sth = $dbh->prepare(" SELECT * @@ -1704,12 +1714,13 @@ sub _koha_notify_reserve { my $admin_email_address = $branch_details->{'branchemail'} || C4::Context->preference('KohaAdminEmailAddress'); - my $letter = getletter( 'reserves', $messagingprefs->{'letter_code'} ); + my $letter = getletter( 'reserves', $letter_code ); + die "Could not find a letter called '$letter_code' in the 'reserves' module" unless( $letter ); C4::Letters::parseletter( $letter, 'branches', $reserve->{'branchcode'} ); - C4::Letters::parseletter( $letter, 'borrowers', $reserve->{'borrowernumber'} ); - C4::Letters::parseletter( $letter, 'biblio', $reserve->{'biblionumber'} ); - C4::Letters::parseletter( $letter, 'reserves', $reserve->{'borrowernumber'}, $reserve->{'biblionumber'} ); + C4::Letters::parseletter( $letter, 'borrowers', $borrowernumber ); + C4::Letters::parseletter( $letter, 'biblio', $biblionumber ); + C4::Letters::parseletter( $letter, 'reserves', $borrowernumber, $biblionumber ); if ( $reserve->{'itemnumber'} ) { C4::Letters::parseletter( $letter, 'items', $reserve->{'itemnumber'} ); @@ -1719,7 +1730,17 @@ sub _koha_notify_reserve { $letter->{'content'} =~ s/<>/$today/g; $letter->{'content'} =~ s/<<[a-z0-9_]+\.[a-z0-9]+>>//g; #remove any stragglers - if ( -1 != firstidx { $_ eq 'email' } @{$messagingprefs->{transports}} ) { + if ( $print_mode ) { + C4::Letters::EnqueueLetter( { + letter => $letter, + borrowernumber => $borrowernumber, + message_transport_type => 'print', + } ); + + return; + } + + if ( grep { $_ eq 'email' } @{$messagingprefs->{transports}} ) { # aka, 'email' in ->{'transports'} C4::Letters::EnqueueLetter( { letter => $letter, @@ -1730,7 +1751,7 @@ sub _koha_notify_reserve { ); } - if ( -1 != firstidx { $_ eq 'sms' } @{$messagingprefs->{transports}} ) { + if ( grep { $_ eq 'sms' } @{$messagingprefs->{transports}} ) { C4::Letters::EnqueueLetter( { letter => $letter, borrowernumber => $borrowernumber, diff --git a/installer/data/mysql/en/mandatory/message_transport_types.sql b/installer/data/mysql/en/mandatory/message_transport_types.sql index 517f5cc96c..3b85a6017d 100644 --- a/installer/data/mysql/en/mandatory/message_transport_types.sql +++ b/installer/data/mysql/en/mandatory/message_transport_types.sql @@ -2,4 +2,5 @@ INSERT INTO message_transport_types (message_transport_type) values ('email'), +('print'), ('sms'); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/batch/print-notices.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/batch/print-notices.tmpl new file mode 100644 index 0000000000..762b15727c --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/batch/print-notices.tmpl @@ -0,0 +1,24 @@ + + Print Notices for <!-- TMPL_VAR NAME="today" --> + + + + + + + +
+
+
+ + + diff --git a/misc/cronjobs/gather_print_notices.pl b/misc/cronjobs/gather_print_notices.pl new file mode 100755 index 0000000000..62939c79e3 --- /dev/null +++ b/misc/cronjobs/gather_print_notices.pl @@ -0,0 +1,90 @@ +#!/usr/bin/perl -w + +# Copyright 2009 Jesse Weaver +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, +# Suite 330, Boston, MA 02111-1307 USA + +use strict; +use warnings; + +BEGIN { + + # find Koha's Perl modules + # test carefully before changing this + use FindBin; + eval { require "$FindBin::Bin/../kohalib.pl" }; +} + +use CGI; # NOT a CGI script, this is just to keep C4::Output::gettemplate happy +use C4::Context; +use C4::Dates; +use C4::Debug; +use C4::Letters; +use C4::Output; +use File::Spec; +use Getopt::Long; + +sub usage { + print STDERR < \$stylesheet, + 'h|help' => \$help, +) || usage( 1 ); + +usage( 0 ) if ( $help ); + +my $output_directory = $ARGV[0]; + +if ( !$output_directory || !-d $output_directory ) { + print STDERR "Error: You must specify a valid directory to dump the print notices in.\n"; + usage( 1 ); +} + +my $today = C4::Dates->new(); +my @messages = @{ GetPrintMessages() }; +exit unless( @messages ); + +open OUTPUT, '>', File::Spec->catdir( $output_directory, "notices-" . $today->output( 'iso' ) . ".html" ); + +my $template = C4::Output::gettemplate( 'batch/print-notices.tmpl', 'intranet', new CGI ); +my $stylesheet_contents = ''; + +open STYLESHEET, '<', $stylesheet; +while ( ) { $stylesheet_contents .= $_ } +close STYLESHEET; + +$template->param( + stylesheet => $stylesheet_contents, + today => $today->output(), + messages => \@messages, +); + +print OUTPUT $template->output; + +foreach my $message ( @messages ) { + C4::Letters::_set_message_status( { message_id => $message->{'message_id'}, status => 'sent' } ); +} From f34da84ed6d439e7b2d1f9f1efd4bac8243e8749 Mon Sep 17 00:00:00 2001 From: "J. David Bavousett" Date: Fri, 21 Aug 2009 14:40:29 -0400 Subject: [PATCH 5/6] Bug 3482 changed name of notices file --- misc/cronjobs/gather_print_notices.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/cronjobs/gather_print_notices.pl b/misc/cronjobs/gather_print_notices.pl index 62939c79e3..fd33a17618 100755 --- a/misc/cronjobs/gather_print_notices.pl +++ b/misc/cronjobs/gather_print_notices.pl @@ -68,7 +68,7 @@ my $today = C4::Dates->new(); my @messages = @{ GetPrintMessages() }; exit unless( @messages ); -open OUTPUT, '>', File::Spec->catdir( $output_directory, "notices-" . $today->output( 'iso' ) . ".html" ); +open OUTPUT, '>', File::Spec->catdir( $output_directory, "holdnotices-" . $today->output( 'iso' ) . ".html" ); my $template = C4::Output::gettemplate( 'batch/print-notices.tmpl', 'intranet', new CGI ); my $stylesheet_contents = ''; From d6aed5f0d081af8d7229fe6b3fc9ea029f719e51 Mon Sep 17 00:00:00 2001 From: "J. David Bavousett" Date: Mon, 22 Feb 2010 11:02:01 -0500 Subject: [PATCH 6/6] Bug 3482: Updated DB version Updated DB version and inserted mandatory SQL for this series of patches. --- installer/data/mysql/updatedatabase.pl | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index e6f3f9f658..49483de39a 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -3520,6 +3520,18 @@ if (C4::Context->preference('Version') < TransformToNum($DBversion)){ SetVersion ($DBversion); } +$DBversion = '3.01.00.125'; +if (C4::Context->preference('Version') < TransformToNum($DBversion)){ + $dbh->do(" + INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'PrintNoticesMaxLines', '0', '', 'If greater than 0, sets the maximum number of lines an overdue notice will print. If the number of items is greater than this number, the notice will end with a warning asking the borrower to check their online account for a full list of overdue items.', 'Integer' ); + "); + $dbh->do(" + INSERT INTO message_transport_types (message_transport_type) values ('print'); + "); + print "Upgrade to $DBversion done (bug 3482: Printable hold and overdue notices)\n"; + SetVersion ($DBversion); +} + =item DropAllForeignKeys($table) Drop all foreign keys of the table $table