Fix for bug 1738, opac-reserve now blocks reserving not for loan items
authorChris Cormack <crc@liblime.com>
Mon, 7 Jan 2008 20:34:16 +0000 (14:34 -0600)
committerJoshua Ferraro <jmf@liblime.com>
Tue, 8 Jan 2008 02:02:51 +0000 (20:02 -0600)
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tmpl
opac/opac-reserve.pl

index a9b4299..5cfc276 100644 (file)
                     <!-- /TMPL_LOOP -->
             </select>
             </p>
+                       <!-- TMPL_IF NAME="forloan" -->
             <p> <label for="requestany">Place a hold on the next available copy </label>
             <input type="checkbox" id="requestany" name="request" checked="checked" value="Any" />
             </p>
+
             <input type="hidden" name="biblioitem" value="<!-- TMPL_VAR NAME="biblioitemnumber" -->" />
             <input type="submit" value="Place Hold" />
             <input type="hidden" name="all" value="1"/></p>
             <input type="hidden" name="place_reserve" value="1"/>
-
+                       <!-- /TMPL_IF -->            
         <!-- TMPL_LOOP name="bibitemloop" -->    
 
             <!-- TMPL_UNLESS NAME="item-level_itypes" -->
index 6eb8b95..7c1ad03 100755 (executable)
@@ -151,6 +151,7 @@ my %itemtypes;
 my @duedates;
 #die @items;
 my %itemhash;
+my $forloan;
 foreach my $itm (@items) {
     push @duedates, { date_due => format_date( $itm->{'date_due'} ) }
       if defined $itm->{'date_due'};
@@ -175,6 +176,9 @@ foreach my $itm (@items) {
         }
     }
        $itemhash{$itm->{'itemnumber'}}=$itm;
+       if (!$itm->{'notforloan'} && !$itm->{'itemnotforloan'}){
+               $forloan=1;
+       }
 }
 
 $template->param( ITEMS => \@duedates );
@@ -424,6 +428,7 @@ foreach my $biblioitemnumber (@biblioitemnumbers) {
 
 # display infos
 $template->param(
+       forloan           => $forloan,
     bibitemloop       => \@bibitemloop,
 );
 output_html_with_http_headers $query, $cookie, $template->output;