Bugzilla – Attachment 144723 Details for
Bug 32496
Reduce unnecessary unblessings of objects in Circulation.pm
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32496: Optimize OPAC checkouts view
Bug-32496-Optimize-OPAC-checkouts-view.patch (text/plain), 4.12 KB, created by
David Gustafsson
on 2022-12-19 18:21:24 UTC
(
hide
)
Description:
Bug 32496: Optimize OPAC checkouts view
Filename:
MIME Type:
Creator:
David Gustafsson
Created:
2022-12-19 18:21:24 UTC
Size:
4.12 KB
patch
obsolete
>From 5b7efc84b36f14875fd7db8e18be5e1de9e5809c Mon Sep 17 00:00:00 2001 >From: David Gustafsson <david.gustafsson@ub.gu.se> >Date: Mon, 10 Oct 2022 17:18:03 +0200 >Subject: [PATCH] Bug 32496: Optimize OPAC checkouts view > >--- > .../bootstrap/en/modules/opac-user.tt | 2 +- > opac/opac-renew.pl | 20 ++++++++++++------- > opac/opac-user.pl | 2 +- > 3 files changed, 15 insertions(+), 9 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >index ca9395d8d9..3a6c0ddd58 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >@@ -405,7 +405,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> >diff --git a/opac/opac-renew.pl b/opac/opac-renew.pl >index 9e8efa0c5e..cb7f253290 100755 >--- a/opac/opac-renew.pl >+++ b/opac/opac-renew.pl >@@ -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 . "|"; >diff --git a/opac/opac-user.pl b/opac/opac-user.pl >index 2b079957b9..d59454ce0b 100755 >--- a/opac/opac-user.pl >+++ b/opac/opac-user.pl >@@ -234,7 +234,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")){ >-- >2.35.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 32496
:
144722
|
144723
|
144789
|
144804
|
145024
|
145027
|
147158
|
147162
|
150614
|
153017
|
153018
|
153517
|
153518
|
153519
|
156059
|
156060
|
156061
|
156080
|
156081
|
156082
|
156099
|
156102
|
156103