[Koha-patches] [PATCH] [SIGNED-OFF]

Gaetan Boisson gaetan.boisson at biblibre.com
Tue Jan 3 17:07:58 CET 2012


From: Adrien Saurat <adrien.saurat at biblibre.com>

Works on the OPAC and in the admin, both in normal and item view.

Bug 7379: display of copynumber description

The biblio/items detail pages display the copynumber
description if an authorized value is configured
accordingly.

Signed-off-by: Gaetan Boisson <gaetan.boisson at biblibre.com>
---
 catalogue/detail.pl                                |   99 +++++----
 catalogue/moredetail.pl                            |   26 ++-
 .../prog/en/modules/catalogue/moredetail.tt        |    2 +-
 opac/opac-detail.pl                                |  221 ++++++++++----------
 4 files changed, 182 insertions(+), 166 deletions(-)

diff --git a/catalogue/detail.pl b/catalogue/detail.pl
index a1e5cc9..2c6de81 100755
--- a/catalogue/detail.pl
+++ b/catalogue/detail.pl
@@ -128,8 +128,8 @@ my $hostrecords;
 # adding items linked via host biblios
 my @hostitems = GetHostItemsInfo($record);
 if (@hostitems){
-	$hostrecords =1;
-	push (@items, at hostitems);
+    $hostrecords =1;
+    push (@items, at hostitems);
 }
 
 my $dat = &GetBiblioData($biblionumber);
@@ -144,16 +144,16 @@ my @subs;
 
 foreach my $subscription (@subscriptions) {
     my %cell;
-	my $serials_to_display;
+    my $serials_to_display;
     $cell{subscriptionid}    = $subscription->{subscriptionid};
     $cell{subscriptionnotes} = $subscription->{notes};
     $cell{branchcode}        = $subscription->{branchcode};
     $cell{branchname}        = GetBranchName($subscription->{branchcode});
     $cell{hasalert}          = $subscription->{hasalert};
     #get the three latest serials.
-	$serials_to_display = $subscription->{staffdisplaycount};
-	$serials_to_display = C4::Context->preference('StaffSerialIssueDisplayCount') unless $serials_to_display;
-	$cell{staffdisplaycount} = $serials_to_display;
+    $serials_to_display = $subscription->{staffdisplaycount};
+    $serials_to_display = C4::Context->preference('StaffSerialIssueDisplayCount') unless $serials_to_display;
+    $cell{staffdisplaycount} = $serials_to_display;
     $cell{latestserials} =
       GetLatestSerials( $subscription->{subscriptionid}, $serials_to_display );
     push @subs, \%cell;
@@ -167,8 +167,9 @@ $dat->{'count'} = scalar @all_items + @hostitems;
 $dat->{'showncount'} = scalar @items + @hostitems;
 $dat->{'hiddencount'} = scalar @all_items + @hostitems - scalar @items;
 
-my $shelflocations = GetKohaAuthorisedValues('items.location', $fw);
-my $collections    = GetKohaAuthorisedValues('items.ccode'   , $fw);
+my $shelflocations  = GetKohaAuthorisedValues('items.location'  , $fw);
+my $collections     = GetKohaAuthorisedValues('items.ccode'     , $fw);
+my $copynumbers     = GetKohaAuthorisedValues('items.copynumber', $fw);
 my (@itemloop, %itemfields);
 my $norequests = 1;
 my $authvalcode_items_itemlost = GetAuthValCode('items.itemlost',$fw);
@@ -189,19 +190,22 @@ foreach my $item (@items) {
     $item->{imageurl} = defined $item->{itype} ? getitemtypeimagelocation('intranet', $itemtypes->{ $item->{itype} }{imageurl})
                                                : '';
 
-	foreach (qw(datedue datelastseen onloan)) {
-		$item->{$_} = format_date($item->{$_});
-	}
+    foreach (qw(datedue datelastseen onloan)) {
+        $item->{$_} = format_date($item->{$_});
+    }
     # item damaged, lost, withdrawn loops
     $item->{itemlostloop} = GetAuthorisedValues($authvalcode_items_itemlost, $item->{itemlost}) if $authvalcode_items_itemlost;
     if ($item->{damaged}) {
         $item->{itemdamagedloop} = GetAuthorisedValues($authvalcode_items_damaged, $item->{damaged}) if $authvalcode_items_damaged;
     }
-    #get shelf location and collection code description if they are authorised value.
+    # get shelf location and collection code description if they are authorised value
+    # same thing for copy number
     my $shelfcode = $item->{'location'};
-    $item->{'location'} = $shelflocations->{$shelfcode} if ( defined( $shelfcode ) && defined($shelflocations) && exists( $shelflocations->{$shelfcode} ) );
+    $item->{'location'} = $shelflocations->{$shelfcode} if ( defined($shelfcode) && defined($shelflocations) && exists( $shelflocations->{$shelfcode} ) );
     my $ccode = $item->{'ccode'};
     $item->{'ccode'} = $collections->{$ccode} if ( defined( $ccode ) && defined($collections) && exists( $collections->{$ccode} ) );
+    my $copynumber = $item->{'copynumber'};
+    $item->{'copynumber'} = $copynumbers->{$copynumber} if ( defined($copynumber) && defined($copynumbers) && exists( $copynumbers->{$copynumber} ) );
     foreach (qw(ccode enumchron copynumber itemnotes uri)) {
         $itemfields{$_} = 1 if ( $item->{$_} );
     }
@@ -211,20 +215,20 @@ foreach my $item (@items) {
     my $ItemBorrowerReserveInfo = GetMemberDetails( $reservedfor, 0);
     
     if (C4::Context->preference('HidePatronName')){
-	$item->{'hidepatronname'} = 1;
+        $item->{'hidepatronname'} = 1;
     }
 
     if ( defined $reservedate ) {
-        $item->{backgroundcolor} = 'reserved';
-        $item->{reservedate}     = format_date($reservedate);
-        $item->{ReservedForBorrowernumber}     = $reservedfor;
-        $item->{ReservedForSurname}     = $ItemBorrowerReserveInfo->{'surname'};
-        $item->{ReservedForFirstname}   = $ItemBorrowerReserveInfo->{'firstname'};
-        $item->{ExpectedAtLibrary}      = $branches->{$expectedAt}{branchname};
-	$item->{Reservedcardnumber}             = $ItemBorrowerReserveInfo->{'cardnumber'};
+        $item->{backgroundcolor}            = 'reserved';
+        $item->{reservedate}                = format_date($reservedate);
+        $item->{ReservedForBorrowernumber}  = $reservedfor;
+        $item->{ReservedForSurname}         = $ItemBorrowerReserveInfo->{'surname'};
+        $item->{ReservedForFirstname}       = $ItemBorrowerReserveInfo->{'firstname'};
+        $item->{ExpectedAtLibrary}          = $branches->{$expectedAt}{branchname};
+        $item->{Reservedcardnumber}         = $ItemBorrowerReserveInfo->{'cardnumber'};
     }
 
-	# Check the transit status
+    # Check the transit status
     my ( $transfertwhen, $transfertfrom, $transfertto ) = GetTransfers($item->{itemnumber});
     if ( defined( $transfertwhen ) && ( $transfertwhen ne '' ) ) {
         $item->{transfertwhen} = format_date($transfertwhen);
@@ -243,40 +247,41 @@ foreach my $item (@items) {
     # item has a host number if its biblio number does not match the current bib
     if ($item->{biblionumber} ne $biblionumber){
         $item->{hostbiblionumber} = $item->{biblionumber};
-	$item->{hosttitle} = GetBiblioData($item->{biblionumber})->{title};
+    $item->{hosttitle} = GetBiblioData($item->{biblionumber})->{title};
     }
-	
-	#count if item is used in analytical bibliorecords
-	my $countanalytics= GetAnalyticsCount($item->{itemnumber});
-	if ($countanalytics > 0){
-		$analytics_flag=1;
-		$item->{countanalytics} = $countanalytics;
-	}
 
+    #count if item is used in analytical bibliorecords
+    my $countanalytics= GetAnalyticsCount($item->{itemnumber});
+    if ( defined $countanalytics) {
+        if ($countanalytics > 0){
+            $analytics_flag=1;
+            $item->{countanalytics} = $countanalytics;
+        }
+    }
     push @itemloop, $item;
 }
 
 $template->param( norequests => $norequests );
 $template->param(
-	MARCNOTES   => $marcnotesarray,
-	MARCSUBJCTS => $marcsubjctsarray,
-	MARCAUTHORS => $marcauthorsarray,
-	MARCSERIES  => $marcseriesarray,
-	MARCURLS => $marcurlsarray,
-    MARCISBNS => $marcisbnsarray,
-	MARCHOSTS => $marchostsarray,
-	subtitle    => $subtitle,
-	itemdata_ccode      => $itemfields{ccode},
-	itemdata_enumchron  => $itemfields{enumchron},
-	itemdata_uri        => $itemfields{uri},
-	itemdata_copynumber => $itemfields{copynumber},
-	volinfo				=> $itemfields{enumchron},
+    MARCNOTES           => $marcnotesarray,
+    MARCSUBJCTS         => $marcsubjctsarray,
+    MARCAUTHORS         => $marcauthorsarray,
+    MARCSERIES          => $marcseriesarray,
+    MARCURLS            => $marcurlsarray,
+    MARCISBNS           => $marcisbnsarray,
+    MARCHOSTS           => $marchostsarray,
+    subtitle            => $subtitle,
+    itemdata_ccode      => $itemfields{ccode},
+    itemdata_enumchron  => $itemfields{enumchron},
+    itemdata_uri        => $itemfields{uri},
+    itemdata_copynumber => $itemfields{copynumber},
+    volinfo             => $itemfields{enumchron},
     itemdata_itemnotes  => $itemfields{itemnotes},
-	z3950_search_params	=> C4::Search::z3950_search_args($dat),
+    z3950_search_params => C4::Search::z3950_search_args($dat),
     holdcount           => $holdcount,
-        hostrecords         => $hostrecords,
-	analytics_flag	=> $analytics_flag,
-	C4::Search::enabled_staff_search_views,
+    hostrecords         => $hostrecords,
+    analytics_flag      => $analytics_flag,
+    C4::Search::enabled_staff_search_views,
 );
 
 if (C4::Context->preference("AlternateHoldingsField") && scalar @items == 0) {
diff --git a/catalogue/moredetail.pl b/catalogue/moredetail.pl
index f5bb904..476fe79 100755
--- a/catalogue/moredetail.pl
+++ b/catalogue/moredetail.pl
@@ -31,9 +31,9 @@ use C4::Output;
 use C4::Auth;
 use C4::Serials;
 use C4::Dates qw/format_date/;
-use C4::Circulation;  # to use itemissues
-use C4::Members; # to use GetMember
-use C4::Search;		# enabled_staff_search_views
+use C4::Circulation;    # to use itemissues
+use C4::Members;        # to use GetMember
+use C4::Search;	        # enabled_staff_search_views
 use C4::Members qw/GetHideLostItemsPreference/;
 
 my $query=new CGI;
@@ -115,8 +115,9 @@ $data->{'count'}=$totalcount;
 $data->{'showncount'}=$showncount;
 $data->{'hiddencount'}=$hiddencount;  # can be zero
 
-my $ccodes= GetKohaAuthorisedValues('items.ccode',$fw);
-my $itemtypes = GetItemTypes;
+my $ccodes      = GetKohaAuthorisedValues('items.ccode',$fw);
+my $copynumbers = GetKohaAuthorisedValues('items.copynumber',$fw);
+my $itemtypes   = GetItemTypes;
 
 $data->{'itemtypename'} = $itemtypes->{$data->{'itemtype'}}->{'description'};
 
@@ -132,8 +133,15 @@ foreach my $item (@items){
     $item->{'itype'}                   = $itemtypes->{ $item->{'itype'} }->{'description'};
     $item->{'replacementprice'}        = sprintf( "%.2f", $item->{'replacementprice'} );
     $item->{$_}                        = format_date( $item->{$_} ) foreach qw/datelastborrowed dateaccessioned datelastseen lastreneweddate/;
-    $item->{'copyvol'}                 = $item->{'copynumber'};
-
+    if ( defined $item->{'copynumber'} ) {
+        $item->{'displaycopy'} = 1;
+        if ($copynumbers) {
+            $item->{'copyvol'} = $copynumbers->{ $item->{'copynumber'} }
+        }
+        else {
+            $item->{'copyvol'} = $item->{'copynumber'};
+        }
+    }
 
     # item has a host number if its biblio number does not match the current bib
     if ($item->{biblionumber} ne $biblionumber){
@@ -170,9 +178,9 @@ foreach my $item (@items){
     }
 }
 $template->param(count => $data->{'count'},
-	subscriptionsnumber => $subscriptionsnumber,
+    subscriptionsnumber => $subscriptionsnumber,
     subscriptiontitle   => $data->{title},
-	C4::Search::enabled_staff_search_views,
+    C4::Search::enabled_staff_search_views,
 );
 
 $template->param(
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt
index e79e9e8..167cf32 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt
@@ -56,7 +56,7 @@
 	    [% END %]
             [% IF ( ITEM_DAT.collection ) %]<li><span class="label">Collection:</span> [% ITEM_DAT.collection %]</li> [% END %]
             <li><span class="label">Item Callnumber:</span> [% ITEM_DAT.itemcallnumber %]&nbsp;</li>
-            [% IF ( ITEM_DAT.copyvol ) %]<li><span class="label">Copy / Vol :</span> [% ITEM_DAT.copyvol %]&nbsp;</li> [% END %]
+            [% IF ( ITEM_DAT.displaycopy ) %]<li><span class="label">Copy / Vol :</span> [% ITEM_DAT.copyvol %]&nbsp;</li> [% END %]
             [% IF ( ITEM_DAT.replacementprice ) %]<li><span class="label">Replacement Price:</span> [% ITEM_DAT.replacementprice %]&nbsp;</li> [% END %]
             </ol></div>
            <div class="listgroup"><h4>Statuses [% IF ( ITEM_DAT.status_advisory ) %](
diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl
index f82dde2..c24f8b8 100755
--- a/opac/opac-detail.pl
+++ b/opac/opac-detail.pl
@@ -400,12 +400,12 @@ my $hideitems = 1 if C4::Context->preference('hidelostitems') or scalar(@hiddeni
 # Hide items
 if ($hideitems) {
     for my $itm (@all_items) {
-	if  ( C4::Context->preference('hidelostitems') ) {
-	    push @items, $itm unless $itm->{itemlost} or any { $itm->{'itemnumber'} eq $_ } @hiddenitems;
-	} else {
-	    push @items, $itm unless any { $itm->{'itemnumber'} eq $_ } @hiddenitems;
+        if  ( C4::Context->preference('hidelostitems') ) {
+            push @items, $itm unless $itm->{itemlost} or any { $itm->{'itemnumber'} eq $_ } @hiddenitems;
+        } else {
+            push @items, $itm unless any { $itm->{'itemnumber'} eq $_ } @hiddenitems;
+        }
     }
-}
 } else {
     # Or not
     @items = @all_items;
@@ -420,8 +420,9 @@ if ( $itemtype ) {
     $dat->{'imageurl'}    = getitemtypeimagelocation( 'opac', $itemtypes->{$itemtype}->{'imageurl'} );
     $dat->{'description'} = $itemtypes->{$itemtype}->{'description'};
 }
-my $shelflocations =GetKohaAuthorisedValues('items.location',$dat->{'frameworkcode'}, 'opac');
-my $collections =  GetKohaAuthorisedValues('items.ccode',$dat->{'frameworkcode'}, 'opac');
+my $shelflocations  = GetKohaAuthorisedValues('items.location',$dat->{'frameworkcode'}, 'opac');
+my $collections     = GetKohaAuthorisedValues('items.ccode',$dat->{'frameworkcode'}, 'opac');
+my $copynumbers     = GetKohaAuthorisedValues('items.copynumber',$dat->{'frameworkcode'}, 'opac');
 
 #coping with subscriptions
 my $subscriptionsnumber = CountSubscriptionFromBiblionumber($biblionumber);
@@ -444,7 +445,7 @@ foreach my $subscription (@subscriptions) {
     #get the three latest serials.
     $serials_to_display = $subscription->{opacdisplaycount};
     $serials_to_display = C4::Context->preference('OPACSerialIssueDisplayCount') unless $serials_to_display;
-	$cell{opacdisplaycount} = $serials_to_display;
+    $cell{opacdisplaycount} = $serials_to_display;
     $cell{latestserials} =
       GetLatestSerials( $subscription->{subscriptionid}, $serials_to_display );
     push @subs, \%cell;
@@ -467,11 +468,11 @@ my $branches = GetBranches();
 my %itemfields;
 for my $itm (@items) {
     $norequests = 0
-       if ( (not $itm->{'wthdrawn'} )
-         && (not $itm->{'itemlost'} )
-         && ($itm->{'itemnotforloan'}<0 || not $itm->{'itemnotforloan'} )
-		 && (not $itemtypes->{$itm->{'itype'}}->{notforloan} )
-         && ($itm->{'itemnumber'} ) );
+    if ( (not $itm->{'wthdrawn'} )
+        && (not $itm->{'itemlost'} )
+        && ($itm->{'itemnotforloan'}<0 || not $itm->{'itemnotforloan'} )
+        && (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
@@ -480,10 +481,12 @@ for my $itm (@items) {
     $itm->{datedue}      = format_date($itm->{datedue});
     $itm->{datelastseen} = format_date($itm->{datelastseen});
 
-    # get collection code description, too
-    if ( my $ccode = $itm->{'ccode'} ) {
-        $itm->{'ccode'} = $collections->{$ccode} if ( defined($collections) && exists( $collections->{$ccode} ) );
-    }
+    # get collection code and copynumber description, too
+    my $ccode = $itm->{'ccode'};
+    $itm->{'ccode'} = $collections->{$ccode} if ( defined($collections) && exists( $collections->{$ccode} ) );
+    my $copynumber = $itm->{'copynumber'};
+    $itm->{'copynumber'} = $copynumbers->{$copynumber} if ( defined($copynumbers) && defined($copynumber) && exists( $copynumbers->{$copynumber} ) );
+    
     if ( defined $itm->{'location'} ) {
         $itm->{'location_description'} = $shelflocations->{ $itm->{'location'} };
     }
@@ -499,52 +502,52 @@ for my $itm (@items) {
      my $item_authorised_value_images = C4::Items::get_authorised_value_images( C4::Items::get_item_authorised_values( $itm->{'itemnumber'} ) );
      # warn( Data::Dumper->Dump( [ $item_authorised_value_images ], [ 'item_authorised_value_images' ] ) );
 
-     if ( $itm->{'itemlost'} ) {
-         my $lostimageinfo = List::Util::first { $_->{'category'} eq 'LOST' } @$item_authorised_value_images;
-         $itm->{'lostimageurl'}   = $lostimageinfo->{ 'imageurl' };
-         $itm->{'lostimagelabel'} = $lostimageinfo->{ 'label' };
-     }
+    if ( $itm->{'itemlost'} ) {
+        my $lostimageinfo = List::Util::first { $_->{'category'} eq 'LOST' } @$item_authorised_value_images;
+        $itm->{'lostimageurl'}   = $lostimageinfo->{ 'imageurl' };
+        $itm->{'lostimagelabel'} = $lostimageinfo->{ 'label' };
+    }
 
-     if( $itm->{'count_reserves'}){
-          if( $itm->{'count_reserves'} eq "Waiting"){ $itm->{'waiting'} = 1; }
-          if( $itm->{'count_reserves'} eq "Reserved"){ $itm->{'onhold'} = 1; }
-     }
-    
-     my ( $transfertwhen, $transfertfrom, $transfertto ) = GetTransfers($itm->{itemnumber});
-     if ( defined( $transfertwhen ) && $transfertwhen ne '' ) {
+    if( $itm->{'count_reserves'}){
+        if( $itm->{'count_reserves'} eq "Waiting"){ $itm->{'waiting'} = 1; }
+        if( $itm->{'count_reserves'} eq "Reserved"){ $itm->{'onhold'} = 1; }
+    }
+
+    my ( $transfertwhen, $transfertfrom, $transfertto ) = GetTransfers($itm->{itemnumber});
+    if ( defined( $transfertwhen ) && $transfertwhen ne '' ) {
         $itm->{transfertwhen} = format_date($transfertwhen);
         $itm->{transfertfrom} = $branches->{$transfertfrom}{branchname};
         $itm->{transfertto}   = $branches->{$transfertto}{branchname};
-     }
+    }
 }
 
 ## get notes and subjects from MARC record
-my $dbh              = C4::Context->dbh;
-my $marcnotesarray   = GetMarcNotes   ($record,$marcflavour);
-my $marcisbnsarray   = GetMarcISBN    ($record,$marcflavour);
-my $marcauthorsarray = GetMarcAuthors ($record,$marcflavour);
-my $marcsubjctsarray = GetMarcSubjects($record,$marcflavour);
-my $marcseriesarray  = GetMarcSeries  ($record,$marcflavour);
-my $marcurlsarray    = GetMarcUrls    ($record,$marcflavour);
-my $marchostsarray  = GetMarcHosts($record,$marcflavour);
-my $subtitle         = GetRecordValue('subtitle', $record, GetFrameworkCode($biblionumber));
+my $dbh                 = C4::Context->dbh;
+my $marcnotesarray      = GetMarcNotes   ($record,$marcflavour);
+my $marcisbnsarray      = GetMarcISBN    ($record,$marcflavour);
+my $marcauthorsarray    = GetMarcAuthors ($record,$marcflavour);
+my $marcsubjctsarray    = GetMarcSubjects($record,$marcflavour);
+my $marcseriesarray     = GetMarcSeries  ($record,$marcflavour);
+my $marcurlsarray       = GetMarcUrls    ($record,$marcflavour);
+my $marchostsarray      = GetMarcHosts($record,$marcflavour);
+my $subtitle            = GetRecordValue('subtitle', $record, GetFrameworkCode($biblionumber));
 
     $template->param(
-                     MARCNOTES               => $marcnotesarray,
-                     MARCSUBJCTS             => $marcsubjctsarray,
-                     MARCAUTHORS             => $marcauthorsarray,
-                     MARCSERIES              => $marcseriesarray,
-                     MARCURLS                => $marcurlsarray,
-		     MARCHOSTS               => $marchostsarray,
-                     norequests              => $norequests,
-                     RequestOnOpac           => C4::Context->preference("RequestOnOpac"),
-                     itemdata_ccode          => $itemfields{ccode},
-                     itemdata_enumchron      => $itemfields{enumchron},
-                     itemdata_uri            => $itemfields{uri},
-                     itemdata_copynumber     => $itemfields{copynumber},
-                     itemdata_itemnotes          => $itemfields{itemnotes},
-                     authorised_value_images => $biblio_authorised_value_images,
-                     subtitle                => $subtitle,
+                    MARCNOTES               => $marcnotesarray,
+                    MARCSUBJCTS             => $marcsubjctsarray,
+                    MARCAUTHORS             => $marcauthorsarray,
+                    MARCSERIES              => $marcseriesarray,
+                    MARCURLS                => $marcurlsarray,
+                    MARCHOSTS               => $marchostsarray,
+                    norequests              => $norequests,
+                    RequestOnOpac           => C4::Context->preference("RequestOnOpac"),
+                    itemdata_ccode          => $itemfields{ccode},
+                    itemdata_enumchron      => $itemfields{enumchron},
+                    itemdata_uri            => $itemfields{uri},
+                    itemdata_copynumber     => $itemfields{copynumber},
+                    itemdata_itemnotes      => $itemfields{itemnotes},
+                    authorised_value_images => $biblio_authorised_value_images,
+                    subtitle                => $subtitle,
     );
 
 if (C4::Context->preference("AlternateHoldingsField") && scalar @items == 0) {
@@ -590,11 +593,11 @@ if ( $isbn or $ean or $oclc or $upc ) {
     $content_identifier_exists = 1;
 }
 $template->param(
-	normalized_upc => $upc,
-	normalized_ean => $ean,
-	normalized_oclc => $oclc,
-	normalized_isbn => $isbn,
-	content_identifier_exists =>  $content_identifier_exists,
+    normalized_upc => $upc,
+    normalized_ean => $ean,
+    normalized_oclc => $oclc,
+    normalized_isbn => $isbn,
+    content_identifier_exists =>  $content_identifier_exists,
 );
 
 # COinS format FIXME: for books Only
@@ -628,14 +631,14 @@ foreach ( @$reviews ) {
     $_->{cardnumber}    = $borrowerData->{'cardnumber'};
     $_->{datereviewed} = format_date($_->{datereviewed});
     if ($borrowerData->{'borrowernumber'} eq $borrowernumber) {
-		$_->{your_comment} = 1;
-		$loggedincommenter = 1;
-	}
+        $_->{your_comment} = 1;
+        $loggedincommenter = 1;
+    }
 }
 
 
 if(C4::Context->preference("ISBD")) {
-	$template->param(ISBD => 1);
+    $template->param(ISBD => 1);
 }
 
 $template->param(
@@ -676,14 +679,14 @@ foreach my $sc_field (@sc_fields) {
     $row_data{branch}  = $sc_field->subfield('9');
 
     if ($row_data{text} && $row_data{branch}) { 
-	push (@serialcollections, \%row_data);
+        push (@serialcollections, \%row_data);
     }
 }
 
 if (scalar(@serialcollections) > 0) {
     $template->param(
-	serialcollection  => 1,
-	serialcollections => \@serialcollections);
+    serialcollection  => 1,
+    serialcollections => \@serialcollections);
 }
 
 # Amazon.com Stuff
@@ -734,12 +737,12 @@ my $syndetics_elements;
 if ( C4::Context->preference("SyndeticsEnabled") ) {
     $template->param("SyndeticsEnabled" => 1);
     $template->param("SyndeticsClientCode" => C4::Context->preference("SyndeticsClientCode"));
-	eval {
-	    $syndetics_elements = &get_syndetics_index($isbn,$upc,$oclc);
-	    for my $element (values %$syndetics_elements) {
-		$template->param("Syndetics$element"."Exists" => 1 );
-		#warn "Exists: "."Syndetics$element"."Exists";
-	}
+    eval {
+        $syndetics_elements = &get_syndetics_index($isbn,$upc,$oclc);
+        for my $element (values %$syndetics_elements) {
+            $template->param("Syndetics$element"."Exists" => 1 );
+            #warn "Exists: "."Syndetics$element"."Exists";
+        }
     };
     warn $@ if $@;
 }
@@ -747,22 +750,22 @@ if ( C4::Context->preference("SyndeticsEnabled") ) {
 if ( C4::Context->preference("SyndeticsEnabled")
         && C4::Context->preference("SyndeticsSummary")
         && ( exists($syndetics_elements->{'SUMMARY'}) || exists($syndetics_elements->{'AVSUMMARY'}) ) ) {
-	eval {
-	    my $syndetics_summary = &get_syndetics_summary($isbn,$upc,$oclc, $syndetics_elements);
-	    $template->param( SYNDETICS_SUMMARY => $syndetics_summary );
-	};
-	warn $@ if $@;
+    eval {
+        my $syndetics_summary = &get_syndetics_summary($isbn,$upc,$oclc, $syndetics_elements);
+        $template->param( SYNDETICS_SUMMARY => $syndetics_summary );
+    };
+    warn $@ if $@;
 
 }
 
 if ( C4::Context->preference("SyndeticsEnabled")
         && C4::Context->preference("SyndeticsTOC")
         && exists($syndetics_elements->{'TOC'}) ) {
-	eval {
-    my $syndetics_toc = &get_syndetics_toc($isbn,$upc,$oclc);
-    $template->param( SYNDETICS_TOC => $syndetics_toc );
-	};
-	warn $@ if $@;
+    eval {
+        my $syndetics_toc = &get_syndetics_toc($isbn,$upc,$oclc);
+        $template->param( SYNDETICS_TOC => $syndetics_toc );
+    };
+    warn $@ if $@;
 }
 
 if ( C4::Context->preference("SyndeticsEnabled")
@@ -772,7 +775,7 @@ if ( C4::Context->preference("SyndeticsEnabled")
     my $syndetics_excerpt = &get_syndetics_excerpt($isbn,$upc,$oclc);
     $template->param( SYNDETICS_EXCERPT => $syndetics_excerpt );
     };
-	warn $@ if $@;
+    warn $@ if $@;
 }
 
 if ( C4::Context->preference("SyndeticsEnabled")
@@ -781,12 +784,12 @@ if ( C4::Context->preference("SyndeticsEnabled")
     my $syndetics_reviews = &get_syndetics_reviews($isbn,$upc,$oclc,$syndetics_elements);
     $template->param( SYNDETICS_REVIEWS => $syndetics_reviews );
     };
-	warn $@ if $@;
+    warn $@ if $@;
 }
 
 if ( C4::Context->preference("SyndeticsEnabled")
     && C4::Context->preference("SyndeticsAuthorNotes")
-	&& exists($syndetics_elements->{'ANOTES'}) ) {
+    && exists($syndetics_elements->{'ANOTES'}) ) {
     eval {
     my $syndetics_anotes = &get_syndetics_anotes($isbn,$upc,$oclc);
     $template->param( SYNDETICS_ANOTES => $syndetics_anotes );
@@ -843,34 +846,34 @@ if (C4::Context->preference("OPACShelfBrowser")) {
 }
 
 if (C4::Context->preference("BakerTaylorEnabled")) {
-	$template->param(
-		BakerTaylorEnabled  => 1,
-		BakerTaylorImageURL => &image_url(),
-		BakerTaylorLinkURL  => &link_url(),
-		BakerTaylorBookstoreURL => C4::Context->preference('BakerTaylorBookstoreURL'),
-	);
-	my ($bt_user, $bt_pass);
-	if ($isbn and
-		$bt_user = C4::Context->preference('BakerTaylorUsername') and
-		$bt_pass = C4::Context->preference('BakerTaylorPassword')    )
-	{
-		$template->param(
-		BakerTaylorContentURL   =>
-		sprintf("http://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=%s&Password=%s&ItemKey=%s&Options=Y",
-				$bt_user,$bt_pass,$isbn)
-		);
-	}
+    $template->param(
+        BakerTaylorEnabled  => 1,
+        BakerTaylorImageURL => &image_url(),
+        BakerTaylorLinkURL  => &link_url(),
+        BakerTaylorBookstoreURL => C4::Context->preference('BakerTaylorBookstoreURL'),
+    );
+    my ($bt_user, $bt_pass);
+    if ($isbn and
+        $bt_user = C4::Context->preference('BakerTaylorUsername') and
+        $bt_pass = C4::Context->preference('BakerTaylorPassword')    )
+    {
+        $template->param(
+        BakerTaylorContentURL   =>
+        sprintf("http://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=%s&Password=%s&ItemKey=%s&Options=Y",
+                $bt_user,$bt_pass,$isbn)
+        );
+    }
 }
 
 my $tag_quantity;
 if (C4::Context->preference('TagsEnabled') and $tag_quantity = C4::Context->preference('TagsShowOnDetail')) {
-	$template->param(
-		TagsEnabled => 1,
-		TagsShowOnDetail => $tag_quantity,
-		TagsInputOnDetail => C4::Context->preference('TagsInputOnDetail')
-	);
-	$template->param(TagLoop => get_tags({biblionumber=>$biblionumber, approved=>1,
-								'sort'=>'-weight', limit=>$tag_quantity}));
+    $template->param(
+        TagsEnabled => 1,
+        TagsShowOnDetail => $tag_quantity,
+        TagsInputOnDetail => C4::Context->preference('TagsInputOnDetail')
+    );
+    $template->param(TagLoop => get_tags({biblionumber=>$biblionumber, approved=>1,
+                                'sort'=>'-weight', limit=>$tag_quantity}));
 }
 
 if (C4::Context->preference("OPACURLOpenInNewWindow")) {
-- 
1.7.5.4



More information about the Koha-patches mailing list