From 98819d32551c13aa42924b8be982b81a4a35bbc6 Mon Sep 17 00:00:00 2001 From: tonnesen Date: Tue, 29 Oct 2002 16:48:51 +0000 Subject: [PATCH] Bug fixes... some found through new catalog.t test! --- C4/Search.pm | 22 +++++------ circ/returns.pl | 5 +-- circ/selectbranchprinter.pl | 4 +- delbiblio.pl | 2 +- .../default/en/catalogue/subject.tmpl | 38 ++++++++++++++++++- 5 files changed, 52 insertions(+), 19 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index 8aff7adf1d..f66bfa1227 100755 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -824,13 +824,10 @@ sub CatSearch { my ($env,$type,$search,$num,$offset)=@_; my $dbh = &C4Connect; my $query = ''; - my @results; - # FIXME - Why not just - # $search->{'title'} = quotemeta($search->{'title'}) - # to escape all questionable characters, not just single-quotes? - $search->{'title'}=~ s/'/\\'/g; - $search->{'author'}=~ s/'/\\'/g; - $search->{'illustrator'}=~ s/'/\\'/g; + my @results; + $search->{'title'} = quotemeta($search->{'title'}); + $search->{'author'} = quotemeta($search->{'author'}); + $search->{'illustrator'} = quotemeta($search->{'illustrator'}); my $title = lc($search->{'title'}); if ($type eq 'loose') { @@ -959,7 +956,7 @@ sub CatSearch { } elsif ($search->{'abstract'} ne ''){ $query.= "Select * from biblio where abstract like '%$search->{'abstract'}%'"; } - $query .=" group by biblio.biblionumber"; + ($query) && ($query .=" group by biblio.biblionumber"); } } if ($type eq 'subject'){ @@ -1037,7 +1034,7 @@ if ($type ne 'precise' && $type ne 'subject'){ if ($search->{'author'} ne ''){ $query=$query." order by biblio.author,title"; } else { - $query=$query." order by title"; + ($query) && ($query.=" order by title"); } } else { if ($type eq 'subject'){ @@ -1045,6 +1042,8 @@ if ($type ne 'precise' && $type ne 'subject'){ } } #print STDERR "$query\n"; + +($query) || (return); my $sth=$dbh->prepare($query); $sth->execute; my $count=1; @@ -1244,7 +1243,7 @@ sub ItemInfo { or items.itemlost is NULL) and (wthdrawn <> 1 or wthdrawn is NULL)"; } - $query .= " order by items.dateaccessioned desc"; + ($query) && ($query .= " order by items.dateaccessioned desc"); #warn $query; my $sth=$dbh->prepare($query); $sth->execute($biblionumber); @@ -1695,7 +1694,8 @@ order by returndate desc, timestamp desc"; $sth2->execute || die $sth2->errstr; - for (my $i2 = 0; $i2 < 2; $i2++) { + + for (my $i2 = 0; $i2 < (($sth2->rows<2) ? ($sth2->rows) : (2)); $i2++) { if (my $data2 = $sth2->fetchrow_hashref) { $data->{"timestamp$i2"} = $data2->{'timestamp'}; $data->{"card$i2"} = $data2->{'cardnumber'}; diff --git a/circ/returns.pl b/circ/returns.pl index 3339ba01da..d4cc4c8596 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -49,9 +49,8 @@ my $printer = $query->param("printer"); ($branch) || ($branch=$query->cookie('branch')) ; ($printer) || ($printer=$query->cookie('printer')) ; -($branches->{$branch}) || ($branch=(keys %$branches)[0]); -($printers->{$printer}) || ($printer=(keys %$printers)[0]); - +($branch) || ($branch=(keys %$branches)[0]); +($printer) || ($printer=(keys %$printers)[0]); # # Some code to handle the error if there is no branch or printer setting..... diff --git a/circ/selectbranchprinter.pl b/circ/selectbranchprinter.pl index 2e51c22cfd..391631f961 100644 --- a/circ/selectbranchprinter.pl +++ b/circ/selectbranchprinter.pl @@ -49,8 +49,8 @@ my $printer=$query->param('printer'); ($branch) || ($branch=$query->cookie('branch')); ($printer) || ($printer=$query->cookie('printer')); -($branches->{$branch}) || ($branch=(keys %$branches)[0]); -($printers->{$printer}) || ($printer=(keys %$printers)[0]); +($branch) || ($branch=(keys %$branches)[0]); +($printer) || ($printer=(keys %$printers)[0]); # is you force a selection.... diff --git a/delbiblio.pl b/delbiblio.pl index 19c19e0932..65c2cfbc18 100755 --- a/delbiblio.pl +++ b/delbiblio.pl @@ -51,5 +51,5 @@ if ($count > 0){ "; } else { delbiblio($biblio); - print $input->redirect("/catalogue/"); + print $input->redirect("/cgi-bin/koha/catalogue-home.pl"); } diff --git a/koha-tmpl/intranet-tmpl/default/en/catalogue/subject.tmpl b/koha-tmpl/intranet-tmpl/default/en/catalogue/subject.tmpl index 72cccdb35e..e36bba0c93 100644 --- a/koha-tmpl/intranet-tmpl/default/en/catalogue/subject.tmpl +++ b/koha-tmpl/intranet-tmpl/default/en/catalogue/subject.tmpl @@ -12,6 +12,28 @@
+ + + &&type=opacintra> + + + + + + -highlight.gif> + + &&type=opacintra>.gif border=0> + + + + &&type=opacintra> + + + + +

+ + bgcolor=#99cccc background=/images/background-opac.gif background="/images/background-mem.gif"> @@ -23,9 +45,21 @@ bgcolor=#99cccc background=/images/background-opac.gif background="/images/background-mem.gif"> -- 2.39.5
Subject
- &startfrom=>Previous Records + + &&type=opacintra>Previous Records + +   + + - &startfrom=>Next Records + + + &&type=opacintra>Next Records + +   + + +