Bug 4157: Display of barcode in checked out items in OPAC
[koha.git] / opac / opac-user.pl
index 3c73b81..23de179 100755 (executable)
@@ -1,6 +1,7 @@
 #!/usr/bin/perl
 
 # This file is part of Koha.
+# parts copyright 2010 BibLibre
 #
 # Koha is free software; you can redistribute it and/or modify it under the
 # terms of the GNU General Public License as published by the Free Software
@@ -17,6 +18,7 @@
 
 
 use strict;
+#use warnings; FIXME - Bug 2505
 
 use CGI;
 
@@ -106,7 +108,7 @@ my @issuedat;
 my $itemtypes = GetItemTypes();
 my ($issues) = GetPendingIssues($borrowernumber);
 if ($issues){
-       foreach my $issue ( sort sort { $b->{'date_due'} cmp $a->{'date_due'} } @$issues ) {
+       foreach my $issue ( sort { $b->{'date_due'} cmp $a->{'date_due'} } @$issues ) {
                # check for reserves
                my ( $restype, $res ) = CheckReserves( $issue->{'itemnumber'} );
                if ( $restype ) {
@@ -183,9 +185,17 @@ $template->param( branchloop => \@branch_loop );
 my @reserves  = GetReservesFromBorrowernumber( $borrowernumber );
 foreach my $res (@reserves) {
     $res->{'reservedate'} = format_date( $res->{'reservedate'} );
+
+    if ( $res->{'expirationdate'} ne '0000-00-00' ) {
+      $res->{'expirationdate'} = format_date( $res->{'expirationdate'} ) 
+    } else {
+      $res->{'expirationdate'} = '';
+    }
+    
     my $publictype = $res->{'publictype'};
     $res->{$publictype} = 1;
     $res->{'waiting'} = 1 if $res->{'found'} eq 'W';
+    $res->{'formattedwaitingdate'} = format_date($res->{'waitingdate'});
     $res->{'branch'} = $branches->{ $res->{'branchcode'} }->{'branchname'};
     my $biblioData = GetBiblioData($res->{'biblionumber'});
     $res->{'reserves_title'} = $biblioData->{'title'};
@@ -218,7 +228,7 @@ foreach my $res (@reserves) {
             $res->{'wait'}= 1; 
             $res->{'holdingbranch'}=$item->{'holdingbranch'};
             $res->{'biblionumber'}=$item->{'biblionumber'};
-            $res->{'barcodenumber'} = $item->{'barcode'};
+            $res->{'barcode'} = $item->{'barcode'};
             $res->{'wbrcode'} = $res->{'branchcode'};
             $res->{'itemnumber'}    = $res->{'itemnumber'};
             $res->{'wbrname'} = $branches->{$res->{'branchcode'}}->{'branchname'};