Bugzilla – Attachment 143780 Details for
Bug 31782
Patron autocomplete broken when using js/autocomplete/patrons.js
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31782: Fix autocomplete when duplicating orders
Bug-31782-Fix-autocomplete-when-duplicating-orders.patch (text/plain), 3.19 KB, created by
Jonathan Druart
on 2022-11-11 11:26:36 UTC
(
hide
)
Description:
Bug 31782: Fix autocomplete when duplicating orders
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2022-11-11 11:26:36 UTC
Size:
3.19 KB
patch
obsolete
>From cd43a597fb078b0a348d277655a5af0b5783c005 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 11 Nov 2022 12:16:35 +0100 >Subject: [PATCH] Bug 31782: Fix autocomplete when duplicating orders > >Test plan: >Add a new order to a basket from an existing order >Search for the order to duplicate using the "Basket created by" field >--- > .../prog/en/modules/acqui/duplicate_orders.tt | 33 +++++++++++++++---- > 1 file changed, 27 insertions(+), 6 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/duplicate_orders.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/duplicate_orders.tt >index c71f43b7e5e..953e5dec22e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/duplicate_orders.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/duplicate_orders.tt >@@ -313,7 +313,6 @@ Acquisitions › Koha > [% INCLUDE 'calendar.inc' %] > [% INCLUDE 'datatables.inc' %] > [% INCLUDE 'columns_settings.inc' %] >- [% Asset.js("js/autocomplete/patrons.js") | $raw %] > [% Asset.js("js/acq.js") | $raw %] > [% Asset.js("js/funds_sorts.js") | $raw %] > <script> >@@ -335,12 +334,34 @@ Acquisitions › Koha > }); > > [% IF op == 'search' OR op == 'select' %] >- patron_autocomplete({ >- patron_container: $("#basket_creators"), >- input_autocomplete: $("#find_patron"), >- patron_input_name: 'created_by', >- field_to_retrieve: 'borrowernumber' >+ function AddPatron( patron_name, value, container, input_name ) { >+ div = "<div id='borrower_" + value + "'>" + patron_name + " ( <a href='#' class='removePatron'><i class='fa fa-trash' aria-hidden='true'></i> " + MSG_REMOVE_PATRON + " </a> ) <input type='hidden' name='" + input_name + "' value='" + value + "' /></div>"; >+ $(container).append( div ); >+ >+ $(container).parent().show( 800 ); >+ } >+ function RemovePatron( cardnumber, container ) { >+ $( '#borrower_' + cardnumber ).remove(); >+ >+ if ( ! $(container).html() ) { >+ $(container).parent("fieldset").hide( 800 ); >+ } >+ } >+ patron_autocomplete($("#find_patron"), { >+ 'on-select-callback': function( event, ui ) { >+ var field = ui.item.borrowernumber; >+ AddPatron( ui.item.firstname + " " + ( ui.item.middle_name || "" ) + " " + ui.item.surname, field, $("#basket_creators"), 'created_by' ); >+ $("#find_patron").val('').focus(); >+ return false; >+ } >+ }); >+ $("body").on("click",".removePatron",function(e){ >+ e.preventDefault(); >+ var divid = $(this).parent().attr("id"); >+ var cardnumber = divid.replace("borrower_",""); >+ RemovePatron(cardnumber, $("#basket_creators")); > }); >+ > [% END %] > > $("#show_orders_filters, #hide_orders_filters").on('click', function(e) { >-- >2.25.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 31782
:
143778
|
143779
|
143780
|
143781
|
143782
|
143783
|
143784
|
143785
|
143806
|
143807
|
143808
|
143809