#1255 : flagged patron can't renew
authorPaul POULAIN <paul@koha-fr.org>
Fri, 12 Oct 2007 08:05:33 +0000 (03:05 -0500)
committerJoshua Ferraro <jmf@liblime.com>
Fri, 12 Oct 2007 12:24:28 +0000 (07:24 -0500)
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
koha-tmpl/opac-tmpl/prog/en/opac-user.tmpl
opac/opac-user.pl

index 1c7f1e5..ac6549f 100644 (file)
         <th colspan="2">Title</th>
         <th>Call No.</th>
         <th>Due</th>
-        <th>Renew</th>
+        <!-- TMPL_UNLESS name="patron_flagged" --><th>Renew</th><!-- /TMPL_UNLESS -->
         <th>Fines</th>
         </tr>
         <!-- TMPL_LOOP NAME="ISSUES" -->
                 <!-- TMPL_ELSE -->
                     <td><!-- TMPL_VAR NAME="date_due" --></td>
                 <!-- /TMPL_IF -->
+                <!-- TMPL_UNLESS name="patron_flagged" -->
                 <td>
                     <!-- TMPL_IF NAME="status" -->
                         <a href="/cgi-bin/koha/opac-renew.pl?from=opac_user&amp;item=<!-- TMPL_VAR NAME="itemnumber" -->&amp;borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->">Renew</a>
                         Not renewable
                     <!-- /TMPL_IF -->
                 </td>
+                <!-- /TMPL_UNLESS -->
                 <td><!-- TMPL_IF NAME="charges" -->Yes<!-- TMPL_ELSE -->No<!-- /TMPL_IF --></td>
             </tr>
         <!-- /TMPL_LOOP -->
index a6f385f..78bdd71 100755 (executable)
@@ -55,7 +55,8 @@ $borr->{'ethnicity'}    = fixEthnicity( $borr->{'ethnicity'} );
 if ( $borr->{'debarred'} || $borr->{'gonenoaddress'} || $borr->{'lost'} ) {
     $borr->{'flagged'} = 1;
 }
-
+# $make flagged available everywhere in the template
+my $patron_flagged = $borr->{'flagged'};
 if ( $borr->{'amountoutstanding'} > 5 ) {
     $borr->{'amountoverfive'} = 1;
 }
@@ -72,8 +73,10 @@ $borr->{'amountoutstanding'} = sprintf "%.02f", $borr->{'amountoutstanding'};
 my @bordat;
 $bordat[0] = $borr;
 
-$template->param( BORROWER_INFO  => \@bordat );
-$template->param( borrowernumber => $borrowernumber );
+$template->param(   BORROWER_INFO  => \@bordat,
+                    borrowernumber => $borrowernumber,
+                    patron_flagged => $patron_flagged,
+                );
 
 #get issued items ....
 my ($countissues,$issues) = GetPendingIssues($borrowernumber);