-# print $results[$i]."\n";
-# my @stuff=split('\t',$results[$i]);
-
- my %lineres;
- my $coltab;
-
- my $result=$results[$i];
- $result->{'title'}=~ s/\`/\\\'/g;
- my $title2=$result->{'title'};
- my $author2=$result->{'author'};
- $author2=~ s/ /%20/g;
- $title2=~ s/ /%20/g;
- $title2=~ s/\#/\&\#x23;/g;
- $title2=~ s/\"/\"\;/g;
-
- my $itemcount;
- my $location='';
- my $word=$result->{'author'};
- $word=~ s/([a-z]) +([a-z])/$1%20$2/ig;
- $word=~ s/ //g;
- $word=~ s/ /%20/g;
- $word=~ s/\,/\,%20/g;
- $word=~ s/\n//g;
- $lineres{word}=$word;
- $lineres{type}=$type;
-
- my ($count,$lcount,$nacount,$fcount,$scount,$lostcount,$mending,$transit)=C4::Search::itemcount($env,$result->{'biblionumber'},$type);
- if ($nacount > 0){
- $location .= "On Loan";
- if ($nacount >1 ){
- $location .= " ($nacount)";
- }
- $location.=" ";
- }
- if ($lcount > 0){
- $location .= "Levin";
- if ($lcount >1 ){
- $location .= " ($lcount)";
- }
- $location.=" ";
- }
- if ($fcount > 0){
- $location .= "Foxton";
- if ($fcount >1 ){
- $location .= " ($fcount)";
- }
- $location.=" ";
- }
- if ($scount > 0){
- $location .= "Shannon";
- if ($scount >1 ){
- $location .= " ($scount)";
- }
- $location.=" ";
- }
- if ($lostcount > 0){
- $location .= "Lost";
- if ($lostcount >1 ){
- $location .= " ($lostcount)";
- }
- $location.=" ";
- }
- if ($mending > 0){
- $location .= "Mending";
- if ($mending >1 ){
- $location .= " ($mending)";
- }
- $location.=" ";
- }
- if ($transit > 0){
- $location .= "In Transit";
- if ($transit >1 ){
- $location .= " ($transit)";
- }
- $location.=" ";
- }
- if ($colour == 1){
- $coltab=$secondary;
- $colour=0;
- } else{
- $coltab=$main;
- $colour=1;
- }
- $lineres{author2}=$author2;
- $lineres{title2}=$title2;
- $lineres{copyright}=$result->{'copyrightdate'};
+ my %lineres;
+ my $coltab;
+
+ my $result=$results[$i];
+ $result->{'title'}=~ s/\`/\\\'/g;
+ my $title2=$result->{'title'};
+ my $author2=$result->{'author'};
+ $author2=~ s/ /%20/g;
+ $title2=~ s/ /%20/g;
+ $title2=~ s/\#/\&\#x23;/g;
+ $title2=~ s/\"/\"\;/g;
+
+ my $itemcount;
+ my $location='';
+ my $word=$result->{'author'};
+ $word=~ s/([a-z]) +([a-z])/$1%20$2/ig;
+ $word=~ s/ //g;
+ $word=~ s/ /%20/g;
+ $word=~ s/\,/\,%20/g;
+ $word=~ s/\n//g;
+ $lineres{word}=$word;
+ $lineres{type}=$type;
+
+ my ($count,$lcount,$nacount,$fcount,$scount,$lostcount,$mending,$transit)=C4::Search::itemcount($env,$result->{'biblionumber'},$type);
+ if ($nacount > 0){
+ $location .= "On Loan";
+ if ($nacount >1 ){
+ $location .= " ($nacount)";
+ }
+ $location.=" ";
+ }
+ if ($lcount > 0){
+ $location .= "Levin";
+ if ($lcount >1 ){
+ $location .= " ($lcount)";
+ }
+ $location.=" ";
+ }
+ if ($fcount > 0){
+ $location .= "Foxton";
+ if ($fcount >1 ){
+ $location .= " ($fcount)";
+ }
+ $location.=" ";
+ }
+ if ($scount > 0){
+ $location .= "Shannon";
+ if ($scount >1 ){
+ $location .= " ($scount)";
+ }
+ $location.=" ";
+ }
+ if ($lostcount > 0){
+ $location .= "Lost";
+ if ($lostcount >1 ){
+ $location .= " ($lostcount)";
+ }
+ $location.=" ";
+ }
+ if ($mending > 0){
+ $location .= "Mending";
+ if ($mending >1 ){
+ $location .= " ($mending)";
+ }
+ $location.=" ";
+ }
+ if ($transit > 0){
+ $location .= "In Transit";
+ if ($transit >1 ){
+ $location .= " ($transit)";
+ }
+ $location.=" ";
+ }
+ if ($colour == 1){
+ $coltab=$secondary;
+ $colour=0;
+ } else{
+ $coltab=$main;
+ $colour=1;
+ }
+ $lineres{author2}=$author2;
+ $lineres{title2}=$title2;
+ $lineres{copyright}=$result->{'copyrightdate'};