---
 opac/opac-ISBDdetail.pl |   24 +++++++++++-------------
 1 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/opac/opac-ISBDdetail.pl b/opac/opac-ISBDdetail.pl
index 31bd32e..463efb8 100755
--- a/opac/opac-ISBDdetail.pl
+++ b/opac/opac-ISBDdetail.pl
@@ -55,9 +55,16 @@ use C4::Koha;
 use C4::Members;    # GetMember
 use C4::External::Amazon;
 
-my $query = new CGI;
-
-my $dbh = C4::Context->dbh;
+my $query = CGI->new();
+my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
+    {
+        template_name   => "opac-ISBDdetail.tmpl",
+        query           => $query,
+        type            => "opac",
+        authnotrequired => 1,
+        debug           => 1,
+    }
+);
 
 my $biblionumber = $query->param('biblionumber');
 my $itemtype     = &GetFrameworkCode($biblionumber);
@@ -84,6 +91,7 @@ $template->param(
 
 #coping with subscriptions
 my $subscriptionsnumber = CountSubscriptionFromBiblionumber($biblionumber);
+my $dbh = C4::Context->dbh;
 my $dat                 = TransformMarcToKoha( $dbh, $record );
 my @subscriptions       =
   GetSubscriptions( $dat->{title}, $dat->{issn}, $biblionumber );
@@ -104,16 +112,6 @@ foreach my $subscription (@subscriptions) {
     push @subs, \%cell;
 }
 
-# open template
-my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
-    {
-        template_name   => "opac-ISBDdetail.tmpl",
-        query           => $query,
-        type            => "opac",
-        authnotrequired => 1,
-        debug           => 1,
-    }
-);
 $template->param(
     subscriptions       => \...@subs,
     subscriptionsnumber => $subscriptionsnumber,
-- 
1.5.6.5

_______________________________________________
Koha-patches mailing list
[email protected]
http://lists.koha.org/mailman/listinfo/koha-patches

Reply via email to