Cleaned up formatting of dewey number before returning result from Search.pm
authortonnesen <tonnesen>
Fri, 10 May 2002 22:34:36 +0000 (22:34 +0000)
committertonnesen <tonnesen>
Fri, 10 May 2002 22:34:36 +0000 (22:34 +0000)
html-template/Search.pm
html-template/cmsdsearchresults.tmpl
html-template/search.pl

index dcd7ac8..2c7395b 100755 (executable)
@@ -279,6 +279,8 @@ sub KeywordSearch {
            ($dewey == 0) && ($dewey='');               
            ($dewey) && ($dewey.=" $subclass") ;                      
            $sth->finish;                                                        
+           $data2->{dewey}=~s/[\.0]*$//;
+           ($data2->{dewey}==0) && ($data2->{dewey}='');
            push @$resulthash, $data2;
            $res2[$i]="$data2->{'author'}\t$data2->{'title'}\t$data2->{'biblionumber'}\t$data2->{'copyrightdate'}\t$dewey";
            $i++;
index bf69663..12a19db 100644 (file)
@@ -3,16 +3,16 @@
 </head>
 <body>
 <TMPL_INCLUDE NAME="searchheader.tmpl">
-<table border=1>
-<tr><th>Title</th><th>Author</th><th>Dewey</th></tr>
+<table border=0 cellspacing=0 cellpadding=0>
+<tr bgcolor=#ccccff><th>Title</th><th>Author</th><th>Dewey</th></tr>
 <TMPL_LOOP NAME=SEARCH_RESULTS>
   <tr>
-  <td> <TMPL_VAR NAME=title> </td>
-  <td> <TMPL_VAR NAME=author> </td>
-  <td> <TMPL_VAR NAME=dewey> </td>
+  <td><TMPL_VAR NAME=title></td>
+  <td><TMPL_VAR NAME=author></td>
+  <td align=right><TMPL_VAR NAME=dewey></td>
   </tr>
 </TMPL_LOOP>
-<tr><td colspan=3><a href=search.pl?template=<TMPL_VAR NAME="template">&startfrom=<TMPL_VAR NAME="nextstartfrom">>Next Records</a></td></tr>
+<tr><td colspan=3 bgcolor=#ccccff><a href=search.pl?template=<TMPL_VAR NAME="template">&startfrom=<TMPL_VAR NAME="nextstartfrom">>Next Records</a></td></tr>
 </table>
 <hr>
 </body>
index 8bdf82e..3056dc9 100755 (executable)
@@ -28,7 +28,8 @@ my $template = HTML::Template->new(filename => $templatename, die_on_bad_params
 
 my $blah;
 my %search;
-$search{'keyword'}='bear';
+my $keyword='bear';
+$search{'keyword'}=$keyword;
 
 my ($count, $resultshash, @results) = &KeywordSearch(\$blah, 'intra', \%search, 20, $startfrom);