bugfix for top issues, for branch selector
authorPaul POULAIN <paul@koha-fr.org>
Tue, 16 Oct 2007 21:02:46 +0000 (16:02 -0500)
committerJoshua Ferraro <jmf@liblime.com>
Wed, 17 Oct 2007 12:15:27 +0000 (07:15 -0500)
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>

opac/opac-topissues.pl

index 53ee77b..cc3a716 100755 (executable)
@@ -57,9 +57,9 @@ my $branch = $input->param('branch');
 my $itemtype = $input->param('itemtype');
 my $timeLimit = $input->param('timeLimit') || 3;
 my $whereclause;
-$whereclause .= 'items.homebranch='.$dbh->quote($branch)." AND " if ($branch); 
+$whereclause .= 'items.homebranch='.$dbh->quote($branch)." AND " if ($branch);
 $whereclause .= 'biblioitems.itemtype='.$dbh->quote($itemtype)." AND " if $itemtype;
-$whereclause .= 'TO_DAYS(NOW()) - TO_DAYS(biblio.datecreated) <= '.$timeLimit*30 if $timeLimit < 999;
+$whereclause .= ' TO_DAYS(NOW()) - TO_DAYS(biblio.datecreated) <= '.($timeLimit*30).' AND ' if $timeLimit < 999;
 $whereclause =~ s/ AND $//;
 $whereclause = " WHERE ".$whereclause if $whereclause;
 
@@ -100,7 +100,7 @@ for my $branch_hash (sort keys %$branches ) {
     my $selected=(C4::Context->userenv && ($branch_hash eq C4::Context->userenv->{branch})) if (C4::Context->preference('SearchMyLibraryFirst'));
     push @branch_loop,
       {
-        value      => "branch: $branch_hash",
+        value      => "$branch_hash",
         branchname => $branches->{$branch_hash}->{'branchname'},
         selected => $selected
       };