Bugzilla – Attachment 154341 Details for
Bug 34509
Cannot create baskets if too many vendors
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34509: Make select2 dropdown populate on change
Bug-34509-Make-select2-dropdown-populate-on-change.patch (text/plain), 3.59 KB, created by
Lucas Gass (lukeg)
on 2023-08-09 20:49:30 UTC
(
hide
)
Description:
Bug 34509: Make select2 dropdown populate on change
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2023-08-09 20:49:30 UTC
Size:
3.59 KB
patch
obsolete
>From 7731960c98b59be71461e32778e6a36e5dc0380b Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Wed, 9 Aug 2023 20:48:50 +0000 >Subject: [PATCH] Bug 34509: Make select2 dropdown populate on change > >--- > .../prog/en/modules/acqui/basketheader.tt | 68 +++++++++---------- > 1 file changed, 33 insertions(+), 35 deletions(-) > >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 643aefdf02..79d63b7655 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketheader.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketheader.tt >@@ -159,50 +159,48 @@ > [% Asset.js("js/acq.js") | $raw %] > [% INCLUDE 'select2.inc' %] > <script> >- >-$(document).ready(function() { >- > function display_bookseller (state) { > var $text; > $text = $('<span>'+state.text+'</span>'); >- > return $text; > }; > >- $("#basketbooksellerid").kohaSelect({ >- width: 'resolve', >- allowClear: false, >- ajax: { >- url: '/api/v1/acquisitions/vendors', >- delay: 300, // wait 300 milliseconds before triggering the request >- cache: true, >- dataType: 'json', >- data: function (params) { >- var search_term = (params.term === undefined) ? '' : params.term; >- var query = { >- "q": JSON.stringify({"name":{"-like":'%'+search_term+'%'}}), >- "_order_by": "name", >- "_page": params.page >- }; >+ $(document).ready(function() { >+ let select2 = $('#basketbooksellerid'); >+ select2.kohaSelect({ >+ width: 'resolve', >+ allowClear: false, >+ ajax: { >+ url: '/api/v1/acquisitions/vendors', >+ delay: 300, // wait 300 milliseconds before triggering the request >+ cache: true, >+ dataType: 'json', >+ data: function (params) { >+ var search_term = (params.term === undefined) ? '' : params.term; >+ var query = { >+ "q": JSON.stringify({"name":{"-like":'%'+search_term+'%'}}), >+ "_order_by": "name", >+ "_page": params.page >+ }; > >- return query; >+ return query; >+ }, >+ processResults: function (data) { >+ var results = []; >+ data.results.forEach( function ( vendor ) { >+ results.push( >+ { >+ "id": vendor.id, >+ "text": vendor.name.escapeHtml() >+ } >+ ); >+ }); >+ return { "results": results, "pagination": { "more": data.pagination.more } }; >+ } > }, >- processResults: function (data) { >- var results = []; >- data.results.forEach( function ( vendor ) { >- results.push( >- { >- "id": vendor.id.escapeHtml(), >- "text": vendor.name.escapeHtml() >- } >- ); >- }); >- return { "results": results, "pagination": { "more": data.pagination.more } }; >- } >- }, >- template: display_bookseller >+ templateResult: display_bookseller >+ }); > }); >-}); > </script> > [% END %] > >-- >2.30.2
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 34509
:
154337
|
154341
|
154732
|
154734
|
154735
|
154741