*** empty log message ***
[koha.git] / subjectsearch.pl
index d26be68..ebfde88 100755 (executable)
@@ -1,8 +1,28 @@
 #!/usr/bin/perl
 
+# $Id$
+
 #script to display detailed information
 #written 8/11/99
 
+
+# Copyright 2000-2002 Katipo Communications
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
 use strict;
 #use DBI;
 use C4::Search;
@@ -19,15 +39,15 @@ my $env;
 my $subject=$input->param('subject');
 #my $title=$input->param('title');
 
-my $main;                                                                                                                                 
-my $secondary;                                                                                                                            
-if ($type eq 'opac'){                                                                                                                     
-  $main='#99cccc';                                                                                                                        
-  $secondary='#efe5ef';                                                                                                                   
-} else {                                                                                                                                  
-  $main='#99cc33';                                                                                                                        
-  $secondary='#ffffcc';                                                                                                                   
-}      
+my $main;
+my $secondary;
+if ($type eq 'opac'){
+  $main='#99cccc';
+  $secondary='#efe5ef';
+} else {
+  $main='#99cc33';
+  $secondary='#ffffcc';
+}
 
 my @items=subsearch(\$blah,$subject);
 #print @items;
@@ -36,9 +56,9 @@ my $i=0;
 print center();
 print mktablehdr;
 if ($type ne 'opac'){
-  print mktablerow(5,$main,bold('TITLE'),bold('AUTHOR'),bold('COUNT'),bold('LOCATION'),' ',"/images/background-mem.gif"); 
+  print mktablerow(5,$main,bold('TITLE'),bold('AUTHOR'),bold('COUNT'),bold('LOCATION'),' ',"/images/background-mem.gif");
 } else {
-  print mktablerow(5,$main,bold('TITLE'),bold('AUTHOR'),bold('COUNT'),bold('BRANCH'),'   '); 
+  print mktablerow(5,$main,bold('TITLE'),bold('AUTHOR'),bold('COUNT'),bold('BRANCH'),'   ');
 }
 my $colour=1;
 while ($i < $count){
@@ -48,45 +68,45 @@ while ($i < $count){
   $word=~ s/ /%20/g;
   #$word=~ s/\,/\,%20/;
   $results[1]=mklink("/cgi-bin/koha/search.pl?author=$word&type=$type",$results[1]);
-  my ($count,$lcount,$nacount,$fcount,$scount)=itemcount($env,$results[2]);                                                                     
-  $results[3]=$count;                                                                                                                           
-  if ($nacount > 0){                                                                                                                          
-    $results[4]=$results[4]."On Loan";                                                                                                          
+  my ($count,$lcount,$nacount,$fcount,$scount)=itemcount($env,$results[2]);
+  $results[3]=$count;
+  if ($nacount > 0){
+    $results[4]=$results[4]."On Loan";
     if ($nacount > 1){
       $results[4].=" $nacount";
     }
     $results[4].=" ";
-  }                                                                                                                                           
-  if ($lcount > 0){                                                                                                                           
-    $results[4]=$results[4]." Levin";                                                                                                          
+  }
+  if ($lcount > 0){
+    $results[4]=$results[4]." Levin";
     if ($lcount > 1){
       $results[4].=" $lcount";
     }
     $results[4].=" ";
-  }                                                                                                                                           
-  if ($fcount > 0){                                                                                                                           
-    $results[4]=$results[4]." Foxton";                                                                                                          
+  }
+  if ($fcount > 0){
+    $results[4]=$results[4]." Foxton";
     if ($fcount > 1){
       $results[4].=" $fcount";
     }
     $results[4].=" ";
-  }                                                                                                                                           
-  if ($scount > 0){                                                                                                                           
-    $results[4]=$results[4]." Shannon";                                                                                                          
+  }
+  if ($scount > 0){
+    $results[4]=$results[4]." Shannon";
     if ($scount > 1){
       $results[4].=" $scount";
     }
     $results[4].=" ";
-  }             
+  }
   if ($type ne 'opac'){
     $results[6]=mklink("/cgi-bin/koha/request.pl?bib=$results[2]","Request");
   }
-  if ($colour == 1){                                                                          
-    print mktablerow(5,$secondary,$results[0],$results[1],$results[3],$results[4],$results[6]);                                        
-    $colour=0;                                                                   
-  } else{                                                                        
-    print mktablerow(5,'white',$results[0],$results[1],$results[3],$results[4],$results[6]);                                     
-    $colour=1;                                                                                
+  if ($colour == 1){
+    print mktablerow(5,$secondary,$results[0],$results[1],$results[3],$results[4],$results[6]);
+    $colour=0;
+  } else{
+    print mktablerow(5,'white',$results[0],$results[1],$results[3],$results[4],$results[6]);
+    $colour=1;
   }
    $i++;
 }