Bugzilla – Attachment 161405 Details for
Bug 35329
Move patron searches to a modal
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35329: Move patron search to modal - suggestion
Bug-35329-Move-patron-search-to-modal---suggestion.patch (text/plain), 8.11 KB, created by
Martin Renvoize (ashimema)
on 2024-01-25 14:03:52 UTC
(
hide
)
Description:
Bug 35329: Move patron search to modal - suggestion
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-01-25 14:03:52 UTC
Size:
8.11 KB
patch
obsolete
>From 2a5cd79865e459582a2be0a11e1b2b2388bd82fb Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 9 Jan 2024 12:09:55 +0100 >Subject: [PATCH] Bug 35329: Move patron search to modal - suggestion > >Test plan: >Edit a suggestion >Click "Set patron" to change the suggester >Click "Select manager" to set the manager > >On the suggestion list view, you can also select a manager. Make sure >you are testing with different tabs (suggestions with different statuses). > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > .../prog/en/modules/suggestion/suggestion.tt | 58 +++++++------------ > 1 file changed, 22 insertions(+), 36 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt >index 6b8ec6aacc1..8d657bbe9a4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt >@@ -6,6 +6,7 @@ > [% USE Price %] > [% USE TablesSettings %] > [% PROCESS 'i18n.inc' %] >+[% PROCESS 'patron-search.inc' %] > [% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>[% FILTER collapse %] >@@ -507,7 +508,7 @@ > [% END %] > </td> > <td> >- <a href="#" id="edit_suggester" class="btn btn-default">Set to patron</a> >+ <a href="#patron_search_modal_suggester" id="edit_suggester" class="btn btn-default" data-toggle="modal">Set to patron</a> > </td> > </tr> > <tr> >@@ -557,7 +558,7 @@ > | Previously was [% INCLUDE 'patron-title.inc' patron=managedby_patron hide_patron_infos_if_needed=1 %] [% Branches.GetName( managedby_patron.branchcode ) | html %] ([% managedby_patron.category.description | html %]) > [% END %] > <br /> >- <a id="edit_manager" class="new_window" href="#"><i class="fa fa-search"></i> Select manager</a> >+ <a href="#patron_search_modal_manager" id="edit_manager" data-toggle="modal"><i class="fa fa-search"></i> Select manager</a> > [% IF managedby_patron.borrowernumber && logged_in_user.borrowernumber != managedby_patron.borrowernumber %] > <a id="restore_previous_manager" href="#"><i class="fa fa-trash-can"></i> Keep existing manager</a> > [% END %] >@@ -948,7 +949,7 @@ > <div class="col-sm-2"> > <fieldset class="brief"> > <span class="label">Update manager</span> >- <a id="set_manager_[% loop.count | html %]" data-tab="[% loop.count | html %]" class="set_manager" href="#"><i class="fa fa-search"></i> Select manager</a> >+ <a href="#patron_search_modal_manager_[% loop.count | uri %]" id="set_manager_[% loop.count | uri %]" data-tab="[% loop.count | uri %]" class="set_manager" data-toggle="modal"><i class="fa fa-search"></i> Select manager</a> > <span id="managedby_name[% loop.count | html %]"></span> > <input type="hidden" name="suggestion_managedby" id="managedby[% loop.count | html %]" value="[% logged_in_user.borrowernumber | html %]" /> > <input type="hidden" name="branchcode" value="[% branchfilter | html %]" /> >@@ -1252,14 +1253,6 @@ > > <script> > var tab = ''; >- function editManagerPopup(selected_tab) { >- tab = selected_tab; >- window.open("/cgi-bin/koha/members/search.pl?columns=cardnumber,name,branch,category,action&selection_type=select&callback=select_manager&filter=suggestions_managers", >- 'PatronPopup', >- 'width=1024,height=768,scrollbars=yes,toolbar=no,' >- + 'scrollbars=yes,resize=yes' >- ); >- } > function select_manager(borrowernumber, borrower) { > var managedby_name = $("#managedby_name"+tab); > var managedby = $("#managedby"+tab); >@@ -1290,14 +1283,6 @@ > [% END %] > } > >- function editSuggesterPopup() { >- window.open("/cgi-bin/koha/members/search.pl?columns=cardnumber,name,branch,category,action&selection_type=select&callback=select_suggester", >- 'PatronPopup', >- 'width=1024,height=768,scrollbars=yes,toolbar=no,' >- + 'scrollbars=yes,resize=yes' >- ); >- } >- > function select_suggester(borrowernumber, borrower) { > $.ajax({ > type: 'GET', >@@ -1320,22 +1305,6 @@ > }); > return 0; > } >- $(document).ready(function(){ >- $("#edit_manager").on("click",function(e){ >- e.preventDefault(); >- editManagerPopup(''); >- }); >- $(".set_manager").on("click",function(e){ >- e.preventDefault(); >- var selected_tab = $(this).data('tab'); >- editManagerPopup(selected_tab); >- }); >- >- $("#edit_suggester").on("click", function(e){ >- e.preventDefault(); >- editSuggesterPopup(); >- }); >- }); > </script> > > [% IF ( op == 'show' || op == 'else' ) %] >@@ -1356,7 +1325,7 @@ > $("#suggestiontabs a:first").tab("show"); > } > >- table_settings = [% TablesSettings.GetTableSettings( 'acqui', 'suggestions', 'suggestions', 'json' ) | $raw %] >+ var table_settings = [% TablesSettings.GetTableSettings( 'acqui', 'suggestions', 'suggestions', 'json' ) | $raw %] > var saved_table = localStorage.getItem("DataTables_suggestions_/cgi-bin/koha/suggestion/suggestion.pl"); > var updated_settings = get_columns_saved_state(saved_table, table_settings); > >@@ -1511,5 +1480,22 @@ > [% END %] > [% Asset.js("js/acq.js") | $raw %] > [% Asset.js("js/acquisitions-menu.js") | $raw %] >+ >+ [% INCLUDE 'select2.inc' %] >+ [% SET columns = ['cardnumber','name','category','branch','action'] %] >+ [% IF op == 'save' %] >+ [% PROCESS patron_search_modal columns => columns, modal_title => t("Select suggester"), patron_search_modal_id => 'patron_search_modal_suggester', table_id => 'patron_search_modal_suggester_table' %] >+ [% PROCESS patron_search_js columns => columns, actions => ["select"], preview_on_name_click => 1, table_id => 'patron_search_modal_suggester_table', callback => 'select_suggester' %] >+ [% PROCESS patron_search_modal columns => columns, modal_title => t("Select manager"), patron_search_modal_id => 'patron_search_modal_manager', table_id => 'patron_search_modal_manager_table' %] >+ [% PROCESS patron_search_js columns => columns, filter => 'suggestions_managers', actions => ["select"], preview_on_name_click => 1, table_id => 'patron_search_modal_manager_table', callback => 'select_manager' %] >+ [% ELSIF op == 'else' %] >+ [% FOREACH suggestion IN suggestions %] >+ <script>tab = [% loop.count | html %];</script> >+ [% PROCESS patron_search_modal columns => columns, modal_title => t("Select manager"), patron_search_modal_id => 'patron_search_modal_manager_' _ loop.count, table_id => 'patron_search_modal_manager_table_' _ loop.count %] >+ [% PROCESS patron_search_js columns => columns, filter => 'suggestions_managers', actions => ["select"], preview_on_name_click => 1, table_id => 'patron_search_modal_manager_table_' _ loop.count, callback => 'select_manager' %] >+ [% END %] >+ [% END %] >+ >+ > [% END %] > [% INCLUDE 'intranet-bottom.inc' %] >-- >2.43.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 35329
:
160698
|
160699
|
160700
|
160701
|
160702
|
160703
|
160704
|
160705
|
160706
|
160728
|
160729
|
160733
|
160734
|
160735
|
160736
|
160737
|
160738
|
160739
|
160740
|
160741
|
160742
|
160743
|
160759
|
160760
|
160761
|
160762
|
160763
|
160768
|
160769
|
160770
|
160771
|
160773
|
160774
|
160940
|
160941
|
160943
|
160944
|
160945
|
160946
|
160947
|
160948
|
160949
|
160950
|
160951
|
160952
|
160953
|
160954
|
160955
|
160956
|
160957
|
160958
|
160959
|
161165
|
161166
|
161183
|
161184
|
161185
|
161186
|
161187
|
161188
|
161189
|
161190
|
161191
|
161192
|
161193
|
161194
|
161195
|
161196
|
161197
|
161198
|
161199
|
161259
|
161260
|
161274
|
161275
|
161276
|
161277
|
161278
|
161279
|
161280
|
161281
|
161282
|
161283
|
161284
|
161285
|
161286
|
161287
|
161288
|
161289
|
161290
|
161291
|
161292
|
161293
|
161294
|
161295
|
161398
|
161399
|
161400
|
161401
|
161402
|
161403
|
161404
|
161405
|
161406
|
161407
|
161408
|
161409
|
161410
|
161411
|
161412
|
161413
|
161414
|
161415
|
161416
|
161417
|
162436
|
162437
|
162438
|
162439
|
162440
|
162441
|
162442
|
162443
|
162444
|
162445
|
162446
|
162447
|
162448
|
162449
|
162450
|
162451
|
162452
|
162453
|
162454
|
162455
|
162456
|
162457
|
162670
|
162671
|
162713
|
162714