X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=opac%2Fopac-user.pl;h=c16eaaf1779a7b27c4d7c56456da42c6b4769c7a;hb=9a54047b6d10eb4b553ad29c6130a1e276252fe5;hp=772b7f34d0a5abf04dd4829faf0855a076f92b6d;hpb=3502810346d5e2b24417c47638f2ee42dd5c61d7;p=koha_gimpoz diff --git a/opac/opac-user.pl b/opac/opac-user.pl index 772b7f34d0..c16eaaf177 100755 --- a/opac/opac-user.pl +++ b/opac/opac-user.pl @@ -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; @@ -25,6 +27,8 @@ use C4::Koha; use C4::Circulation; use C4::Reserves; use C4::Members; +use C4::Members::AttributeTypes; +use C4::Members::Attributes qw/GetBorrowerAttributeValue/; use C4::Output; use C4::Biblio; use C4::Items; @@ -32,6 +36,8 @@ use C4::Dates qw/format_date/; use C4::Letters; use C4::Branch; # GetBranches +use constant ATTRIBUTE_SHOW_BARCODE => 'SHOW_BCODE'; + my $query = new CGI; BEGIN { @@ -106,7 +112,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 ) { @@ -165,6 +171,13 @@ $template->param( issues_count => $count ); $template->param( OVERDUES => \@overdues ); $template->param( overdues_count => $overdues_count ); +my $show_barcode = C4::Members::AttributeTypes::AttributeTypeExists( ATTRIBUTE_SHOW_BARCODE ); +if ($show_barcode) { + my $patron_show_barcode = GetBorrowerAttributeValue($borrowernumber, ATTRIBUTE_SHOW_BARCODE); + undef $show_barcode if defined($patron_show_barcode) && !$patron_show_barcode; +} +$template->param( show_barcode => 1 ) if $show_barcode; + # load the branches my $branches = GetBranches(); my @branch_loop; @@ -193,6 +206,7 @@ foreach my $res (@reserves) { 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'}; @@ -225,7 +239,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'};