Bug 31735: Optimize OPAC checkouts view
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
ddc2906b77
commit
f523b0d98b
3 changed files with 15 additions and 9 deletions
|
@ -455,7 +455,7 @@
|
|||
[% IF ISSUE.renewed %]<span class="blabel label-success">Renewed!</span><br />[% END %]
|
||||
[% IF ( ISSUE.status ) %]
|
||||
[% IF ( canrenew ) %]
|
||||
<input type="checkbox" name="item" value="[% ISSUE.itemnumber | uri %]"/> <a href="/cgi-bin/koha/opac-renew.pl?from=opac_user&item=[% ISSUE.itemnumber | uri %]&borrowernumber=[% ISSUE.borrowernumber | uri %]">Renew</a>
|
||||
<input type="checkbox" name="issue" value="[% ISSUE.issue_id | uri %]"/> <a href="/cgi-bin/koha/opac-renew.pl?from=opac_user&issue=[% ISSUE.issue_id | uri %]&borrowernumber=[% ISSUE.borrowernumber | uri %]">Renew</a>
|
||||
[% END %]
|
||||
[% IF ISSUE.renewalfee > 0 %]
|
||||
<span class="renewalfee label label-warning">Fee for item type '[% ItemTypes.GetDescription( ISSUE.renewalitemtype) | html %]': [% ISSUE.renewalfee | $Price %]</span>
|
||||
|
|
|
@ -38,8 +38,8 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
|
|||
query => $query,
|
||||
type => "opac",
|
||||
}
|
||||
);
|
||||
my @items = $query->multi_param('item');
|
||||
);
|
||||
my @issues = $query->multi_param('issue');
|
||||
|
||||
my $opacrenew = C4::Context->preference("OpacRenewalAllowed");
|
||||
|
||||
|
@ -55,13 +55,19 @@ if ( $patron->category->effective_BlockExpiredPatronOpacActions
|
|||
}
|
||||
else {
|
||||
my @renewed;
|
||||
for my $itemnumber (@items) {
|
||||
my $item = Koha::Items->find($itemnumber);
|
||||
my $issues = Koha::Checkouts->search(
|
||||
{
|
||||
issue_id => { -in => \@issues }
|
||||
}, {
|
||||
prefetch => 'item'
|
||||
}
|
||||
);
|
||||
while( my $issue = $issues->next) {
|
||||
my ( $status, $error ) =
|
||||
CanBookBeRenewed( $patron, $item->checkout ); #TODO: Pass issue numbers instead
|
||||
CanBookBeRenewed( $patron, $issue );
|
||||
if ( $status == 1 && $opacrenew == 1 ) {
|
||||
AddRenewal( $borrowernumber, $itemnumber, undef, undef, undef, undef, 0 );
|
||||
push( @renewed, $itemnumber );
|
||||
AddRenewal( $borrowernumber, $issue->itemnumber, undef, undef, undef, undef, 0 );
|
||||
push( @renewed, $issue->itemnumber );
|
||||
}
|
||||
else {
|
||||
$errorstring .= $error . "|";
|
||||
|
|
|
@ -240,7 +240,7 @@ if ( $pending_checkouts->count ) { # Useless test
|
|||
$issue->{'unseencount'},
|
||||
$issue->{'unseenallowed'},
|
||||
$issue->{'unseenleft'}
|
||||
) = GetRenewCount($borrowernumber, $issue->{'itemnumber'});
|
||||
) = GetRenewCount($patron, $c->item);
|
||||
( $issue->{'renewalfee'}, $issue->{'renewalitemtype'} ) = GetIssuingCharges( $issue->{'itemnumber'}, $borrowernumber );
|
||||
$issue->{itemtype_object} = Koha::ItemTypes->find( $c->item->effective_itemtype );
|
||||
if($status && C4::Context->preference("OpacRenewalAllowed")){
|
||||
|
|
Loading…
Reference in a new issue