Bugzilla – Attachment 172879 Details for
Bug 38192
State not restored correctly on suggestion tables
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38192: Fix restoration of table state for suggestion tables
Bug-38192-Fix-restoration-of-table-state-for-sugge.patch (text/plain), 9.84 KB, created by
Owen Leonard
on 2024-10-17 13:51:01 UTC
(
hide
)
Description:
Bug 38192: Fix restoration of table state for suggestion tables
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2024-10-17 13:51:01 UTC
Size:
9.84 KB
patch
obsolete
>From 466aceb5f8911b410bfc0c384e0f3bbcddf8f26f Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 17 Oct 2024 12:09:23 +0200 >Subject: [PATCH] Bug 38192: Fix restoration of table state for suggestion > tables > >There is one table per tab, the id of the table is table_N. > >Say you have: >Pending (#table_1), Accepted (#table_2), Rejected (#table_3) >The state will be stored in localStorage with the following key: >DataTables_table_1_/cgi-bin/koha/suggestion/suggestion.pl >DataTables_table_2_/cgi-bin/koha/suggestion/suggestion.pl >DataTables_table_3_/cgi-bin/koha/suggestion/suggestion.pl > >If you move all the suggestions from Accepted to Rejected, a shift will >give: Pending (#table_1), Rejected (#table_2) And the previous state >from the "Accepted" tab will be used for "Rejected" > >Test plan: >Confirm the above, have several tabs then remove one by moving the >all suggestions to an other tab. > >Test the other features on the edit and list views: >change status, update manager, etc. > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > .../prog/en/modules/suggestion/suggestion.tt | 36 +++++++++---------- > 1 file changed, 18 insertions(+), 18 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 c756af32c4..13459a189a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt >@@ -736,7 +736,7 @@ > <a class="checkall" href="#">Check all</a> | <a class="uncheckall" href="#">Uncheck all</a> > </p> > >- <table id="table_[% loop.count | html %]" class="sorted" data-table-number=[% loop.count | html %]> >+ <table id="table_[% suggestion.suggestiontype | html %]" class="sorted" data-tab-name="[% suggestion.suggestiontype | html %]"> > <thead> > <tr> > <th class="NoSort noExport"> </th> >@@ -888,7 +888,7 @@ > </tr> > [% END # /FOREACH s %] > </tbody> >- </table> <!-- /#table_[% loop.count | html %] --> >+ </table> <!-- /#table_[% suggestion.suggestiontype | html %] --> > > <div class="row"> > <div class="col-sm-12"> >@@ -899,9 +899,9 @@ > [% IF CAN_user_suggestions_suggestions_manage %] > <div class="col-sm-4"> > <fieldset class="brief"> >- <div id="select-reason[% loop.index | html %]"> >- <label for="STATUSreason[% loop.index | html %]">Mark selected as: </label> >- <select name="STATUS" id="STATUSreason[% loop.index | html %]"> >+ <div id="select-reason-[% suggestion.suggestiontype | html %]"> >+ <label for="STATUSreason-[% suggestion.suggestiontype | html %]">Mark selected as: </label> >+ <select name="STATUS" id="STATUSreason-[% suggestion.suggestiontype | html %]"> > <option value=""> -- Choose a status --</option> > > [% IF (statusselected_ASKED ) %] >@@ -939,8 +939,8 @@ > [% END %] > </select> > >- <label for="choosereason[% loop.index | html %]">with this reason:</label> >- <select name="reason" id="choosereason[% loop.index | html %]"> >+ <label for="choosereason-[% suggestion.suggestiontype | html %]">with this reason:</label> >+ <select name="reason" id="choosereason-[% suggestion.suggestiontype | html %]"> > <option value=""> -- Choose a reason -- </option> > [% FOREACH reasonsloo IN suggestion.reasonsloop %] > <option value="[% reasonsloo.lib | html %]">[% reasonsloo.lib | html %]</option> >@@ -979,11 +979,11 @@ > <div class="col-sm-2"> > <fieldset class="brief"> > <span class="label">Update manager</span> >- <a href="#patron_search_modal_manager_[% loop.count | uri %]" id="set_manager_[% loop.count | uri %]" data-tab="[% loop.count | uri %]" class="set_manager" data-bs-toggle="modal"><i class="fa fa-search"></i> Select manager</a> >- <span id="managedby_name[% loop.count | html %]"></span> >+ <a href="#patron_search_modal_manager_[% suggestion.suggestiontype | uri %]" id="set_manager_[% suggestion.suggestiontype | uri %]" data-tab="[% suggestion.suggestiontype | uri %]" class="set_manager" data-bs-toggle="modal"><i class="fa fa-search"></i> Select manager</a> >+ <span id="managedby_name-[% suggestion.suggestiontype | html %]"></span> > </fieldset> > <fieldset class="action"> >- <input type="hidden" name="suggestion_managedby" id="managedby[% loop.count | html %]" value="[% logged_in_user.borrowernumber | html %]" /> >+ <input type="hidden" name="suggestion_managedby" id="managedby-[% suggestion.suggestiontype | html %]" value="[% logged_in_user.borrowernumber | html %]" /> > <input type="hidden" name="branchcode" value="[% branchfilter | html %]" /> > <input type="hidden" name="filter_archived" value="[% filter_archived | html %]" /> > <button type="submit" data-op="cud-update_manager" class="btn btn-primary">Submit</button> >@@ -1116,8 +1116,8 @@ > <fieldset class="brief suggestion_information"> > <ol> > <li> >- <label for="STATUS[% loop.index | html %]"> Status:</label> >- <select name="STATUS" id="STATUS[% loop.index | html %]"> >+ <label for="STATUS-[% suggestion.suggestiontype | html %]"> Status:</label> >+ <select name="STATUS" id="STATUS-[% suggestion.suggestiontype | html %]"> > <option value="">Any</option> > [% IF (statusselected_ASKED ) %] > <option value="ASKED" selected="selected">Pending</option> >@@ -1300,9 +1300,9 @@ > > <script> > function select_manager(borrowernumber, borrower) { >- let tab = $('#suggestiontabs .active table').data('table-number'); >- var managedby_name = $("#managedby_name"+tab); >- var managedby = $("#managedby"+tab); >+ let tab = $('#suggestiontabs .active table').data('tab-name'); >+ var managedby_name = $("#managedby_name-"+tab); >+ var managedby = $("#managedby-"+tab); > managedby_name.empty(); > managedby.val(''); > var borrowername = borrower.firstname + ' ' + borrower.surname; >@@ -1392,7 +1392,7 @@ > > [% FOREACH suggestion IN suggestions %] > [% IF suggestion.suggestions.size %] >- KohaTable("table_[% loop.count| html %]", { >+ KohaTable("table_[% suggestion.suggestiontype | html %]", { > "sorting": [[ 4, "asc" ]], > "autoWidth": false, > "stateSave": true, >@@ -1542,8 +1542,8 @@ > [% ELSIF op == 'else' %] > [% FOREACH suggestion IN suggestions %] > [% SET filter = "suggestions_managers" %] >- [% 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, actions => ["select"], preview_on_name_click => 1, table_id => 'patron_search_modal_manager_table_' _ loop.count, callback => 'select_manager' %] >+ [% PROCESS patron_search_modal columns => columns, modal_title => t("Select manager"), patron_search_modal_id => 'patron_search_modal_manager_' _ suggestion.suggestiontype, table_id => 'patron_search_modal_manager_table_' _ suggestion.suggestiontype %] >+ [% PROCESS patron_search_js columns => columns, actions => ["select"], preview_on_name_click => 1, table_id => 'patron_search_modal_manager_table_' _ suggestion.suggestiontype, callback => 'select_manager' %] > [% END %] > [% END %] > >-- >2.39.5
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 38192
:
172862
|
172868
|
172879
|
173352