Bugzilla – Attachment 192316 Details for
Bug 41604
Impossible to hide Checkin column in issues-table in circ/circulation.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41604: Centralize visibility condition in datatables.js
e89cfac.patch (text/plain), 3.76 KB, created by
Jonathan Druart
on 2026-02-02 13:07:36 UTC
(
hide
)
Description:
Bug 41604: Centralize visibility condition in datatables.js
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2026-02-02 13:07:36 UTC
Size:
3.76 KB
patch
obsolete
>From e89cfacc7642c83f4126f94326ad29f80dfc98b5 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 2 Feb 2026 14:05:41 +0100 >Subject: [PATCH] Bug 41604: Centralize visibility condition in datatables.js > >We want to hide column if: > * the feature is not accessible (pref disabled or insufficient > permissions) >or > * the column is hidden in the settings >or > * the column has been hidden by the user >--- > koha-tmpl/intranet-tmpl/prog/js/checkouts.js | 27 +++++++------------ > koha-tmpl/intranet-tmpl/prog/js/datatables.js | 20 ++++++++------ > 2 files changed, 22 insertions(+), 25 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >index 7fbf09cdd2e..17667731952 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >@@ -36,36 +36,29 @@ 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" > ); >- >- if (!AllowCirculate) { >- renew_column.is_hidden = 1; >- renew_column.force_visibility = 1; >- } else { >- renew_column.is_hidden = 0; >- } >+ renew_column.visibility_condition = AllowCirculate; > renew_column.force_visibility = 1; > >+ let checkin_column = table_settings_issues_table.columns.find( >+ c => c.columnname == "checkin" >+ ); >+ checkin_column.visibility_condition = AllowCirculate; >+ checkin_column.force_visibility = 1; >+ > let claims_returned_column = table_settings_issues_table.columns.find( > c => c.columnname == "claims_returned" > ); >- if (!ClaimReturnedLostValue) { >- claims_returned_column.is_hidden = 1; >- } else { >- claims_returned_column.is_hidden = 0; >- } >+ claims_returned_column.visibility_condition = ClaimReturnedLostValue; > claims_returned_column.force_visibility = 1; > > let export_column = table_settings_issues_table.columns.find( > c => c.columnname == "export" > ); >- if (!exports_enabled) { >- export_column.is_hidden = 1; >- } else { >- export_column.is_hidden = 0; >- } >+ export_column.visibility_condition = exports_enabled; > export_column.force_visibility = 1; > > issuesTable = $("#issues-table").kohaTable( >diff --git a/koha-tmpl/intranet-tmpl/prog/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >index 7b6dde8a7c6..596c119a4f1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >@@ -994,14 +994,18 @@ function _dt_force_visibility(table_settings, table_dt, state) { > .join(",") > ) > .every(function () { >- state.columns[this.index()].visible = >- table_settings.columns.find( >- c => >- c.columnname == >- this.header().getAttribute("data-colname") >- ).is_hidden >- ? false >- : true; >+ let column = table_settings.columns.find( >+ c => >+ c.columnname == >+ this.header().getAttribute("data-colname") >+ ); >+ if ( >+ !column.visibility_condition || >+ (column.is_hidden && column.cannot_be_toggled) >+ ) { >+ state.columns[this.index()].visible = false; >+ state.columns[this.index()].cannot_be_toggled = true; >+ } > }); > } else { > throw new Error( >-- >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 41604
:
191480
|
191482
| 192316