Bug 18465: (followup) Fix issue with patron lists an do not use clone
authorMarc Véron <veron@veron.ch>
Fri, 23 Jun 2017 16:48:00 +0000 (18:48 +0200)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 6 Jul 2017 17:52:54 +0000 (14:52 -0300)
This followup fixes duplex printing with patron lists.

Additionaly, it uses simple copy instead of clone and removes a
superfluous line, see comments #15 - #17

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/print.tt
patroncards/create-pdf.pl

index 950cf4e..f2ab3c6 100644 (file)
@@ -49,7 +49,7 @@
             [% ELSIF ( patronlist_id && template_id && layout_id ) %]
                 <h3>Click on the link to download the patron cards from the patron list.</h3>
                     <p>
-                        <a class="document pdf" href="/cgi-bin/koha/patroncards/create-pdf.pl?patronlist_id=[% patronlist_id %]&amp;template_id=[% template_id %]&amp;layout_id=[% layout_id %]&amp;start_card=[% start_card %]">label_patronlist_[% patronlist_id %].pdf</a>
+                        <a class="document pdf" href="/cgi-bin/koha/patroncards/create-pdf.pl?patronlist_id=[% patronlist_id %]&amp;template_id=[% template_id %]&amp;layout_id=[% layout_id %]&amp;layout_back_id=[% layout_back_id %]&amp;start_card=[% start_card %]">label_patronlist_[% patronlist_id %].pdf</a>
                     </p>
             [% ELSE %]
             <h3>
index 9f21a50..05cfcbd 100755 (executable)
@@ -26,7 +26,6 @@ use Graphics::Magick;
 use XML::Simple;
 use POSIX qw(ceil);
 use autouse 'Data::Dumper' => qw(Dumper);
-use Clone qw(clone);
 
 use C4::Debug;
 use C4::Context;
@@ -131,10 +130,8 @@ if ($layout_xml->{'page_side'} eq 'B') { # rearrange items on backside of page t
 CARD_ITEMS:
 foreach my $item (@{$items}) {
     if ($item) {
-
-#my $print_layout_xml = $layout_back_xml;
         my $print_layout_xml = (( ($cardscount % 2  == 1) && ( $layout_back_id ) ) ?
-            clone($layout_back_xml) : clone($layout_xml) );
+            $layout_back_xml : $layout_xml );
 
         $cardscount ++;
         my $borrower_number = $item->{'borrower_number'};