View | Details | Raw Unified | Return to bug 32496
Collapse All | Expand All

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt (-1 / +1 lines)
Lines 405-411 Link Here
405
                                                        [% IF ISSUE.renewed %]<span class="blabel label-success">Renewed!</span><br />[% END %]
405
                                                        [% IF ISSUE.renewed %]<span class="blabel label-success">Renewed!</span><br />[% END %]
406
                                                        [% IF ( ISSUE.status ) %]
406
                                                        [% IF ( ISSUE.status ) %]
407
                                                            [% IF ( canrenew ) %]
407
                                                            [% IF ( canrenew ) %]
408
                                                                <input type="checkbox" name="item" value="[% ISSUE.itemnumber | uri %]"/> <a href="/cgi-bin/koha/opac-renew.pl?from=opac_user&amp;item=[% ISSUE.itemnumber | uri %]&amp;borrowernumber=[% ISSUE.borrowernumber | uri %]">Renew</a>
408
                                                                <input type="checkbox" name="issue" value="[% ISSUE.issue_id | uri %]"/> <a href="/cgi-bin/koha/opac-renew.pl?from=opac_user&amp;issue=[% ISSUE.issue_id | uri %]&amp;borrowernumber=[% ISSUE.borrowernumber | uri %]">Renew</a>
409
                                                            [% END %]
409
                                                            [% END %]
410
                                                            [% IF ISSUE.renewalfee > 0 %]
410
                                                            [% IF ISSUE.renewalfee > 0 %]
411
                                                                <span class="renewalfee label label-warning">Fee for item type '[% ItemTypes.GetDescription( ISSUE.renewalitemtype) | html %]': [% ISSUE.renewalfee | $Price %]</span>
411
                                                                <span class="renewalfee label label-warning">Fee for item type '[% ItemTypes.GetDescription( ISSUE.renewalitemtype) | html %]': [% ISSUE.renewalfee | $Price %]</span>
(-)a/opac/opac-renew.pl (-7 / +13 lines)
Lines 38-45 my ( $template, $borrowernumber, $cookie ) = get_template_and_user( Link Here
38
        query           => $query,
38
        query           => $query,
39
        type            => "opac",
39
        type            => "opac",
40
	}
40
	}
41
); 
41
);
42
my @items = $query->multi_param('item');
42
my @issues = $query->multi_param('issue');
43
43
44
my $opacrenew = C4::Context->preference("OpacRenewalAllowed");
44
my $opacrenew = C4::Context->preference("OpacRenewalAllowed");
45
45
Lines 55-67 if ( $patron->category->effective_BlockExpiredPatronOpacActions Link Here
55
}
55
}
56
else {
56
else {
57
    my @renewed;
57
    my @renewed;
58
    for my $itemnumber (@items) {
58
    my $issues = Koha::Checkouts->search(
59
        my $item = Koha::Items->find($itemnumber);
59
        {
60
            issue_id => { -in => @issues }
61
        }, {
62
            prefetch => 'item'
63
        }
64
    );
65
    while( my $issue = $issues->next) {
60
        my ( $status, $error ) =
66
        my ( $status, $error ) =
61
          CanBookBeRenewed( $patron, $item->checkout ); #TODO: Pass issue numbers instead
67
          CanBookBeRenewed( $patron, $issue );
62
        if ( $status == 1 && $opacrenew == 1 ) {
68
        if ( $status == 1 && $opacrenew == 1 ) {
63
            AddRenewal( $borrowernumber, $itemnumber, undef, undef, undef, undef, 0 );
69
            AddRenewal( $borrowernumber, $issue->itemnumber, undef, undef, undef, undef, 0 );
64
            push( @renewed, $itemnumber );
70
            push( @renewed, $issue->itemnumber );
65
        }
71
        }
66
        else {
72
        else {
67
            $errorstring .= $error . "|";
73
            $errorstring .= $error . "|";
(-)a/opac/opac-user.pl (-2 / +1 lines)
Lines 234-240 if ( $pending_checkouts->count ) { # Useless test Link Here
234
            $issue->{'unseencount'},
234
            $issue->{'unseencount'},
235
            $issue->{'unseenallowed'},
235
            $issue->{'unseenallowed'},
236
            $issue->{'unseenleft'}
236
            $issue->{'unseenleft'}
237
        ) = GetRenewCount($borrowernumber, $issue->{'itemnumber'});
237
        ) = GetRenewCount($patron, $c->item);
238
        ( $issue->{'renewalfee'}, $issue->{'renewalitemtype'} ) = GetIssuingCharges( $issue->{'itemnumber'}, $borrowernumber );
238
        ( $issue->{'renewalfee'}, $issue->{'renewalitemtype'} ) = GetIssuingCharges( $issue->{'itemnumber'}, $borrowernumber );
239
        $issue->{itemtype_object} = Koha::ItemTypes->find( $c->item->effective_itemtype );
239
        $issue->{itemtype_object} = Koha::ItemTypes->find( $c->item->effective_itemtype );
240
        if($status && C4::Context->preference("OpacRenewalAllowed")){
240
        if($status && C4::Context->preference("OpacRenewalAllowed")){
241
- 

Return to bug 32496