Bugzilla – Attachment 92818 Details for
Bug 23612
If no columns in a table can be toggled, don't show columns button
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23612: If no columns in a table can be toggled, don't show columns button
Bug-23612-If-no-columns-in-a-table-can-be-toggled-.patch (text/plain), 2.80 KB, created by
Owen Leonard
on 2019-09-13 18:20:15 UTC
(
hide
)
Description:
Bug 23612: If no columns in a table can be toggled, don't show columns button
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2019-09-13 18:20:15 UTC
Size:
2.80 KB
patch
obsolete
>From ddd545bcb25b4ec4d865f7d5ec854ab478e500d3 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 13 Sep 2019 18:10:25 +0000 >Subject: [PATCH] Bug 23612: If no columns in a table can be toggled, don't > show columns button > >This patch makes a change to the JavaScript setup for DataTables button >controls so that if there are no toggle-able buttons (or there is no >columns configuration at all) the column selection menu button will not >appear. > >To test, apply the patch and go to Administration -> Columns settings. > > - In the Administration section, find the section for the "libraries" > table. > - In the "Cannot be toggled" column, check all the checkboxes. > - Save. > - Go to Administration -> Libraries. > - At the top of the table there should be no "Columns" button, only > "Clear filter" and "Export" buttons. >--- > .../prog/en/includes/columns_settings.inc | 31 +++++++++++++--------- > 1 file changed, 19 insertions(+), 12 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc >index d7740a018ed..a5c5e0c8c6e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc >@@ -70,17 +70,25 @@ function KohaTable(id_selector, dt_parameters, columns_settings, add_filters) { > node.addClass("disabled"); > } > }, >- { >- extend: 'colvis', >- fade: 100, >- columns: included_ids, >- className: "columns_controls", >- titleAttr: _("Columns settings"), >- text: '<i class="fa fa-lg fa-gear"></i> <span class="dt-button-text">' + _("Columns") + '</span>', >- exportOptions: { >- columns: exportColumns >+ ]; >+ >+ if( included_ids.length > 0 ){ >+ dt_parameters[ "buttons" ].push( >+ { >+ extend: 'colvis', >+ fade: 100, >+ columns: included_ids, >+ className: "columns_controls", >+ titleAttr: _("Columns settings"), >+ text: '<i class="fa fa-lg fa-gear"></i> <span class="dt-button-text">' + _("Columns") + '</span>', >+ exportOptions: { >+ columns: exportColumns >+ }, > }, >- }, >+ ); >+ } >+ >+ dt_parameters[ "buttons" ].push( > { > extend: 'collection', > autoClose: true, >@@ -90,8 +98,7 @@ function KohaTable(id_selector, dt_parameters, columns_settings, add_filters) { > text: '<i class="fa fa-lg fa-download"></i> <span class="dt-button-text">' + _("Export") + '</span>', > buttons: export_buttons > } >- >- ]; >+ ); > > var table = $(selector); > if ( add_filters ) { >-- >2.11.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 23612
:
92818
|
92865
|
93457
|
93787