Bugzilla – Attachment 37036 Details for
Bug 8007
Discharge management
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 8007: Replace HTML::HTMLDoc with PDF::FromHTML
PASSED-QA-Bug-8007-Replace-HTMLHTMLDoc-with-PDFFro.patch (text/plain), 2.05 KB, created by
Kyle M Hall (khall)
on 2015-03-20 12:58:54 UTC
(
hide
)
Description:
[PASSED QA] Bug 8007: Replace HTML::HTMLDoc with PDF::FromHTML
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2015-03-20 12:58:54 UTC
Size:
2.05 KB
patch
obsolete
>From 1b93456d72318c23321d88db62b6a840f08c7b99 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Thu, 18 Dec 2014 15:39:46 +0100 >Subject: [PATCH] [PASSED QA] Bug 8007: Replace HTML::HTMLDoc with PDF::FromHTML > >Signed-off-by: Lucie <lucie.rousseaux@dracenie.com> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > C4/Installer/PerlDependencies.pm | 4 ++-- > Koha/Borrower/Discharge.pm | 16 +++++++++++----- > 2 files changed, 13 insertions(+), 7 deletions(-) > >diff --git a/C4/Installer/PerlDependencies.pm b/C4/Installer/PerlDependencies.pm >index 7879596..7cedd6f 100644 >--- a/C4/Installer/PerlDependencies.pm >+++ b/C4/Installer/PerlDependencies.pm >@@ -742,10 +742,10 @@ our $PERL_DEPS = { > 'required' => '0', > 'min_ver' => '5.61', > }, >- 'HTML:HTMLDoc' => { >+ 'PDF::FromHTML' => { > 'usage' => 'Discharge generation', > 'required' => '0', >- 'min_ver' => '0.07', >+ 'min_ver' => '0.31', > }, > }; > >diff --git a/Koha/Borrower/Discharge.pm b/Koha/Borrower/Discharge.pm >index 6027e7e..1665bc7 100644 >--- a/Koha/Borrower/Discharge.pm >+++ b/Koha/Borrower/Discharge.pm >@@ -3,7 +3,7 @@ package Koha::Borrower::Discharge; > use Modern::Perl; > use CGI; > use File::Temp qw( :POSIX ); >-use HTML::HTMLDoc; >+use PDF::FromHTML; > > use C4::Members qw( GetPendingIssues ); > use C4::Reserves qw( GetReservesFromBorrowernumber CancelReserve ); >@@ -108,10 +108,16 @@ sub generate_as_pdf { > messages => [$letter], > ); > >- my $pdf_path = tmpnam(); >- my $htmldoc = new HTML::HTMLDoc(); >- $htmldoc->set_html_content($tmpl->output); >- $htmldoc->generate_pdf()->to_file($pdf_path); >+ my $html_path = tmpnam() . '.html'; >+ my $pdf_path = tmpnam() . '.pdf'; >+ my $html_content = $tmpl->output; >+ open my $html_fh, '>', $html_path; >+ say $html_fh $html_content; >+ close $html_fh; >+ my $pdf = PDF::FromHTML->new( encoding => 'utf-8' ); >+ $pdf->load_file( $html_path ); >+ $pdf->convert; >+ $pdf->write_file( $pdf_path ); > > return $pdf_path; > } >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 8007
:
14490
|
16622
|
16935
|
17484
|
17485
|
21394
|
21395
|
21396
|
21660
|
21674
|
21675
|
21676
|
21677
|
21678
|
24023
|
24024
|
24025
|
24026
|
24027
|
30531
|
30532
|
30533
|
30534
|
30535
|
31007
|
34034
|
34035
|
34036
|
34037
|
34038
|
34039
|
34668
|
34669
|
34670
|
34671
|
34672
|
34673
|
34674
|
34675
|
36180
|
36181
|
36182
|
36183
|
36184
|
36185
|
36186
|
36187
|
36394
|
36395
|
36396
|
36397
|
36398
|
36399
|
36400
|
36401
|
37029
|
37030
|
37031
|
37032
|
37033
|
37034
|
37035
| 37036 |
37037
|
38596
|
38597