[Koha-patches] [PATCH] 4074 Bugfix: The 'Subject(s)' link(s) are malformed resulting in no search results

Chris Nighswonger cnighswonger at foundations.edu
Thu Jan 28 16:15:12 CET 2010


These links are rendered with the wrong syntax. ie. 'q=su:foo' This results in
a search for 'su:foo' rather than a search for 'foo' with an index of 'su.'
This patch corrects the code so that the syntax conforms to current parsing
methods. ie. 'idx=su&q=foo'

NOTE: The change to the underlying C4::Biblio->GetMarcSubjects() does not need
to be ported to any other calling code.

NOTE: This patch should be back-ported to 3.0.x.
---
 C4/Biblio.pm                                       |   68 ++++++++++---------
 .../prog/en/modules/basket/basket.tmpl             |   46 +++++++-------
 .../opac-tmpl/prog/en/modules/opac-detail.tmpl     |   70 ++++++++++----------
 opac/opac-detail.pl                                |   32 +++++-----
 4 files changed, 109 insertions(+), 107 deletions(-)

diff --git a/C4/Biblio.pm b/C4/Biblio.pm
index 7b17981..41af817 100755
--- a/C4/Biblio.pm
+++ b/C4/Biblio.pm
@@ -456,10 +456,10 @@ Links bib headings to authority records by checking
 each authority-controlled field in the C<MARC::Record>
 object C<$marc>, looking for a matching authority record,
 and setting the linking subfield $9 to the ID of that
-authority record.  
+authority record.
 
 If no matching authority exists, or if multiple
-authorities match, no $9 will be added, and any 
+authorities match, no $9 will be added, and any
 existing one inthe field will be deleted.
 
 Returns the number of heading links changed in the
@@ -739,7 +739,7 @@ sub GetBiblioFromItemNumber {
     my $sth;
     if ($itemnumber) {
         $sth = $dbh->prepare(
-            "SELECT * FROM items 
+            "SELECT * FROM items
             LEFT JOIN biblio ON biblio.biblionumber = items.biblionumber
             LEFT JOIN biblioitems ON biblioitems.biblioitemnumber = items.biblioitemnumber
              WHERE items.itemnumber = ?"
@@ -747,7 +747,7 @@ sub GetBiblioFromItemNumber {
         $sth->execute($itemnumber);
     } else {
         $sth = $dbh->prepare(
-            "SELECT * FROM items 
+            "SELECT * FROM items
             LEFT JOIN biblio ON biblio.biblionumber = items.biblionumber
             LEFT JOIN biblioitems ON biblioitems.biblioitemnumber = items.biblioitemnumber
              WHERE items.barcode = ?"
@@ -759,7 +759,7 @@ sub GetBiblioFromItemNumber {
     return ($data);
 }
 
-=head2 GetISBDView 
+=head2 GetISBDView
 
 =over 4
 
@@ -963,9 +963,9 @@ sub GetMarcStructure {
     #     my ($total) = $sth->fetchrow;
     #     $frameworkcode = "" unless ( $total > 0 );
     my $sth = $dbh->prepare(
-        "SELECT tagfield,liblibrarian,libopac,mandatory,repeatable 
-        FROM marc_tag_structure 
-        WHERE frameworkcode=? 
+        "SELECT tagfield,liblibrarian,libopac,mandatory,repeatable
+        FROM marc_tag_structure
+        WHERE frameworkcode=?
         ORDER BY tagfield"
     );
     $sth->execute($frameworkcode);
@@ -979,9 +979,9 @@ sub GetMarcStructure {
     }
 
     $sth = $dbh->prepare(
-        "SELECT tagfield,tagsubfield,liblibrarian,libopac,tab,mandatory,repeatable,authorised_value,authtypecode,value_builder,kohafield,seealso,hidden,isurl,link,defaultvalue 
-         FROM   marc_subfield_structure 
-         WHERE  frameworkcode=? 
+        "SELECT tagfield,tagsubfield,liblibrarian,libopac,tab,mandatory,repeatable,authorised_value,authtypecode,value_builder,kohafield,seealso,hidden,isurl,link,defaultvalue
+         FROM   marc_subfield_structure
+         WHERE  frameworkcode=?
          ORDER BY tagfield,tagsubfield
         "
     );
@@ -1029,14 +1029,14 @@ sub GetMarcStructure {
 
     the same function as GetMarcStructure except it just takes field
     in tab 0-9. (used field)
-    
+
     my $results = GetUsedMarcStructure($frameworkcode);
-    
+
     L<$results> is a ref to an array which each case containts a ref
     to a hash which each keys is the columns from marc_subfield_structure
-    
-    L<$frameworkcode> is the framework code. 
-    
+
+    L<$frameworkcode> is the framework code.
+
 =cut
 
 sub GetUsedMarcStructure($) {
@@ -1044,7 +1044,7 @@ sub GetUsedMarcStructure($) {
     my $query = qq/
         SELECT *
         FROM   marc_subfield_structure
-        WHERE   tab > -1 
+        WHERE   tab > -1
             AND frameworkcode = ?
         ORDER BY tagfield, tagsubfield
     /;
@@ -1058,7 +1058,7 @@ sub GetUsedMarcStructure($) {
 =over 4
 
 ($MARCfield,$MARCsubfield)=GetMarcFromKohaField($kohafield,$frameworkcode);
-Returns the MARC fields & subfields mapped to the koha field 
+Returns the MARC fields & subfields mapped to the koha field
 for the given frameworkcode
 
 =back
@@ -1399,23 +1399,25 @@ sub GetMarcSubjects {
             my $code      = $subject_subfield->[0];
             my $value     = $subject_subfield->[1];
             my $linkvalue = $value;
+            my $limit = '';
             $linkvalue =~ s/(\(|\))//g;
             my $operator = " and " unless $counter == 0;
             if ( $code eq 9 ) {
                 $found9 = 1;
-                @link_loop = ( { 'limit' => 'an', link => "$linkvalue" } );
+                $limit = 'an';
+                @link_loop = ( {link => "$linkvalue" } );
             }
             if ( not $found9 ) {
-                push @link_loop, { 'limit' => 'su', link => $linkvalue, operator => $operator };
+                $limit = 'su';
+                push @link_loop, {link => $linkvalue, operator => $operator };
             }
             my $separator = C4::Context->preference("authoritysep") unless $counter == 0;
 
             # ignore $9
             my @this_link_loop = @link_loop;
-            push @subfields_loop, { code => $code, value => $value, link_loop => \@this_link_loop, separator => $separator } unless ( $subject_subfield->[0] eq 9 );
+            push @subfields_loop, { code => $code, value => $value, link_loop => \@this_link_loop, separator => $separator, limit => $limit} unless ( $subject_subfield->[0] eq 9 );
             $counter++;
         }
-
         push @marcsubjects, { MARCSUBJECT_SUBFIELDS_LOOP => \@subfields_loop };
 
     }
@@ -1500,7 +1502,7 @@ sub GetMarcAuthors {
 
 $marcurls = GetMarcUrls($record,$marcflavour);
 Returns arrayref of URLs from MARC data, suitable to pass to tmpl loop.
-Assumes web resources (not uncommon in MARC21 to omit resource type ind) 
+Assumes web resources (not uncommon in MARC21 to omit resource type ind)
 
 =back
 
@@ -1998,7 +2000,7 @@ our $inverted_field_map;
 =back
 
 Extract data from a MARC bib record into a hashref representing
-Koha biblio, biblioitems, and items fields. 
+Koha biblio, biblioitems, and items fields.
 
 =cut
 
@@ -2131,7 +2133,7 @@ name with the table name would require changing lots
 of code and templates, and exposing more of the DB
 structure than is good to the UI templates, particularly
 since biblio and bibloitems may well merge in a future
-version.  In the future, it would also be good to 
+version.  In the future, it would also be good to
 separate DB access and UI presentation field names
 more.
 
@@ -2447,11 +2449,11 @@ ModZebra( $biblionumber, $op, $server, $oldRecord, $newRecord );
     $biblionumber is the biblionumber we want to index
     $op is specialUpdate or delete, and is used to know what we want to do
     $server is the server that we want to update
-    $oldRecord is the MARC::Record containing the previous version of the record.  This is used only when 
+    $oldRecord is the MARC::Record containing the previous version of the record.  This is used only when
       NoZebra=1, as NoZebra indexing needs to know the previous version of a record in order to
       do an update.
     $newRecord is the MARC::Record containing the new record. It is usefull only when NoZebra=1, and is used to know what to add to the nozebra database. (the record in mySQL being, if it exist, the previous record, the one just before the modif. We need both : the previous and the new one.
-    
+
 =back
 
 =cut
@@ -2503,7 +2505,7 @@ sub ModZebra {
         #
         # we use zebra, just fill zebraqueue table
         #
-        my $check_sql = "SELECT COUNT(*) FROM zebraqueue 
+        my $check_sql = "SELECT COUNT(*) FROM zebraqueue
                          WHERE server = ?
                          AND   biblio_auth_number = ?
                          AND   operation = ?
@@ -2523,7 +2525,7 @@ sub ModZebra {
 =head2 GetNoZebraIndexes
 
     %indexes = GetNoZebraIndexes;
-    
+
     return the data from NoZebraIndexes syspref.
 
 =cut
@@ -3067,7 +3069,7 @@ sub _koha_modify_biblioitem_nonmarc {
     # re-calculate the cn_sort, it may have changed
     my ($cn_sort) = GetClassSort( $biblioitem->{'biblioitems.cn_source'}, $biblioitem->{'cn_class'}, $biblioitem->{'cn_item'} );
 
-    my $query = "UPDATE biblioitems 
+    my $query = "UPDATE biblioitems
     SET biblionumber    = ?,
         volume          = ?,
         number          = ?,
@@ -3290,9 +3292,9 @@ sub _koha_delete_biblioitems {
 =head2 ModBiblioMarc
 
     &ModBiblioMarc($newrec,$biblionumber,$frameworkcode);
-    
-    Add MARC data for a biblio to koha 
-    
+
+    Add MARC data for a biblio to koha
+
     Function exported, but should NOT be used, unless you really know what you're doing
 
 =cut
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tmpl
index 4580103..1fb1616 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tmpl
@@ -5,7 +5,7 @@
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <link rel="shortcut icon" href="<!-- TMPL_VAR NAME="themelang" -->/includes/favicon.ico" type="image/x-icon" />
 <meta http-equiv="Content-Language" content="en-us" />
-<style type="text/css"> 
+<style type="text/css">
     @import url(<!-- TMPL_VAR NAME="themelang" -->/css/print.css);
 </style>
     <!-- TMPL_ELSE --><!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
@@ -14,14 +14,14 @@
 	<script type="text/javascript">
 	//<![CDATA[
 
-$(document).ready(function() 
-    { 
+$(document).ready(function()
+    {
         $("#itemst").tablesorter({
                         headers: { 0: { sorter: false }}
-                }); 
-    } 
-); 
-    
+                });
+    }
+);
+
 
 function placeHold () {
     var checkedItems = $("input:checkbox:checked");
@@ -91,9 +91,9 @@ function tagAdded() {
 		var checked = [];
 		$("#bookbag_form").checkCheckboxes("*", true).each(
 		    function() {
-				selRecord(this.value,true); 
+				selRecord(this.value,true);
 			}
-		); 
+		);
 	        return false;
 	    });
 	    $("#CheckNone").click(function(){
@@ -119,7 +119,7 @@ function tagAdded() {
         <!-- /TMPL_IF -->
 	});
 
-   
+
 	//]]>
 	</script>
 	<!-- /TMPL_IF -->
@@ -234,7 +234,7 @@ function tagAdded() {
 	    </td>
         </tr>
         <!-- /TMPL_IF -->
-        
+
         <!-- TMPL_IF NAME="publishercode" -->
             <tr>
                 <th scope="row">Publisher</th>
@@ -254,7 +254,7 @@ function tagAdded() {
             <td> <!-- TMPL_VAR NAME="seriestitle" --></td>
         </tr>
         <!-- /TMPL_IF -->
-        
+
         <!-- TMPL_IF name="MARCSUBJCTS" -->
         <tr>
             <th scope="row">Subject(s)</th>
@@ -265,13 +265,13 @@ function tagAdded() {
                 <!-- /TMPL_LOOP --></td>
         </tr>
         <!-- /TMPL_IF -->
-    
+
         <!-- TMPL_IF name="copyrightdate" -->
             <tr><th scope="row">Copyright</th>
                 <td> <!-- TMPL_VAR NAME="copyrightdate" --></td>
             </tr>
         <!-- /TMPL_IF -->
-    
+
         <!-- TMPL_IF name="MARCNOTES" -->
         <tr>
             <th scope="row">Notes</th>
@@ -281,7 +281,7 @@ function tagAdded() {
             <!-- /TMPL_LOOP --></td>
         </tr>
         <!-- /TMPL_IF -->
-    
+
         <!-- TMPL_IF name="unititle" -->
         <tr>
             <th scope="row">Unified title</th>
@@ -312,20 +312,20 @@ function tagAdded() {
             <td> <!-- TMPL_VAR name="lccn" --></td>
         </tr>
         <!-- /TMPL_IF -->
-		
+
         <!-- TMPL_IF name="MARCURLS" -->
         <tr>
             <th scope="row">URL(s)</th>
             <td>
 	   <!-- TMPL_LOOP name="MARCURLS" -->
 		<p><!-- TMPL_IF NAME="part" --><!-- TMPL_VAR NAME="part" -->
-			<br /><!-- /TMPL_IF --> 
-	
+			<br /><!-- /TMPL_IF -->
+
 		<!-- TMPL_VAR NAME="MARCURL" -->
 			<!-- TMPL_IF NAME="notes" --><!-- TMPL_LOOP NAME="notes" --><!-- TMPL_VAR NAME="note" --><br /><!-- /TMPL_LOOP --><!-- /TMPL_IF -->
             <!-- /TMPL_LOOP --></p></td>
         </tr><!-- /TMPL_IF -->
-		
+
         <tr>
             <th scope="row">Location(s)</th>
             <td><!-- TMPL_IF NAME="ITEM_RESULTS" --><!-- TMPL_LOOP NAME="ITEM_RESULTS" -->
@@ -345,10 +345,10 @@ function tagAdded() {
 <!-- TMPL_UNLESS NAME="print_basket" -->
 <p style="border-top : 1px solid #E8E8E8;">
 	<form action="/cgi-bin/koha/basket/basket.pl" method="get" name="bookbag_form" id="bookbag_form">
-    <a id="CheckAll" href="#">Select All</a> 
+    <a id="CheckAll" href="#">Select All</a>
     <a id="CheckNone" href="#">Clear All</a>
     | <b>Selected items :</b>
-<span id="tag_hides">                
+<span id="tag_hides">
 <a href="#" onclick="delSelRecords(); return false;">Remove</a>
 
 <!-- TMPL_IF NAME="loggedinusername" -->
@@ -386,7 +386,7 @@ function tagAdded() {
             <!-- /TMPL_IF -->
             <!-- TMPL_UNLESS NAME="print_basket" --><td>
                         <input type="checkbox" value="<!-- TMPL_VAR NAME="biblionumber" -->" name="bib<!-- TMPL_VAR NAME="biblionumber" -->" id="bib<!-- TMPL_VAR NAME="biblionumber" -->" onclick="selRecord(value,checked);" />
-                   
+
                 </td> <!-- /TMPL_UNLESS -->
             <td><a href="#" onclick="openBiblio('<!-- TMPL_VAR name="dest" -->',<!-- TMPL_VAR name="biblionumber" -->)">
                         <!-- TMPL_VAR NAME="title" escape="html" -->
@@ -403,7 +403,7 @@ function tagAdded() {
 						    <!-- COinS / OpenURL -->
     <span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.au=<!-- TMPL_VAR NAME="author" -->&amp;rft.btitle=<!-- TMPL_VAR NAME="title" ESCAPE="url" -->&amp;rft.date=<!-- TMPL_VAR NAME="publicationyear" -->&amp;rft.tpages=<!-- TMPL_VAR NAME="size" -->&amp;rft.isbn=<!-- TMPL_VAR NAME="isbn"  ESCAPE="url" -->&amp;rft.aucorp=&amp;rft.place=<!-- TMPL_VAR NAME="place" -->&amp;rft.pub=<!-- TMPL_VAR NAME="publisher" ESCAPE="url" -->&amp;rft.edition=<!-- TMPL_VAR NAME="edition" -->&amp;rft.series=<!-- TMPL_VAR NAME="series" -->&amp;rft.genre="></span>
     <div id="newtag<!-- TMPL_VAR NAME="biblionumber">_status" class="tagstatus results_summary" style="display:none">Tag status here.</div>
-    
+
 						</td>
             <td><!-- TMPL_VAR name="description" --></td>
                 <td><!-- TMPL_IF NAME="ITEM_RESULTS" --><!-- TMPL_LOOP NAME="ITEM_RESULTS" -->
diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl
index e861027..cfc914f 100644
--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl
+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl
@@ -3,7 +3,7 @@
 <script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
 <script type="text/JavaScript" language="JavaScript">
 //<![CDATA[
-     $(document).ready(function() { 
+     $(document).ready(function() {
         $("#tagform").hide();
         $("#addtagl").show();
         $('#bibliodescriptions > ul').tabs();
@@ -41,14 +41,14 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
 		YAHOO.util.Event.addListener("furthersearches", "click", furthersearchesMenu.show, null, furthersearchesMenu);
 		YAHOO.widget.Overlay.windowResizeEvent.subscribe(positionfurthersearchesMenu);
  });
-	
+
 //]]>
 </script>
 <style type="text/css">
     #addtagl { display: none; }
 </style>
 <!-- TMPL_IF NAME="XSLTDetailsDisplay" --><script type="text/javascript">
-    var GB_ROOT_DIR = "/opac-tmpl/prog/en/lib/greybox/";                               
+    var GB_ROOT_DIR = "/opac-tmpl/prog/en/lib/greybox/";
 </script>
 <script type="text/javascript" src="/opac-tmpl/prog/en/lib/greybox/AJS.js"></script>
 <script type="text/javascript" src="/opac-tmpl/prog/en/lib/greybox/AJS_fx.js"></script>
@@ -70,7 +70,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
     <div id="catalogue_detail_biblio">
 
     <div id="bookcover">
-    <!-- TMPL_IF NAME="OPACAmazonEnabled" --><!-- TMPL_IF NAME="OPACAmazonCoverImages" --><!-- TMPL_IF NAME="OPACURLOpenInNewWindow" --><a href="http://www.amazon<!-- TMPL_VAR NAME="AmazonTld" -->/gp/reader/<!-- TMPL_VAR NAME="normalized_isbn" -->/ref=sib_dp_pt/002-7879865-0184864#reader-link" target="_blank"><img border="0" src="http://images.amazon.com/images/P/<!-- TMPL_VAR NAME="normalized_isbn" -->.01.MZZZZZZZ.jpg" alt="Cover Image" /></a><!-- TMPL_ELSE --><a href="http://www.amazon<!-- TMPL_VAR NAME="AmazonTld" -->/gp/reader/<!-- TMPL_VAR NAME="normalized_isbn" -->/ref=sib_dp_pt/002-7879865-0184864#reader-link"><img border="0" src="http://images.amazon.com/images/P/<!-- TMPL_VAR NAME="normalized_isbn" -->.01.MZZZZZZZ.jpg" alt="Cover Image" /></a><!-- /TMPL_IF --><!-- /TMPL_IF --><!-- /TMPL_IF -->    
+    <!-- TMPL_IF NAME="OPACAmazonEnabled" --><!-- TMPL_IF NAME="OPACAmazonCoverImages" --><!-- TMPL_IF NAME="OPACURLOpenInNewWindow" --><a href="http://www.amazon<!-- TMPL_VAR NAME="AmazonTld" -->/gp/reader/<!-- TMPL_VAR NAME="normalized_isbn" -->/ref=sib_dp_pt/002-7879865-0184864#reader-link" target="_blank"><img border="0" src="http://images.amazon.com/images/P/<!-- TMPL_VAR NAME="normalized_isbn" -->.01.MZZZZZZZ.jpg" alt="Cover Image" /></a><!-- TMPL_ELSE --><a href="http://www.amazon<!-- TMPL_VAR NAME="AmazonTld" -->/gp/reader/<!-- TMPL_VAR NAME="normalized_isbn" -->/ref=sib_dp_pt/002-7879865-0184864#reader-link"><img border="0" src="http://images.amazon.com/images/P/<!-- TMPL_VAR NAME="normalized_isbn" -->.01.MZZZZZZZ.jpg" alt="Cover Image" /></a><!-- /TMPL_IF --><!-- /TMPL_IF --><!-- /TMPL_IF -->
     <!-- TMPL_IF NAME="SyndeticsEnabled" --><!-- TMPL_IF NAME="SyndeticsCoverImages" --><!-- TMPL_IF NAME="content_identifier_exists" --><img src="http://www.syndetics.com/index.aspx?isbn=<!-- TMPL_VAR NAME="normalized_isbn" -->/<!-- TMPL_VAR NAME="SyndeticsCoverImageSize" -->.GIF&amp;client=<!-- TMPL_VAR NAME="SyndeticsClientCode" -->&amp;type=xw10<!-- TMPL_IF NAME="normalized_upc" -->&amp;upc=<!-- TMPL_VAR NAME="normalized_upc" --><!-- /TMPL_IF --><!-- TMPL_IF NAME="normalized_oclc" -->&amp;oclc=<!-- TMPL_VAR NAME="normalized_oclc" --><!-- /TMPL_IF -->" alt="" class="thumbnail" /><!-- TMPL_ELSE --><span class="no-image">No cover image available</span><!-- /TMPL_IF --><!-- /TMPL_IF --><!-- /TMPL_IF -->
     <!-- TMPL_IF NAME="GoogleJackets" --><div style="block" title="<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->" class="<!-- TMPL_VAR NAME="normalized_isbn" -->" id="gbs-thumbnail-preview"></div><!-- /TMPL_IF -->
     <!-- TMPL_IF NAME="BakerTaylorEnabled" --><!-- TMPL_IF NAME="normalized_isbn" --><!-- TMPL_IF NAME="OPACURLOpenInNewWindow" --><a href="https://<!-- TMPL_VAR NAME="BakerTaylorBookstoreURL" ESCAPE="HTML" --><!-- TMPL_VAR NAME="normalized_isbn" -->" target="_blank"><img alt="See Baker &amp; Taylor" src="<!-- TMPL_VAR NAME="BakerTaylorImageURL" ESCAPE="HTML" --><!-- TMPL_VAR NAME="normalized_isbn" -->" /></a><!-- TMPL_ELSE --><a href="https://<!-- TMPL_VAR NAME="BakerTaylorBookstoreURL" ESCAPE="HTML" --><!-- TMPL_VAR NAME="normalized_isbn" -->"><img alt="See Baker &amp; Taylor" src="<!-- TMPL_VAR NAME="BakerTaylorImageURL" ESCAPE="HTML" --><!-- TMPL_VAR NAME="normalized_isbn" -->" /></a><!-- /TMPL_IF --><!-- /TMPL_IF --><!-- /TMPL_IF -->
@@ -86,7 +86,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
         <!-- TMPL_VAR NAME="XSLTBloc" -->
     <!-- TMPL_ELSE -->
     <h1><!-- TMPL_VAR NAME="title" escape="html" --> <!-- TMPL_IF NAME="subtitle" --> <span class="subtitle"><!-- TMPL_LOOP NAME="subtitle" --><!-- TMPL_VAR NAME="subfield" ESCAPE="HTML"--><!--/TMPL_LOOP --></span><!-- /TMPL_IF --></h1>
-    <!-- TMPL_IF NAME="author" --><h5 class="author">by <a href="/cgi-bin/koha/opac-search.pl?q=au:<!-- TMPL_VAR NAME="author" ESCAPE="URL" -->"><!-- TMPL_VAR NAME="author" ESCAPE="HTML" --></a></h5><!-- /TMPL_IF --> 
+    <!-- TMPL_IF NAME="author" --><h5 class="author">by <a href="/cgi-bin/koha/opac-search.pl?q=au:<!-- TMPL_VAR NAME="author" ESCAPE="URL" -->"><!-- TMPL_VAR NAME="author" ESCAPE="HTML" --></a></h5><!-- /TMPL_IF -->
     <div id="views"><span class="view"><span id="Normalview">Normal View</span></span> <span class="view"><a id="MARCview" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">MARC View</a></span> <!-- TMPL_IF NAME="ISBD" --><span class="view"><a id="ISBDview" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">ISBD View</a></span><!-- /TMPL_IF -->
     </div>
 
@@ -104,7 +104,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
     <!-- TMPL_IF name="MARCAUTHORS" -->
     <span class="results_summary"><span class="label">Authors:</span>
                 <!-- TMPL_LOOP NAME="MARCAUTHORS" -->
-                <!-- TMPL_LOOP NAME="MARCAUTHOR_SUBFIELDS_LOOP" --><!-- TMPL_VAR NAME="separator" --><a title="&#8225;<!-- TMPL_VAR NAME=code --> <!-- TMPL_VAR NAME=value -->" href="/cgi-bin/koha/opac-search.pl?q=<!-- TMPL_LOOP NAME=link_loop --><!-- TMPL_VAR NAME=operator ESCAPE="URL" --><!-- TMPL_VAR NAME='limit' ESCAPE="URL" -->:<!-- TMPL_VAR NAME=link ESCAPE="URL" --><!-- /TMPL_LOOP -->"><!-- TMPL_VAR NAME="value" --></a><!-- /TMPL_LOOP --> 
+                <!-- TMPL_LOOP NAME="MARCAUTHOR_SUBFIELDS_LOOP" --><!-- TMPL_VAR NAME="separator" --><a title="&#8225;<!-- TMPL_VAR NAME=code --> <!-- TMPL_VAR NAME=value -->" href="/cgi-bin/koha/opac-search.pl?q=<!-- TMPL_LOOP NAME=link_loop --><!-- TMPL_VAR NAME=operator ESCAPE="URL" --><!-- TMPL_VAR NAME='limit' ESCAPE="URL" -->:<!-- TMPL_VAR NAME=link ESCAPE="URL" --><!-- /TMPL_LOOP -->"><!-- TMPL_VAR NAME="value" --></a><!-- /TMPL_LOOP -->
         <!-- TMPL_UNLESS NAME="__last__" -->|
 <!-- /TMPL_UNLESS -->
                 <!-- /TMPL_LOOP -->
@@ -126,11 +126,11 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
     <!-- TMPL_IF name="publishercode" -->
     <span class="results_summary"><span class="label">Published by :</span>
         <a href="/cgi-bin/koha/opac-search.pl?q=pb:<!-- TMPL_VAR NAME="publishercode" ESCAPE="URL" --> ">
-            <!-- TMPL_VAR NAME="publishercode" ESCAPE="HTML" --> 
+            <!-- TMPL_VAR NAME="publishercode" ESCAPE="HTML" -->
         </a> <!-- TMPL_IF name="place" -->(<!-- TMPL_VAR NAME="place"-->)<!--/TMPL_IF--> <!-- TMPL_IF NAME="publicationyear" -->, <!-- TMPL_VAR NAME="publicationyear" --><!-- /TMPL_IF -->
     </span>
     <!-- /TMPL_IF -->
-    
+
     <!-- TMPL_IF NAME="pages" --><span class="results_summary"><span class="label">Physical details:</span> <!-- TMPL_VAR NAME="pages" --> <!-- TMPL_VAR NAME="illus" --> <!-- TMPL_VAR NAME="size" --></span><!-- /TMPL_IF -->
 
     <!-- TMPL_IF name="normalized_isbn" -->
@@ -144,7 +144,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
         <!-- TMPL_VAR NAME="collectiontitle" -->
         <!-- TMPL_IF name="collectionissn" -->, ISSN <!-- TMPL_VAR NAME="collectionissn" -->    <!-- /TMPL_IF -->
         <!-- TMPL_IF name="collectionvolume" -->; <!-- TMPL_VAR NAME="collectionvolume" --> <!-- /TMPL_IF -->
-        
+
     </span>
     <!-- /TMPL_IF -->
     <!-- TMPL_IF name="unititles" -->
@@ -152,19 +152,19 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
         <!-- TMPL_LOOP name="unititles" -->
         <!-- TMPL_VAR NAME="unititle" --> ;
         <!-- /TMPL_LOOP -->
-        
+
     </span>
     <!-- /TMPL_IF -->
 
     <!-- TMPL_IF NAME="MARCSUBJCTS" -->
-            <span class="results_summary"><span class="label">Subject(s):</span> 
+            <span class="results_summary"><span class="label">Subject(s):</span>
                 <!-- TMPL_LOOP NAME="MARCSUBJCTS" -->
                     <!-- TMPL_LOOP NAME="MARCSUBJECT_SUBFIELDS_LOOP" -->
-                        <!-- TMPL_VAR NAME="separator" --><a title="$<!-- TMPL_VAR NAME="code" --> <!-- TMPL_VAR NAME="value" -->" href="/cgi-bin/koha/opac-search.pl?q=<!-- TMPL_LOOP NAME="link_loop" --><!-- TMPL_VAR NAME="operator" ESCAPE="URL" --><!-- TMPL_VAR NAME="limit" ESCAPE="URL" -->:<!-- TMPL_VAR NAME="link" ESCAPE="URL" --><!-- /TMPL_LOOP -->"><!-- TMPL_VAR NAME="value" --></a><!-- /TMPL_LOOP -->
+                        <!-- TMPL_VAR NAME="separator" --><a title="$<!-- TMPL_VAR NAME="code" --> <!-- TMPL_VAR NAME="value" -->" href="/cgi-bin/koha/opac-search.pl?idx=<!-- TMPL_VAR NAME="limit" ESCAPE="URL" -->&amp;q=<!-- TMPL_LOOP NAME="link_loop" --><!-- TMPL_VAR NAME="operator" ESCAPE="URL" --><!-- TMPL_VAR NAME="link" ESCAPE="URL" --><!-- /TMPL_LOOP -->"><!-- TMPL_VAR NAME="value" --></a><!-- /TMPL_LOOP -->
         <!-- TMPL_IF NAME="__LAST__" --><!-- TMPL_ELSE -->|<!-- /TMPL_IF -->
                 <!-- /TMPL_LOOP --></span>
     <!-- TMPL_ELSE -->
-    <!-- TMPL_IF name="subjects" --><span class="results_summary"><span class="label">Subject(s):</span> <!-- TMPL_LOOP name="subjects" --><a href="/cgi-bin/koha/opac-search.pl?q=su:<!-- TMPL_VAR NAME="subject" escape="URL" -->"><!-- TMPL_VAR NAME="subject" --></a> | <!-- /TMPL_LOOP --></span><!-- /TMPL_IF -->
+    <!-- TMPL_IF name="subjects" --><span class="results_summary"><span class="label">Subject(s):</span> <!-- TMPL_LOOP name="subjects" --><a href="/cgi-bin/koha/opac-search.pl?idx=su&amp;q=<!-- TMPL_VAR NAME="subject" escape="URL" -->"><!-- TMPL_VAR NAME="subject" --></a> | <!-- /TMPL_LOOP --></span><!-- /TMPL_IF -->
     <!-- /TMPL_IF -->
 
     <!-- TMPL_IF name="copyrightdate" -->
@@ -183,11 +183,11 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
     <div class="results_summary"><span class="label">Online Resources:</span>
     <ul>    <!-- TMPL_LOOP name="MARCURLS" -->
         <li><!-- TMPL_IF NAME="part" --><!-- TMPL_VAR NAME="part" -->
-            <br /><!-- /TMPL_IF --> 
+            <br /><!-- /TMPL_IF -->
         <!-- here you might do a tmpl_if name="toc" and use greybox or equivalent for table of contents -->
-        
+
         <!-- TMPL_IF NAME="OPACURLOpenInNewWindow" --><a href="<!-- TMPL_VAR NAME="MARCURL" -->" title="<!-- TMPL_VAR NAME="MARCURL" -->" target="_blank"><!-- TMPL_ELSE --><a href="<!-- TMPL_VAR NAME="MARCURL" -->" title="<!-- TMPL_VAR NAME="MARCURL" -->"><!-- /TMPL_IF -->
-        
+
         <!-- TMPL_VAR NAME="linktext" --></a>
             <!-- TMPL_IF NAME="notes" --><ul><!-- TMPL_LOOP NAME="notes" --><li><!-- TMPL_VAR NAME="note" --></li><!-- /TMPL_LOOP --></ul><!-- /TMPL_IF --></li>
             <!-- /TMPL_LOOP --></ul>
@@ -207,21 +207,21 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
 <!-- This puts the LTFL reviews in, and if TabbedView is not set, puts the remaining content above the Tabs instead of in them -->
 <!-- TMPL_IF NAME="LibraryThingForLibrariesID" -->
 	<!-- TMPL_UNLESS NAME = "LibraryThingForLibrariesTabbedView" -->
-		<div class="results_summary"><div id="ltfl_related" class="ltfl"></div></div> 
-		<div class="results_summary"><div id="ltfl_similars" class="ltfl"></div></div> 
-		<div class="results_summary"><div id="ltfl_tagbrowse" class="ltfl"></div></div> 
+		<div class="results_summary"><div id="ltfl_related" class="ltfl"></div></div>
+		<div class="results_summary"><div id="ltfl_similars" class="ltfl"></div></div>
+		<div class="results_summary"><div id="ltfl_tagbrowse" class="ltfl"></div></div>
 	<!-- /TMPL_UNLESS -->
 	<span class="results_summary">
-        <span class="label">Reviews from LibraryThing.com:</span>	
+        <span class="label">Reviews from LibraryThing.com:</span>
         <span style="display: block;" class="ltfl_reviews"></span>
     </span>
-<!-- /TMPL_IF --> 
+<!-- /TMPL_IF -->
 
 <!--This grabs all of the lists a bib record appears in -->
 <!-- TMPL_IF NAME="GetShelves" -->
 	<span class="results_summary"><span class="label">List(s) this item appears in: </span>
 	<!-- TMPL_LOOP NAME="GetShelves" -->
-		<a href="/cgi-bin/koha/opac-shelves.pl?viewshelf=<!-- TMPL_VAR NAME="shelfnumber" -->&sortfield=title"><!-- TMPL_VAR NAME="shelfname" --></a> 
+		<a href="/cgi-bin/koha/opac-shelves.pl?viewshelf=<!-- TMPL_VAR NAME="shelfnumber" -->&sortfield=title"><!-- TMPL_VAR NAME="shelfname" --></a>
 		<!-- TMPL_IF NAME="__LAST__" --><!-- TMPL_ELSE -->|<!-- /TMPL_IF -->
 	<!-- /TMPL_LOOP -->
 	</span>
@@ -234,7 +234,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
             <ul><!-- TMPL_LOOP NAME="TagLoop" -->
             <li><a href="/cgi-bin/koha/opac-search.pl?tag=<!-- TMPL_VAR NAME="term" ESCAPE="URL" -->&amp;q=<!-- TMPL_VAR NAME="term" ESCAPE="URL" -->"><!-- TMPL_VAR NAME="term" ESCAPE="HTML" --></a> <span class="weight">(<!-- TMPL_VAR NAME="weight_total" -->)</span></li>
             <!-- /TMPL_LOOP -->
-            </ul><!-- TMPL_ELSE --><span class="label">Tags from this library:</span><div>No tags from this library for this title.</div> 
+            </ul><!-- TMPL_ELSE --><span class="label">Tags from this library:</span><div>No tags from this library for this title.</div>
         <!-- /TMPL_IF -->
         <!-- TMPL_IF NAME="TagsInputOnDetail" -->
             <!-- TMPL_IF NAME="loggedinusername" -->
@@ -285,7 +285,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
 
 <div id="bibliodescriptions" class="toptabs">
 
-<ul>   
+<ul>
 <li<!-- TMPL_IF EXPR="defaulttab eq 'holdings'"  --> class="ui-tabs-selected"<!-- /TMPL_IF -->><a href="/cgi-bin/koha/opac-detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->#holdings">Holdings
     ( <!-- TMPL_VAR NAME="count" --> )</a>
    </li>
@@ -305,7 +305,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
  <li> <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->#anotes">About the Author</a></li>
 <!-- /TMPL_IF --><!-- /TMPL_IF -->
 <!-- /TMPL_IF -->
-<!-- TMPL_IF NAME="LibraryThingForLibrariesID" --> 
+<!-- TMPL_IF NAME="LibraryThingForLibrariesID" -->
 <!-- TMPL_IF NAME="LibraryThingForLibrariesTabbedView" -->
 <li> <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->#LFTLSimilarItems">Similar Items</a></li>
 <li> <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->#LTFLTagBrowse">Tag Browser</a></li>
@@ -319,7 +319,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
 <!-- TMPL_IF NAME="OPACAmazonEnabled" --><!-- TMPL_IF NAME="OPACAmazonSimilarItems" --><!-- TMPL_IF NAME="AMAZON_SIMILAR_PRODUCTS" --><li><a href="/cgi-bin/koha/opac-detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->#similars">Related</a></li><!-- /TMPL_IF --><!-- /TMPL_IF --><!-- /TMPL_IF -->
 
     <!-- TMPL_IF NAME="OPACFRBRizeEditions" --><!-- TMPL_IF NAME="XISBNS" --><li><a href="/cgi-bin/koha/opac-detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->#editions">Editions</a></li><!-- /TMPL_IF --><!-- /TMPL_IF -->
-    
+
     <!-- TMPL_IF NAME="OPACAmazonEnabled" --><!-- TMPL_IF NAME="OPACAmazonReviews" --><li><a href="/cgi-bin/koha/opac-detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->#amazonreviews">Amazon Reviews</a></li><!-- /TMPL_IF --><!-- /TMPL_IF -->
     <!-- TMPL_IF NAME="Babeltheque" --><li><a href="/cgi-bin/koha/opac-detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->#babeltheque">Babelthèque</a></li><!-- /TMPL_IF -->
 
@@ -429,7 +429,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
 <div id="shelfbrowser">
 <h5 style="text-align: center;"><!-- TMPL_IF NAME="starting_homebranch" -->Browsing <!-- TMPL_VAR NAME="starting_homebranch" --> Shelves<!-- /TMPL_IF --><!-- TMPL_IF NAME="starting_location" -->, Shelving Location:</span><!-- TMPL_VAR NAME="starting_location" --> <!-- /TMPL_IF --> <a style="font-size: 75%;" href="/cgi-bin/koha/opac-detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">Close Shelf Browser</a></h5>
 
-        
+
         <table><tr>
         <td rowspan="2" style="width:20px;"><a style="height: 10em;" href="/cgi-bin/koha/opac-detail.pl?biblionumber=<!-- TMPL_IF NAME="shelfbrowser_prev_biblionumber" --><!-- TMPL_VAR NAME="shelfbrowser_prev_biblionumber" --><!-- TMPL_ELSE --><!-- TMPL_VAR NAME="biblionumber" --><!-- /TMPL_IF -->&amp;shelfbrowse_itemnumber=<!-- TMPL_VAR NAME="shelfbrowser_prev_itemnumber" -->#shelfbrowser"><img src="/opac-tmpl/prog/images/browse-prev.gif" alt="Previous" border="0" /></a></td>
 <!-- TMPL_LOOP NAME="PREVIOUS_SHELF_BROWSE" -->
@@ -468,7 +468,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
 <!-- /TMPL_LOOP -->
 </tr>
 </table>
-        
+
 </div>
 <!-- /TMPL_IF -->
 <br clear="all" />
@@ -620,9 +620,9 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
     </div>
     <!-- /TMPL_IF -->
 
-<!-- TMPL_IF NAME="LibraryThingForLibrariesID"--> 
+<!-- TMPL_IF NAME="LibraryThingForLibrariesID"-->
 <!-- TMPL_IF NAME="LibraryThingForLibrariesTabbedView"-->
-	<!-- Library Thing for Libraries Content --> 
+	<!-- Library Thing for Libraries Content -->
 		<div id="LFTLSimilarItems">
 			<div class="content_set">
 	<!-- Uncommenting this span makes the font smaller in the tab for LTFL -->
@@ -712,7 +712,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
 
 </td>
 <td><!-- TMPL_VAR NAME="description" --></td><td><a href="/cgi-bin/koha/opac-detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->"><!-- TMPL_VAR NAME="title" escape="html" --></a><!-- TMPL_IF NAME="author" --> by <!-- TMPL_VAR NAME="author" ESCAPE="HTML" --><!-- /TMPL_IF --><!-- TMPL_IF NAME="copyrightdate" --> &copy;<!-- TMPL_VAR NAME="copyrightdate" --><!-- /TMPL_IF --><!-- TMPL_IF name="publishercode" -->
-    <p><!-- TMPL_VAR NAME="publishercode" ESCAPE="HTML" --> 
+    <p><!-- TMPL_VAR NAME="publishercode" ESCAPE="HTML" -->
        <!-- TMPL_IF name="place" -->(<!-- TMPL_VAR NAME="place"-->)<!--/TMPL_IF--> <!-- TMPL_IF NAME="publicationyear" -->, <!-- TMPL_VAR NAME="publicationyear" --><!-- /TMPL_IF -->
         <!-- TMPL_IF NAME="pages" --><!-- TMPL_VAR NAME="pages" --> <!-- TMPL_VAR NAME="illus" --> <!-- TMPL_VAR NAME="size" --></p><!-- /TMPL_IF -->
     <!-- /TMPL_IF --></td>
@@ -823,7 +823,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
         <option value="dc">Dublin Core (XML)</option>
         <option value="marcxml">MARCXML</option>
         <option value="marc8">MARC (non-Unicode/MARC-8)</option>
-        <option value="utf8">MARC (Unicode/UTF-8)</option>    
+        <option value="utf8">MARC (Unicode/UTF-8)</option>
         <option value="mods">MODS (XML)</option>
         <option value="ris">RIS</option>
 		</select><input type="hidden" name="op" value="export" /><input type="hidden" name="bib" value="<!-- TMPL_VAR NAME="biblionumber" -->" />
@@ -838,7 +838,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
 </div>
 </div>
 </div>
-<!-- TMPL_IF NAME="LibraryThingForLibrariesID" --> 
-<script src="http://ltfl.librarything.com/forlibraries/widget.js?systype=koha&amp;id=<!--TMPL_VAR NAME="LibraryThingForLibrariesID" -->" type="text/javascript"></script><noscript>This page contains enriched content visible when JavaScript is enabled or by clicking <a href="http://www.librarything.com/forlibraries/noscript.php?id=<!-- TMPL_VAR NAME="LibraryThingForLibrariesID" -->&amp;accessibility=1">here</a>.</noscript> 
-<!-- /TMPL_IF --> 
+<!-- TMPL_IF NAME="LibraryThingForLibrariesID" -->
+<script src="http://ltfl.librarything.com/forlibraries/widget.js?systype=koha&amp;id=<!--TMPL_VAR NAME="LibraryThingForLibrariesID" -->" type="text/javascript"></script><noscript>This page contains enriched content visible when JavaScript is enabled or by clicking <a href="http://www.librarything.com/forlibraries/noscript.php?id=<!-- TMPL_VAR NAME="LibraryThingForLibrariesID" -->&amp;accessibility=1">here</a>.</noscript>
+<!-- /TMPL_IF -->
 <!-- TMPL_INCLUDE NAME="opac-bottom.inc" -->
diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl
index f0a7288..8f743ba 100755
--- a/opac/opac-detail.pl
+++ b/opac/opac-detail.pl
@@ -77,7 +77,7 @@ if (C4::Context->preference("XSLTDetailsDisplay") ) {
         'XSLTBloc' => XSLTParse4Display($biblionumber, $record, 'Detail'),'opac' );
 }
 
-$template->param('OPACShowCheckoutName' => C4::Context->preference("OPACShowCheckoutName") ); 
+$template->param('OPACShowCheckoutName' => C4::Context->preference("OPACShowCheckoutName") );
 # change back when ive fixed request.pl
 my @all_items = &GetItemsInfo( $biblionumber, 'opac' );
 my @items;
@@ -187,7 +187,7 @@ for my $itm (@items) {
           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);
@@ -307,7 +307,7 @@ foreach my $sc_field (@sc_fields) {
     $row_data{text}    = $sc_field->subfield('r');
     $row_data{branch}  = $sc_field->subfield('9');
 
-    if ($row_data{text} && $row_data{branch}) { 
+    if ($row_data{text} && $row_data{branch}) {
 	push (@serialcollections, \%row_data);
     }
 }
@@ -425,18 +425,18 @@ if ( C4::Context->preference("SyndeticsEnabled")
 }
 
 # LibraryThingForLibraries ID Code and Tabbed View Option
-if( C4::Context->preference('LibraryThingForLibrariesEnabled') ) 
-{ 
+if( C4::Context->preference('LibraryThingForLibrariesEnabled') )
+{
 $template->param(LibraryThingForLibrariesID =>
-C4::Context->preference('LibraryThingForLibrariesID') ); 
+C4::Context->preference('LibraryThingForLibrariesID') );
 $template->param(LibraryThingForLibrariesTabbedView =>
 C4::Context->preference('LibraryThingForLibrariesTabbedView') );
-} 
+}
 
 
 # Babelthèque
 if ( C4::Context->preference("Babeltheque") ) {
-    $template->param( 
+    $template->param(
         Babeltheque => 1,
     );
 }
@@ -456,9 +456,9 @@ if (C4::Context->preference("OPACShelfBrowser")) {
         $starting_homebranch->{description} = $branches->{$result->{'homebranch'}}{branchname};
         $starting_location->{code} = $result->{'location'};
         $starting_location->{description} = GetAuthorisedValueDesc('','',   $result->{'location'} ,'','','LOC', 'opac');
-    
+
     }
-    
+
     ## List of Previous Items
     # order by cn_sort, which should include everything we need for ordering purposes (though not
     # for limits, those need to be handled separately
@@ -497,7 +497,7 @@ if (C4::Context->preference("OPACShelfBrowser")) {
         }
         unshift @previous_items, $this_item;
     }
-    
+
     ## List of Next Items; this also intentionally catches the current item
     my $sth_shelfbrowse_next;
     if (defined $starting_location->{code}) {
@@ -534,11 +534,11 @@ if (C4::Context->preference("OPACShelfBrowser")) {
         }
         push @next_items, $this_item;
     }
-    
+
     # alas, these won't auto-vivify, see http://www.perlmonks.org/?node_id=508481
     my $shelfbrowser_next_itemnumber = $next_items[-1]->{itemnumber} if @next_items;
     my $shelfbrowser_next_biblionumber = $next_items[-1]->{biblionumber} if @next_items;
-    
+
     $template->param(
         starting_homebranch => $starting_homebranch->{description},
         starting_location => $starting_location->{description},
@@ -597,13 +597,13 @@ my $defaulttab;
 switch (C4::Context->preference('opacSerialDefaultTab')) {
 
     # If the user wants subscriptions by default
-    case "subscriptions" { 
+    case "subscriptions" {
 	# And there are subscriptions, we display them
 	if ($subscriptionsnumber) {
 	    $defaulttab = 'subscriptions';
 	} else {
 	   # Else, we try next option
-	   next; 
+	   next;
 	}
     }
 
@@ -617,7 +617,7 @@ switch (C4::Context->preference('opacSerialDefaultTab')) {
 
     case "holdings" {
 	if ($dat->{'count'} > 0) {
-	   $defaulttab = 'holdings'; 
+	   $defaulttab = 'holdings';
 	} else {
 	     # As this is the last option, we try other options if there are no items
 	     if ($subscriptionsnumber) {
-- 
1.6.0.4




More information about the Koha-patches mailing list