-my $count2=@results;
-if ($keyword ne '' && $offset > 0){
- $count2=$count-$offset;
- if ($count2 > 10){
- $count2=10;
- }
-}
-#print $count2;
-my $i=0;
-my $colour=1;
-while ($i < $count2){
-# print $results[$i]."\n";
-# my @stuff=split('\t',$results[$i]);
- my $result=$results[$i];
- $result->{'title'}=~ s/\`/\\\'/g;
- my $title2=$result->{'title'};
- $title2=~ s/ /%20/g;
- my $location='';
- my $itemcount;
- if ($subject eq ''){
- $result->{'title'}=mklink("/cgi-bin/koha/detail.pl?type=$type&bib=$result->{'biblionumber'}&title=$title2",$result->{'title'});
- 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;
- my $url="/cgi-bin/koha/search.pl?author=$word&type=$type";
- $result->{'author'}=mklink($url,$result->{'author'});
- my ($count,$lcount,$nacount,$fcount,$scount,$lostcount,$mending,$transit,$ocount)=itemcount($env,$result->{'biblionumber'},$type);
- $itemcount=$count;
- ####
- # Fix this chunk below, remove all hardcoded branch references
- # need to fix itemcount as well
- ###
- if ($nacount > 0){
- $location=$location."On Loan";
- if ($nacount >1 ){
- $location=$location." ($nacount)";
- }
- $location.=" ";
- }
- if ($lcount > 0){
- $location=$location."Levin";
- if ($lcount >1 ){
- $location=$location." ($lcount)";
- }
- $location.=" ";
- }
- if ($fcount > 0){
- $location=$location."Foxton";
- if ($fcount >1 ){
- $location=$location." ($fcount)";
- }
- $location.=" ";
- }
- if ($scount > 0){
- $location=$location."Shannon";
- if ($scount >1 ){
- $location=$location." ($scount)";
- }
- $location.=" ";
- }
- if ($lostcount > 0){
- $location=$location."Lost";
- if ($lostcount >1 ){
- $location=$location." ($lostcount)";
- }
- $location.=" ";
- }
- if ($mending > 0){
- $location=$location."Mending";
- if ($mending >1 ){
- $location=$location." ($mending)";
- }
- $location.=" ";
- }
- if ($transit > 0){
- $location=$location."In Transiit";
- if ($transit >1 ){
- $location=$location." ($transit)";
- }
- $location.=" ";
- }
- if ($ocount > 0){
- $location=$location."On Order";
- if ($ocount >1 ){
- $location=$location." ($ocount)";
- }
- $location.=" ";
- }
-
-# if ($type ne 'opac'){
-# $result->{'request'}=mklink("/cgi-bin/koha/request.pl?bib=$stuff[2]","Request");
-# }
- } else {
- my $word=$result->{'subject'};
- $word=~ s/ /%20/g;
-
- $result->{'title'}=mklink("/cgi-bin/koha/subjectsearch.pl?subject=$word&type=$type",$result->{'subject'});