X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=opac%2Fopac-user.pl;h=5bc84c5b3f777cbf2e4b0bbe2c97a68002240b3f;hb=3d5e974f8fe5a72abc0cb59f6b954a431f9541f9;hp=e610cabc2ab2618342abc9af7ddeb30ca35271e5;hpb=37005486d361f6a9ea60912da0249eeec9734db9;p=koha-ffzg.git diff --git a/opac/opac-user.pl b/opac/opac-user.pl index e610cabc2a..5bc84c5b3f 100755 --- a/opac/opac-user.pl +++ b/opac/opac-user.pl @@ -46,6 +46,7 @@ use Koha::Patron::Messages; use Koha::Patron::Discharge; use Koha::Patrons; use Koha::Ratings; +use Koha::Recalls; use Koha::Token; use constant ATTRIBUTE_SHOW_BARCODE => 'SHOW_BCODE'; @@ -306,6 +307,16 @@ if ( $pending_checkouts->count ) { # Useless test $issue->{biblionumber} ? $my_summary_html =~ s/{BIBLIONUMBER}/$issue->{biblionumber}/g : $my_summary_html =~ s/{BIBLIONUMBER}//g; $issue->{MySummaryHTML} = $my_summary_html; } + + if ( C4::Context->preference('UseRecalls') ) { + my $maybe_recalls = Koha::Recalls->search({ biblionumber => $issue->{biblionumber}, itemnumber => [ undef, $issue->{itemnumber} ], old => 0 }); + while( my $recall = $maybe_recalls->next ) { + if ( $recall->checkout and $recall->checkout->issue_id == $issue->{issue_id} ) { + $issue->{recall} = 1; + last; + } + } + } } } my $overduesblockrenewing = C4::Context->preference('OverduesBlockRenewing'); @@ -333,6 +344,11 @@ $template->param( showpriority => $show_priority, ); +if ( C4::Context->preference('UseRecalls') ) { + my $recalls = Koha::Recalls->search( { borrowernumber => $borrowernumber, old => 0 } ); + $template->param( RECALLS => $recalls ); +} + if (C4::Context->preference('BakerTaylorEnabled')) { $template->param( BakerTaylorEnabled => 1, @@ -370,7 +386,7 @@ if ( C4::Context->preference('AllowPatronToSetCheckoutsVisibilityForGuarantor' { my @relatives; # Filter out guarantees that don't want guarantor to see checkouts - foreach my $gr ( $patron->guarantee_relationships() ) { + foreach my $gr ( $patron->guarantee_relationships->as_list ) { my $g = $gr->guarantee; push( @relatives, $g ) if $g->privacy_guarantor_checkouts; } @@ -382,7 +398,7 @@ if ( C4::Context->preference('AllowPatronToSetFinesVisibilityForGuarantor') { my @relatives_with_fines; # Filter out guarantees that don't want guarantor to see checkouts - foreach my $gr ( $patron->guarantee_relationships() ) { + foreach my $gr ( $patron->guarantee_relationships->as_list ) { my $g = $gr->guarantee; push( @relatives_with_fines, $g ) if $g->privacy_guarantor_fines; }