[followup] (bug #3710) all itemtypes if none selected
authorNahuel ANGELINETTI <nahuel.angelinetti@biblibre.com>
Mon, 26 Oct 2009 09:24:45 +0000 (10:24 +0100)
committerHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Tue, 3 Nov 2009 15:57:46 +0000 (16:57 +0100)
C4/Search.pm
catalogue/recentacquisitions.pl
opac/opac-recentacquisitions.pl

index 6f06ea6..dce4e2d 100644 (file)
@@ -1741,12 +1741,21 @@ sub SearchAcquisitions{
         }else{
             $str .= "AND biblioitems.itemtype=? ";
         }
+        
+        if(scalar(@$itemtypes) == 0){
+            my $itypes = GetItemTypes();
+            for my $key (keys %$itypes){
+                push @$itemtypes, $key;
+            }
+        }
+        
         @loopcriteria= @$itemtypes;
     }elsif ($criteria=~/itemcallnumber/){
         $str .= "AND (items.itemcallnumber LIKE CONCAT(?,'%') 
                  OR items.itemcallnumber is NULL
                  OR items.itemcallnumber = '')";
-        @loopcriteria = ("AA".."zz", "") unless (scalar(@loopcriteria)>0);  
+
+        @loopcriteria = ("AA".."ZZ", "") unless (scalar(@loopcriteria)>0);  
     }else {
         $str .= "AND biblio.title LIKE CONCAT(?,'%') ";
         @loopcriteria = ("A".."z") unless (scalar(@loopcriteria)>0);  
index c0cc790..7adbbb7 100755 (executable)
@@ -29,7 +29,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     }
 );
 
-my $op = $query->param('op');
+my $op = $query->param('op') || '';
 if ($op eq "show_list"){
 
     my $datebegin           = C4::Dates->new($query->param('datebegin'));
index 39d45f6..d721cdf 100755 (executable)
@@ -31,7 +31,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
 
 die() unless C4::Context->preference("OpacRecentAcquisitions");
 
-my $op = $query->param('op');
+my $op = $query->param('op') || '';
 if ($op eq "show_list"){
 
     my $datebegin           = C4::Dates->new($query->param('datebegin'));