From 5586df5604ccc269cc603615f96469964eb42b8f Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 9 Aug 2023 17:39:45 +0000 Subject: [PATCH] Bug 34509: Use select2 to load vendors on basket creation This patch moves the dropdown to use select2 and avoids loading all vendors at page load. To test: 1 - Create some extra vendors in your system, ideally over 20 2 - Search for a vendor in acquisitions 3 - Click 'New->basket' 4 - Note the dropdown of all vendors 5 - Choose a vendor and create a basket 6 - Apply patch 7 - Repeat 8 - Note only a partial list of vendors is loaded 9 - Search in the dropdown and confirm vendors are returned 10 - Select a vendor and create the basket --- acqui/basketheader.pl | 4 -- .../prog/en/modules/acqui/basketheader.tt | 57 ++++++++++++++++--- 2 files changed, 49 insertions(+), 12 deletions(-) diff --git a/acqui/basketheader.pl b/acqui/basketheader.pl index e79daa70a7..4cf1736715 100755 --- a/acqui/basketheader.pl +++ b/acqui/basketheader.pl @@ -116,9 +116,6 @@ if ( $op eq 'add_form' ) { $template->param(contractloop => \@contractloop, basketcontractnumber => $basket->{'contractnumber'}); } - my $booksellers = Koha::Acquisition::Booksellers->search( - undef, - { order_by => { -asc => 'name' } } ); $template->param( add_form => 1, basketname => $basket->{'basketname'}, @@ -127,7 +124,6 @@ if ( $op eq 'add_form' ) { booksellername => $bookseller->name, booksellerid => $booksellerid, basketno => $basketno, - booksellers => $booksellers, is_standing => $basket->{is_standing}, create_items => $basket->{create_items}, ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketheader.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketheader.tt index 88dd4cb354..643aefdf02 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketheader.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketheader.tt @@ -82,14 +82,8 @@
  • + +
  • @@ -163,6 +157,53 @@ [% MACRO jsinclude BLOCK %] [% Asset.js("js/acquisitions-menu.js") | $raw %] [% Asset.js("js/acq.js") | $raw %] + [% INCLUDE 'select2.inc' %] + [% END %] [% INCLUDE 'intranet-bottom.inc' %] -- 2.30.2