+my $limit = $query->param('limit');
+$limit = ( $limit eq 'full' ) ? 0 : 50;
+
+my $issues = GetAllIssues( $borrowernumber, $order, $limit );
+
+my $itype_attribute =
+ ( C4::Context->preference('item-level_itypes') ) ? 'itype' : 'itemtype';
+
+my $opac_summary_html = C4::Context->preference('OPACMySummaryHTML');
+foreach my $issue ( @{$issues} ) {
+ $issue->{normalized_isbn} = GetNormalizedISBN( $issue->{isbn} );
+ if ( $issue->{$itype_attribute} ) {
+ $issue->{description} =
+ $itemtypes->{ $issue->{$itype_attribute} }->{description};
+ $issue->{imageurl} =
+ getitemtypeimagelocation( 'opac',
+ $itemtypes->{ $issue->{$itype_attribute} }->{imageurl} );
+ }
+ if ( $issue->{marcxml} ) {
+ my $marcxml = StripNonXmlChars( $issue->{marcxml} );
+ my $marc_rec =
+ MARC::Record::new_from_xml( $marcxml, 'utf8',
+ C4::Context->preference('marcflavour') );
+ $issue->{subtitle} =
+ GetRecordValue( 'subtitle', $marc_rec, $issue->{frameworkcode} );
+ }
+ # My Summary HTML
+ if ($opac_summary_html) {
+ my $my_summary_html = $opac_summary_html;
+ $issue->{author}
+ ? $my_summary_html =~ s/{AUTHOR}/$issue->{author}/g
+ : $my_summary_html =~ s/{AUTHOR}//g;
+ my $title = $issue->{title};
+ $title =~ s/\/+$//; # remove trailing slash
+ $title =~ s/\s+$//; # remove trailing space
+ $title
+ ? $my_summary_html =~ s/{TITLE}/$title/g
+ : $my_summary_html =~ s/{TITLE}//g;
+ $issue->{normalized_isbn}
+ ? $my_summary_html =~ s/{ISBN}/$issue->{normalized_isbn}/g
+ : $my_summary_html =~ s/{ISBN}//g;
+ $issue->{biblionumber}
+ ? $my_summary_html =~ s/{BIBLIONUMBER}/$issue->{biblionumber}/g
+ : $my_summary_html =~ s/{BIBLIONUMBER}//g;
+ $issue->{MySummaryHTML} = $my_summary_html;
+ }
+}
+
+if (C4::Context->preference('BakerTaylorEnabled')) {
+ $template->param(
+ JacketImages=>1,
+ BakerTaylorEnabled => 1,
+ BakerTaylorImageURL => &image_url(),
+ BakerTaylorLinkURL => &link_url(),
+ BakerTaylorBookstoreURL => C4::Context->preference('BakerTaylorBookstoreURL'),
+ );
+}
+
+BEGIN {
+ if (C4::Context->preference('BakerTaylorEnabled')) {
+ require C4::External::BakerTaylor;
+ import C4::External::BakerTaylor qw(&image_url &link_url);
+ }
+}
+
+for(qw(AmazonCoverImages GoogleJackets)) { # BakerTaylorEnabled handled above
+ C4::Context->preference($_) or next;
+ $template->param($_=>1);
+ $template->param(JacketImages=>1);
+}