Bugzilla – Attachment 113425 Details for
Bug 26963
Improve Koha::Item::pickup_locations performance
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26963: Cache pickup locations for biblio level holds in the template
Bug-26963-Cache-pickup-locations-for-biblio-level-.patch (text/plain), 3.69 KB, created by
Andrew Fuerste-Henry
on 2020-11-10 17:17:03 UTC
(
hide
)
Description:
Bug 26963: Cache pickup locations for biblio level holds in the template
Filename:
MIME Type:
Creator:
Andrew Fuerste-Henry
Created:
2020-11-10 17:17:03 UTC
Size:
3.69 KB
patch
obsolete
>From 16979614603468165a615f12534b63c44f704471 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 10 Nov 2020 10:50:57 +0000 >Subject: [PATCH] Bug 26963: Cache pickup locations for biblio level holds in > the template > >When determining pickup locations for holds that have not specified an itemnumber we will get the same >results for each hold. This patch simply places the list of libraries into a template variable and reuses >it for each hold > >To test: >1 - Have several title level holds with varying pickup locations >2 - Have some libraries that are not pickup locations >3 - View the holds table for the biblio with the holds >4 - Observe the dropdowns load correctly >5 - Apply patch >6 - Verify there are no changes > >Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> > >Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org> >--- > koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc | 10 +++++++++- > koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc | 2 +- > 2 files changed, 10 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc >index 2e1a49d683..535623ef42 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc >@@ -24,6 +24,7 @@ > > [% SET first_priority = 0 %] > [% SET last_priority = holds.last.priority %] >+ [% SET next_available_locations = "" %] > > [% FOREACH hold IN holds %] > [% IF !hold.found && first_priority == 0 %][% first_priority = hold.priority %][% END %] >@@ -133,7 +134,14 @@ > [% Branches.GetName(hold.branchcode) | html %] <input type="hidden" name="pickup" value="[% hold.branchcode | html %]" /> > [% ELSE %] > <select name="pickup"> >- [% PROCESS options_for_libraries libraries => Branches.pickup_locations( { search_params => { item => hold.itemnumber, biblio => hold.biblionumber, patron => hold.patron }, selected => hold.branchcode }) %] >+ [% IF !hold.itemnumber %] >+ [% IF next_available_locations == "" %] >+ [% SET next_available_locations = Branches.pickup_locations( { search_params => { item => hold.itemnumber, biblio => hold.biblionumber, patron => hold.patron } } ) %] >+ [% END %] >+ [% PROCESS options_for_libraries libraries => next_available_locations, selected => hold.branchcode %] >+ [% ELSE %] >+ [% PROCESS options_for_libraries libraries => Branches.pickup_locations( { search_params => { item => hold.itemnumber, biblio => hold.biblionumber, patron => hold.patron }, selected => hold.branchcode }) %] >+ [% END %] > </select> > [% END %] > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc >index 86eab2547f..f7de696737 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc >@@ -1,6 +1,6 @@ > [% BLOCK options_for_libraries %] > [% FOREACH l IN libraries %] >- [% IF l.selected %] >+ [% IF l.selected || selected == l.branchcode %] > <option value="[% prefix | html %][% l.branchcode | html %]" selected="selected">[% l.branchname | html %]</option> > [% ELSE %] > <option value="[% prefix | html %][% l.branchcode | html %]">[% l.branchname | html %]</option> >-- >2.11.0
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 26963
:
113282
|
113283
|
113329
|
113330
|
113333
|
113339
|
113340
|
113419
|
113420
|
113422
|
113423
|
113424
|
113425
|
113451
|
113452
|
113453
|
113454
|
113455
|
113480
|
113481
|
113483
|
113498
|
113503
|
113504
|
113505
|
113506
|
113507
|
113508
|
113509
|
113510
|
113511
|
113512
|
113513
|
113514
|
113515
|
113516
|
113517
|
113518
|
113519
|
113520
|
113521
|
113523
|
113524
|
113525
|
113526
|
113527
|
113528
|
113529
|
113530
|
113531
|
113586
|
113729