From a8441dfabf5c2b561b6ba93c084a88072a910043 Mon Sep 17 00:00:00 2001 From: Nahuel ANGELINETTI Date: Tue, 13 Jul 2010 15:57:29 +0200 Subject: [PATCH] (bug #4990) fix email link in overdues to have a pre-generated message This fix the link in overdues.pl to have great link with pre-generated emails, they are based on the letter "MANUAL_ODUE" in "circulation" module. --- circ/overdue.pl | 21 +++++++++++++++++++ .../prog/en/modules/circ/overdue.tmpl | 4 +++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/circ/overdue.pl b/circ/overdue.pl index 2bd230282b..e8e8b58970 100755 --- a/circ/overdue.pl +++ b/circ/overdue.pl @@ -122,6 +122,27 @@ my $datedueto = format_date_in_iso($input->param( 'datedueto' )); my @overduedata = @{GetOverduesByBorrowers($branchfilter, $borcatfilter, $itemtypefilter, $borflagsfilter, $bornamefilter, $order, $dateduefrom, $datedueto)}; +# Generate letters + +for my $borrower (@overduedata){ + my $letter = C4::Letters::getletter( 'circulation', 'MANUAL_ODUE' ); + + my $itemscontent; + for my $overdue( @{$borrower->{overdues}} ){ + $itemscontent .= + "$overdue->{title} $overdue->{author} $overdue->{barcode} $overdue->{itemcallnumber} $overdue->{issuedate}\n"; + } + $letter->{content} =~ s/<>/$itemscontent/g; + + C4::Letters::parseletter( $letter, 'borrowers', $borrower->{borrowernumber}); + C4::Letters::parseletter( $letter, 'branches', $borrower->{'branchcode'} ); + + $letter->{content} =~ s/\n/%0D%0A/g; + + $borrower->{letter_content} = $letter->{content}; + $borrower->{letter_title} = $letter->{title}; +} + $template->param( todaysdate => format_date($todaysdate), overdueloop => \@overduedata diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/overdue.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/overdue.tmpl index bdd98ae15b..7e78dcd5cc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/overdue.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/overdue.tmpl @@ -39,7 +39,9 @@ "> - [?subject=Overdue: ">email] + + [?subject=&body=">email] + () -- 2.39.5