From fcf33a39d79c71e8df5d847edbfa9e58301e9f6c Mon Sep 17 00:00:00 2001 From: Nick Clemens 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 --- 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 40b28e3954..4540f1defe 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 %] [% ELSE %] [% 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 35386127db..81af48aff1 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 %] [% ELSE %] -- 2.11.0