Bugzilla – Attachment 80409 Details for
Bug 21216
Notices - Add filter/search options to table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21216: (follow-up) Exclude some columns from export
Bug-21216-follow-up-Exclude-some-columns-from-expo.patch (text/plain), 4.14 KB, created by
Owen Leonard
on 2018-10-11 13:14:19 UTC
(
hide
)
Description:
Bug 21216: (follow-up) Exclude some columns from export
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2018-10-11 13:14:19 UTC
Size:
4.14 KB
patch
obsolete
>From fefce9d835580aadb13402cd5027a544a867cc24 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Mon, 24 Sep 2018 13:37:16 +0000 >Subject: [PATCH] Bug 21216: (follow-up) Exclude some columns from export > >This patch adds a custom buttons configuration to the Notices table so >that columns with form controls are not included in copy/print/export >operations. > >The DataTables columns settings include file has been modified >to check for an existing buttons export columns configuration before >applying the default. > >To test, apply the patch and clear your browser cache if necessary. > >Go to Tools -> Notices & slips. The table of notices should have a >DataTables toolbar with a filter form, column visibility, and export >buttons. Test the functionality of all these tools. Only the first four >columns of the table should be included in printouts and exported files. >--- > .../prog/en/includes/columns_settings.inc | 19 +++++++++++++------ > koha-tmpl/intranet-tmpl/prog/js/letter.js | 3 ++- > 2 files changed, 15 insertions(+), 7 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 636cc5a..7aa51cd 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc >@@ -1,6 +1,6 @@ > [% USE ColumnsSettings %] > >-<script type="text/javascript"> >+<script> > function KohaTable(id_selector, dt_parameters, columns_settings, add_filters) { > var counter = 0; > var hidden_ids = []; >@@ -20,41 +20,48 @@ function KohaTable(id_selector, dt_parameters, columns_settings, add_filters) { > } > counter++; > }); >+ >+ var exportColumns = ":visible"; >+ if( dt_parameters.hasOwnProperty("exportColumns") ){ >+ // A custom buttons configuration has been passed from the page >+ exportColumns = dt_parameters["exportColumns"]; >+ } >+ > dt_parameters[ "buttons" ] = [ > { > extend: 'colvis', > columns: included_ids, > text: _("Column visibility"), > exportOptions: { >- columns: ':visible' >+ columns: exportColumns > }, > }, > { > extend: 'excelHtml5', > text: _("Excel"), > exportOptions: { >- columns: ':visible' >+ columns: exportColumns > }, > }, > { > extend: 'csvHtml5', > text: _("CSV"), > exportOptions: { >- columns: ':visible' >+ columns: exportColumns > }, > }, > { > extend: 'copyHtml5', > text: _("Copy"), > exportOptions: { >- columns: ':visible' >+ columns: exportColumns > }, > }, > { > extend: 'print', > text: _("Print"), > exportOptions: { >- columns: ':visible' >+ columns: exportColumns > }, > }, > ]; >diff --git a/koha-tmpl/intranet-tmpl/prog/js/letter.js b/koha-tmpl/intranet-tmpl/prog/js/letter.js >index 953a35b..968b0d1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/letter.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/letter.js >@@ -1,5 +1,5 @@ > /* Variables defined in letter.tt: */ >-/* global _ module add_form copy_form no_op_set MSG_EMPTY_TITLE_AND_CONTENT MSG_EMPTY_TEMPLATES code MSG_CODE_EXISTS MSG_CODE_EXISTS_FOR_LIBRARY MSG_DT_LOADING_RECORDS interface theme KohaTable columns_settings */ >+/* global _ module add_form copy_form no_op_set MSG_EMPTY_TITLE_AND_CONTENT MSG_EMPTY_TEMPLATES code MSG_CODE_EXISTS MSG_CODE_EXISTS_FOR_LIBRARY MSG_DT_LOADING_RECORDS MSG_NO_NOTICE_FOUND interface theme KohaTable columns_settings */ > > var modal_loading = "<div id=\"loading\"><img src=\"" + interface + "/" + theme + "/img/spinner-small.gif\" alt=\"\" /> "+ MSG_DT_LOADING_RECORDS +"</div>"; > >@@ -46,6 +46,7 @@ $(document).ready(function() { > "oLanguage": { > "sZeroRecords": MSG_NO_NOTICE_FOUND > }, >+ "exportColumns": [0,1,2,3], > }, columns_settings); > > if( no_op_set ){ >-- >2.1.4
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 21216
:
78012
|
78040
|
79314
|
79315
|
80408
|
80409
|
80416
|
80417
|
80425
|
80426