Bug 9585 - Fix spelling mistake in default tab conditional for opac-detail
[koha.git] / opac / opac-detail.pl
index c0483a3..cc22acc 100755 (executable)
@@ -49,6 +49,7 @@ use MARC::Field;
 use List::MoreUtils qw/any none/;
 use C4::Images;
 use Koha::DateUtils;
+use C4::HTML5Media;
 
 BEGIN {
        if (C4::Context->preference('BakerTaylorEnabled')) {
@@ -517,6 +518,7 @@ my $currentbranch = C4::Context->userenv ? C4::Context->userenv->{branch} : unde
 if ($currentbranch and C4::Context->preference('OpacSeparateHoldings')) {
     $template->param(SeparateHoldings => 1);
 }
+my $separatebranch = C4::Context->preference('OpacSeparateHoldingsBranch');
 for my $itm (@items) {
     $itm->{holds_count} = $item_reserves{ $itm->{itemnumber} };
     $itm->{priority} = $priority{ $itm->{itemnumber} };
@@ -527,11 +529,6 @@ for my $itm (@items) {
                 && (not $itemtypes->{$itm->{'itype'}}->{notforloan} )
          && ($itm->{'itemnumber'} ) );
 
-    if ( defined $itm->{'publictype'} ) {
-        # I can't actually find any case in which this is defined. --amoore 2008-12-09
-        $itm->{ $itm->{'publictype'} } = 1;
-    }
-
     # get collection code description, too
     my $ccode = $itm->{'ccode'};
     $itm->{'ccode'} = $collections->{$ccode} if ( defined($collections) && exists( $collections->{$ccode} ) );
@@ -567,9 +564,9 @@ for my $itm (@items) {
         $itm->{transfertfrom} = $branches->{$transfertfrom}{branchname};
         $itm->{transfertto}   = $branches->{$transfertto}{branchname};
      }
-    my $homebranch = $itm->{homebranch};
+    my $itembranch = $itm->{$separatebranch};
     if ($currentbranch and C4::Context->preference('OpacSeparateHoldings')) {
-        if ($homebranch and $homebranch eq $currentbranch) {
+        if ($itembranch and $itembranch eq $currentbranch) {
             push @itemloop, $itm;
         } else {
             push @otheritemloop, $itm;
@@ -775,6 +772,11 @@ if (C4::Context->preference("OPACLocalCoverImages")){
                $template->param(OPACLocalCoverImages => 1);
 }
 
+# HTML5 Media
+if ( (C4::Context->preference("HTML5MediaEnabled") eq 'both') or (C4::Context->preference("HTML5MediaEnabled") eq 'opac') ) {
+    $template->param( C4::HTML5Media->gethtml5media($record));
+}
+
 my $syndetics_elements;
 
 if ( C4::Context->preference("SyndeticsEnabled") ) {
@@ -988,7 +990,7 @@ my $defaulttab =
     $subscriptionsnumber
         ? 'subscriptions' :
     @serialcollections > 0 
-        ? 'serialcollection' : 'subscription';
+        ? 'serialcollection' : 'subscriptions';
 $template->param('defaulttab' => $defaulttab);
 
 if (C4::Context->preference('OPACLocalCoverImages') == 1) {
@@ -996,6 +998,10 @@ if (C4::Context->preference('OPACLocalCoverImages') == 1) {
     $template->{VARS}->{localimages} = \@images;
 }
 
+$template->{VARS}->{IDreamBooksReviews} = C4::Context->preference('IDreamBooksReviews');
+$template->{VARS}->{IDreamBooksReadometer} = C4::Context->preference('IDreamBooksReadometer');
+$template->{VARS}->{IDreamBooksResults} = C4::Context->preference('IDreamBooksResults');
+
 if (C4::Context->preference('OpacHighlightedWords')) {
     $template->{VARS}->{query_desc} = $query->param('query_desc');
 }