Fix for bug 1593: Fix item type image handling in OPAC
authorJoshua Ferraro <jmf@liblime.com>
Mon, 17 Mar 2008 22:32:27 +0000 (18:32 -0400)
committerJoshua Ferraro <jmf@liblime.com>
Mon, 17 Mar 2008 22:33:37 +0000 (17:33 -0500)
Also cleans up dates in a couple places

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
koha-tmpl/opac-tmpl/prog/en/modules/opac-readingrecord.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tmpl
opac/opac-readingrecord.pl
opac/opac-user.pl

index bad859f..aa2b06e 100644 (file)
@@ -34,7 +34,7 @@ You have never borrowed anything from this library.
 <th><!-- TMPL_UNLESS NAME="orderbytitle" --><a
 href="/cgi-bin/koha/opac-readingrecord.pl?order=title">Title</a><!--
 TMPL_ELSE -->Title<!-- /TMPL_UNLESS --></th>
-<th>Item Type</th>
+<!-- TMPL_UNLESS NAME="item-level_itypes" --><th>Item Type</th><!-- /TMPL_UNLESS -->
 <th>Call No.</th>
 <th><!-- TMPL_UNLESS NAME="orderbydate" --><a href="/cgi-bin/koha/opac-readingrecord.pl">Date</a><!-- TMPL_ELSE -->Date<!-- /TMPL_UNLESS --></th>
 </tr>
@@ -47,7 +47,7 @@ TMPL_ELSE -->Title<!-- /TMPL_UNLESS --></th>
                     <span class="item-details">
                         <!-- TMPL_VAR NAME="author" -->
                     </span></td>
-<td><!-- TMPL_VAR NAME="description" --></td>
+<!-- TMPL_UNLESS NAME="item-level_itypes" --><td><!-- TMPL_IF NAME="imageurl" --><img src="<!-- TMPL_VAR NAME="imageurl" -->" title="<!-- TMPL_VAR name="description" -->" alt="<!-- TMPL_VAR NAME="description" -->" /><!-- /TMPL_IF --> <!-- TMPL_VAR name="description" --></td><!-- /TMPL_UNLESS -->
 <td><!-- TMPL_VAR NAME="itemcallnumber" --></td>
 <td><!-- TMPL_IF NAME="returndate" --><!-- TMPL_VAR NAME="returndate" --><!-- TMPL_ELSE --><em>(Checked out)</em><!-- /TMPL_IF --></td>
 </tr>
@@ -65,4 +65,4 @@ TMPL_ELSE -->Title<!-- /TMPL_UNLESS --></th>
 <!-- TMPL_INCLUDE name="usermenu.inc" -->
 </div>
 </div>
-<!-- TMPL_INCLUDE NAME="opac-bottom.inc" -->
\ No newline at end of file
+<!-- TMPL_INCLUDE NAME="opac-bottom.inc" -->
index 447e08c..71d8c34 100644 (file)
@@ -147,7 +147,7 @@ $.tablesorter.addParser({
        <thead><tr>
                <!-- TMPL_IF NAME="AmazonContent" --><th>&nbsp;</th><!-- /TMPL_IF -->
         <th>Title</th>
-               <th>Item Type</th>
+               <!-- TMPL_UNLESS NAME="item-level_itypes" --><th>Item Type</th> <!-- /TMPL_UNLESS -->
         <th>Call No.</th>
         <th>Due</th>
         <!-- TMPL_IF name="OpacRenewalAllowed" -->
@@ -179,9 +179,9 @@ $.tablesorter.addParser({
                         <!-- TMPL_VAR NAME="author" -->
                     </span>
                 </td>
-                <td>
+                <!-- TMPL_UNLESS NAME="item-level_itypes" --><td>
                     <!-- TMPL_IF NAME="imageurl" --><img src="<!-- TMPL_VAR NAME="imageurl" -->" title="<!-- TMPL_VAR name="description" -->" alt="<!-- TMPL_VAR NAME="description" -->" /><!-- /TMPL_IF --> <!-- TMPL_VAR name="description" -->
-                </td>
+                </td><!-- /TMPL_UNLESS -->
                 <td><!-- TMPL_VAR NAME="itemcallnumber" --></td>
                 <!-- TMPL_IF NAME="overdue" -->
                     <td class="overdue"><!-- TMPL_VAR NAME="date_due" --></td>
index a63e4ab..f24af90 100755 (executable)
@@ -45,6 +45,9 @@ my ( $borr, $flags ) = GetMemberDetails( $borrowernumber );
 
 $template->param($borr);
 
+my $imgdir = getitemtypeimagesrc();
+my $itemtypes = GetItemTypes();
+
 # get the record
 my $order  = $query->param('order');
 my $order2 = $order;
@@ -89,12 +92,14 @@ for ( my $i = 0 ; $i < $count ; $i++ ) {
     $line{biblionumber}   = $issues->[$i]->{'biblionumber'};
     $line{title}          = $issues->[$i]->{'title'};
     $line{author}         = $issues->[$i]->{'author'};
-       $line{isbn}         = $issues->[$i]->{'isbn'};
+    $line{isbn}         = $issues->[$i]->{'isbn'};
     $line{itemcallnumber} = $issues->[$i]->{'itemcallnumber'};
     $line{date_due}       = format_date( $issues->[$i]->{'date_due'} );
     $line{returndate}     = format_date( $issues->[$i]->{'returndate'} );
     $line{volumeddesc}    = $issues->[$i]->{'volumeddesc'};
     $line{counter}        = $i + 1;
+    $line{'description'} = $itemtypes->{ $issues->[$i]->{'itemtype'} }->{'description'};
+    $line{imageurl}       = $imgdir."/".$itemtypes->{ $issues->[$i]->{'itemtype'}  }->{'imageurl'}; 
     push( @loop_reading, \%line );
 }
 
index 8626fda..576c911 100755 (executable)
@@ -135,6 +135,7 @@ foreach my $issue ( @$issues ) {
         $issue->{'imageurl'}    = $imgdir."/".$itemtypes->{$itemtype}->{'imageurl'};
         $issue->{'description'} = $itemtypes->{$itemtype}->{'description'};
     }
+    $issue->{date_due} = format_date($issue->{date_due});
     push @issuedat, $issue;
     $count++;
 }