Bugzilla – Attachment 189992 Details for
Bug 41314
Column visibility broken on the checkouts table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41314: Fix column visibility on the checkouts table
Bug-41314-Fix-column-visibility-on-the-checkouts-t.patch (text/plain), 8.97 KB, created by
Baptiste Wojtkowski (bwoj)
on 2025-11-27 14:01:13 UTC
(
hide
)
Description:
Bug 41314: Fix column visibility on the checkouts table
Filename:
MIME Type:
Creator:
Baptiste Wojtkowski (bwoj)
Created:
2025-11-27 14:01:13 UTC
Size:
8.97 KB
patch
obsolete
>From 18458e0fd2356ca2a388ed8bef2ce2fd1fa91727 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 27 Nov 2025 11:03:45 +0100 >Subject: [PATCH] Bug 41314: Fix column visibility on the checkouts table > >Currently the column visibility is broken because the table is not using bKohaColumnsUseNames. >We should first fix that because it's a bug (and a regression certainly caused by DT's saveState, bug 33484). > >Then it will be quite trivial to move it to the table's settings. > >Column visibility must use bKohaColumnsUseNames when some columns are >displayed/hidden depending on sysprefs (or other variables). > >Test plan: >0. Do not apply this patch >1. Check an item out for a patron >2. Turn on ExportCircHistory >3. Reload the checkouts table >=> The export column is not displayed (FAIL) >4. Open the dev console (ctrl+shift+c on Firefox), Storage tab => local > storage. Remove the 2 keys (only one may exist) > DataTables_circ_circulation_issues-table > DataTables_members_moremember_issues-table >5. Reload the checkouts table >=> The export column is displayed >6. Turn off ExportCircHistory >7. Reload the checkouts table >=> The column column is displayed (FAIL) >Well, you got the idea, the syspref's value is not taken into account >when a DataTable's state already exists in the local storage. >Now apply this patch and repeat the different steps, on the two tabs > * "Check out" (circ/circulation.pl) > * "Default" (members/moremember.pl) > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com> >--- > .../en/includes/checkouts-table-footer.inc | 7 +-- > .../prog/en/includes/checkouts-table.inc | 44 +++++++++---------- > koha-tmpl/intranet-tmpl/prog/js/checkouts.js | 44 ++++++++++++++----- > 3 files changed, 55 insertions(+), 40 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc >index 498469ddc86..d6259aa8b6c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc >@@ -4,12 +4,7 @@ > <td id="totaldue" style="text-align: right;"></td> > <td id="totalfine" style="text-align: right;"></td> > <td id="totalprice" style="text-align: right;"></td> >- [% IF Koha.Preference('ExportCircHistory') %] >- [% SET td_colspan = 4 %] >- [% ELSE %] >- [% SET td_colspan = 3 %] >- [% END %] >- <td colspan="[% td_colspan | html %]"> >+ <td colspan="4"> > <div class="date-select"> > <p><label for="newduedate">Renewal due date:</label> <input type="text" size="20" id="newduedate" name="newduedate" value="" class="flatpickr" data-flatpickr-enable-time="true" /></p> > <p id="newonholdduedate" >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc >index 316b28889b3..1a4ebc5f59c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc >@@ -20,32 +20,32 @@ > <table id="issues-table" style="width: 100% !Important; display: none;"> > <thead> > <tr> >- <th scope="col"> </th> >- <th scope="col"> </th> >- <th scope="col">Due date</th> >- <th scope="col">Due date</th> >- <th scope="col">Title</th> >- <th scope="col">Record-level item type</th> >- <th scope="col">Item type</th> >- <th scope="col">Collection</th> >- <th scope="col">Location</th> >- <th scope="col">Home library</th> >- <th scope="col"> </th> >- <th scope="col">Checked out on</th> >- <th scope="col">Checked out from</th> >- <th scope="col">Call number</th> >- <th scope="col">Copy number</th> >- <th scope="col">Charge</th> >- <th scope="col">Fine</th> >- <th scope="col">Price</th> >- <th scope="col" >+ <th data-colname="sort_order" scope="col"> </th> >+ <th data-colname="todays_or_previous_checkouts" scope="col"> </th> >+ <th data-colname="due_date_unformatted" scope="col">Due date</th> >+ <th data-colname="due_date" scope="col">Due date</th> >+ <th data-colname="title" scope="col">Title</th> >+ <th data-colname="record_type" scope="col">Record-level item type</th> >+ <th data-colname="item_type" scope="col">Item type</th> >+ <th data-colname="collection" scope="col">Collection</th> >+ <th data-colname="location" scope="col">Location</th> >+ <th data-colname="homebranch" scope="col">Home library</th> >+ <th data-colname="checkout_on_unformatted" scope="col"> </th> >+ <th data-colname="checkout_on" scope="col">Checked out on</th> >+ <th data-colname="checkout_from" scope="col">Checked out from</th> >+ <th data-colname="callno" scope="col">Call number</th> >+ <th data-colname="copynumber" scope="col">Copy number</th> >+ <th data-colname="charge" scope="col">Charge</th> >+ <th data-colname="fine" scope="col">Fine</th> >+ <th data-colname="price" scope="col">Price</th> >+ <th data-colname="renew" scope="col" > >Renew <p class="column-tool"><a href="#" id="CheckAllRenewals">select all</a> | <a href="#" id="UncheckAllRenewals">none</a></p></th > > >- <th scope="col" >+ <th data-colname="checkin" scope="col" > >Check in <p class="column-tool"><a href="#" id="CheckAllCheckins">select all</a> | <a href="#" id="UncheckAllCheckins">none</a></p></th > > >- <th scope="col">Return claims</th> >- <th scope="col" >+ <th data-colname="claims_returned" scope="col">Return claims</th> >+ <th data-colname="export" scope="col" > >Export <p class="column-tool"><a href="#" id="CheckAllExports">select all</a> | <a href="#" id="UncheckAllExports">none</a></p></th > > > </tr> >diff --git a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >index f06c01b00bc..222b39a7811 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >@@ -36,24 +36,43 @@ function LoadIssuesTable() { > $("#issues-table").show(); > $("#issues-table-actions").show(); > var msg_loading = __("Loading... you may continue scanning."); >+ let renew_column = table_settings_issues_table.columns.find( >+ c => c.columnname == "renew" >+ ); >+ let checkin_column = table_settings_issues_table.columns.find( >+ c => c.columnname == "checkin" >+ ); >+ > if (!AllowCirculate) { >- table_settings_issues_table.columns.find( >- c => c.columnname == "renew" >- ).is_hidden = 42; >- table_settings_issues_table.columns.find( >- c => c.columnname == "checkin" >- ).is_hidden = 1; >+ renew_column.is_hidden = 1; >+ renew_column.force_visibility = 1; >+ } else { >+ renew_column.is_hidden = 0; >+ checkin_column.is_hidden = 0; > } >+ renew_column.force_visibility = 1; >+ checkin_column.force_visibility = 1; >+ >+ let claims_returned_column = table_settings_issues_table.columns.find( >+ c => c.columnname == "claims_returned" >+ ); > if (!ClaimReturnedLostValue) { >- table_settings_issues_table.columns.find( >- c => c.columnname == "claims_returned" >- ).is_hidden = 1; >+ claims_returned_column.is_hidden = 1; >+ } else { >+ claims_returned_column.is_hidden = 0; > } >+ claims_returned_column.force_visibility = 1; >+ >+ let export_column = table_settings_issues_table.columns.find( >+ c => c.columnname == "export" >+ ); > if (!exports_enabled) { >- table_settings_issues_table.columns.find( >- c => c.columnname == "export" >- ).is_hidden = 1; >+ export_column.is_hidden = 1; >+ } else { >+ export_column.is_hidden = 0; > } >+ export_column.force_visibility = 1; >+ > issuesTable = $("#issues-table").kohaTable( > { > language: { >@@ -665,6 +684,7 @@ function LoadIssuesTable() { > ), > }, > bKohaAjaxSVC: true, >+ bKohaColumnsUseNames: true, > rowGroup: { > dataSrc: "issued_today", > startRender: function (rows, group) { >-- >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 41314
:
189986
|
189987
| 189992