Bugzilla – Attachment 78012 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: Add filter/search options to notices table
Bug-21216-Add-filtersearch-options-to-notices-tabl.patch (text/plain), 5.85 KB, created by
Owen Leonard
on 2018-08-20 11:32:43 UTC
(
hide
)
Description:
Bug 21216: Add filter/search options to notices table
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2018-08-20 11:32:43 UTC
Size:
5.85 KB
patch
obsolete
>From 5e4e3e6bacb8aaa295bc061edd176e9ede117ec1 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Sun, 19 Aug 2018 15:19:49 -0400 >Subject: [PATCH] Bug 21216: Add filter/search options to notices table > >This patch adds a DataTables toolbar to the Notices & slips table, >including a filter field, column visibility, and data export options. > >To test, apply the patch and clear your browser cache if necessary. > > - Go to Tools -> Notices & slips > - Confirm that there is a table toolbar with a filter, a "Column > visibility" button, and "Excel," "CSV," "Copy," and "Print" buttons. > - Confirm that showing and hiding columns via the button is working > correctly. > - Confirm that only the first four columns are sortable. > >Go to Administration -> Columns settings. > >- Expand the "Tools" section. >- Find "id=lettert." >- Make some selections to configure default settings of the reports > table. >- Return to reports and confirm that these defaults are applied. >--- > admin/columns_settings.yml | 18 ++++++++++++++++++ > .../prog/en/modules/admin/columns_settings.tt | 6 ++++++ > .../intranet-tmpl/prog/en/modules/tools/letter.tt | 4 ++++ > koha-tmpl/intranet-tmpl/prog/js/letter.js | 19 ++++++++++++------- > 4 files changed, 40 insertions(+), 7 deletions(-) > >diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml >index 6f7022d..9c26b6b 100644 >--- a/admin/columns_settings.yml >+++ b/admin/columns_settings.yml >@@ -564,3 +564,21 @@ modules: > columnname: serial_status > - > columnname: serial_notes >+ >+ tools: >+ notices: >+ lettert: >+ - >+ columnname: library >+ - >+ columnname: module >+ - >+ columnname: code >+ - >+ columnname: name >+ - >+ columnname: copy_notice >+ - >+ columnname: actions >+ cannot_be_toggled: 1 >+ cannot_be_modified: 1 >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/columns_settings.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/columns_settings.tt >index a5624c6..efa9d4d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/columns_settings.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/columns_settings.tt >@@ -145,6 +145,12 @@ > [% PROCESS pagelist module=modules.members modulename="members" %] > </div> > >+ <h3><a href="#tools">Tools</a></h3> >+ <div id="tools"> >+ <h4>Tools tables</h4> >+ [% PROCESS pagelist module=modules.tools modulename="tools" %] >+ </div> >+ > <h3><a href="#opac">OPAC</a></h3> > <div id="opac"> > <h4>OPAC tables</h4> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >index b72639d..a6bbff2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >@@ -2,6 +2,7 @@ > [% USE Asset %] > [% USE Koha %] > [% USE Branches %] >+[% USE ColumnsSettings %] > [% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Tools › Notices[% IF ( add_form or copy_form ) %][% IF ( modify ) %] › Modify notice[% ELSE %] › Add notice[% END %][% END %][% IF ( add_validate or copy_validate) %] › Notice added[% END %][% IF ( delete_confirm ) %] › Confirm deletion[% END %]</title> >@@ -446,6 +447,7 @@ > [% MACRO jsinclude BLOCK %] > [% Asset.js("js/tools-menu.js") | $raw %] > [% INCLUDE 'datatables.inc' %] >+ [% INCLUDE 'columns_settings.inc' %] > [% Asset.js("lib/jquery/plugins/jquery.fixFloat.js") | $raw %] > [% Asset.js("lib/jquery/plugins/jquery.insertatcaret.js") | $raw %] > <script> >@@ -462,6 +464,8 @@ > var MSG_EMPTY_TITLE_AND_CONTENT = _("Please specify title and content for %s"); > var MSG_EMPTY_TEMPLATES = _("Please fill at least one template."); > var MSG_LOADING = _("Loading"); >+ var MSG_NO_NOTICE_FOUND = _("No matching notices found"); >+ var columns_settings = [% ColumnsSettings.GetColumns( 'tools', 'notices', 'lettert', 'json' ) | $raw %]; > </script> > [% Asset.js("js/letter.js") | $raw %] > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/letter.js b/koha-tmpl/intranet-tmpl/prog/js/letter.js >index 4415d19..953a35b 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 dataTablesDefaults 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 */ >+/* 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 */ > > var modal_loading = "<div id=\"loading\"><img src=\"" + interface + "/" + theme + "/img/spinner-small.gif\" alt=\"\" /> "+ MSG_DT_LOADING_RECORDS +"</div>"; > >@@ -35,13 +35,18 @@ $(document).ready(function() { > $('#toolbar').fixFloat(); > } > >- $("#lettert:has(tbody tr)").dataTable($.extend(true, {}, dataTablesDefaults, { >- "sDom": 't', >- "aoColumnDefs": [ >- { "bSortable": false, "bSearchable": false, 'aTargets': [ 'nosort' ] } >+ var ntable = KohaTable("lettert", { >+ "autoWidth": false, >+ "paging": false, >+ "aaSorting": [[ 3, "asc" ]], >+ "columnDefs": [ >+ { "bSortable": false, "aTargets": [ "nosort" ] }, >+ { "sType": "title-string", "aTargets" : [ "title-string"] } > ], >- "bPaginate": false >- })); >+ "oLanguage": { >+ "sZeroRecords": MSG_NO_NOTICE_FOUND >+ }, >+ }, columns_settings); > > if( no_op_set ){ > $('#branch').change(function() { >-- >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