Bugzilla – Attachment 91535 Details for
Bug 23307
Add columns configuration to cataloguing/z3950_search.tt
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23307: Add columns configuration to cataloguing/z3950_search.tt
Bug-23307-Add-columns-configuration-to-cataloguing.patch (text/plain), 6.44 KB, created by
Owen Leonard
on 2019-07-15 14:58:19 UTC
(
hide
)
Description:
Bug 23307: Add columns configuration to cataloguing/z3950_search.tt
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2019-07-15 14:58:19 UTC
Size:
6.44 KB
patch
obsolete
>From e3818acd3b9281584e3c9358cce85e8202cb5593 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 12 Jul 2019 14:13:50 +0000 >Subject: [PATCH] Bug 23307: Add columns configuration to > cataloguing/z3950_search.tt > >This patch adds columns configuration to the DataTable which displays >Z39.50 search results in the cataloging module. > >The Z39.50 results screen has its own server-side paging system, so I >added some code to copy the page number information ("Page 2 / 6") to >the DataTable toolbar for a more consistent appearance. The wording of >that information has also been modified for consistency's sake. > >To test, apply the patch and restart Plack (or restart_all on >kohadevbox) > > - Go to Cataloging -> New from Z39.50/SRU. > - Perform a Z39.50 search which will return multiple pages of results. > - Confirm that the DataTable controls work correctly: Search, columns > show/hide, export. > - Confirm that the page number information is correct as you navigate > through pages of results. > > - Go to Administration -> Columns settings. > - Confirm that the columns configuration settings for the z3950_search > table in the "Cataloging" section works correctly. Changes made here > should be reflected in the table of Z39.50 search results. > > - Test other tables which use columns configuration to confirm that the > changes made in this patch doesn't disrupt their behavior. Test that > any custom columns configuration are applied. For example: > > - Administration -> Libraries > - Reports -> Saved reports > - Circulation -> Holds queue >--- > admin/columns_settings.yml | 21 +++++++++++++++++++++ > .../prog/en/includes/columns_settings.inc | 13 +++++++++---- > .../prog/en/modules/cataloguing/z3950_search.tt | 18 +++++++++++++----- > 3 files changed, 43 insertions(+), 9 deletions(-) > >diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml >index 43a2273c8c2..3c5d2a91812 100644 >--- a/admin/columns_settings.yml >+++ b/admin/columns_settings.yml >@@ -295,6 +295,27 @@ modules: > - > columnname: stocknumber > >+ z3950_search: >+ resultst: >+ - >+ columnname: server >+ - >+ columnname: title >+ - >+ columnname: author >+ - >+ columnname: date >+ - >+ columnname: edition >+ - >+ columnname: isbn >+ - >+ columnname: lccn >+ - >+ columnname: actions >+ cannot_be_toggled: 1 >+ cannot_be_modified: 1 >+ > coursereserves: > courses: > course_reserves_table: >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 abfe065afda..4c36f4b104d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc >@@ -102,11 +102,16 @@ function KohaTable(id_selector, dt_parameters, columns_settings, add_filters) { > thead_row.before(clone); > } > >- table.dataTable($.extend(true, {}, dataTablesDefaults, dt_parameters)); >+ table.DataTable($.extend(true, {}, dataTablesDefaults, dt_parameters)); > >- $(hidden_ids).each(function(index, value) { >- table.fnSetColumnVis( value, false ); >- }); >+ table.DataTable().on("column-visibility.dt", function(){ >+ if( typeof columnsInit == 'function' ){ >+ // This function can be created separately and used to trigger >+ // an event after the DataTable has loaded AND column visibility >+ // has been updated according to the table's configuration >+ columnsInit(); >+ } >+ }).columns( hidden_ids ).visible( false ); > > if ( add_filters ) { > // show a link to activate filtering >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tt >index 31bf6f89ee9..37a77bececd 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tt >@@ -2,6 +2,7 @@ > [% USE Asset %] > [% SET footerjs = 1 %] > [% USE Koha %] >+[% USE ColumnsSettings %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Z39.50/SRU search results</title> > [% INCLUDE 'doc-head-close.inc' %] >@@ -204,7 +205,7 @@ > [% IF ( show_prevbutton ) %] > <input type="button" name="changepage_prev" value="Previous page" data-currentpage="[% current_page | html %]" /> > [% END %] >- Page [% current_page | html %] / [% total_pages | html %] >+ <span id="result_pagenumbers">Showing page [% current_page | html %] of [% total_pages | html %]</span> > [% IF ( show_nextbutton ) %] > <input type="button" name="changepage_next" value="Next page" data-currentpage="[% current_page | html %]" /> > [% END %] >@@ -234,6 +235,7 @@ > [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %] > [% Asset.js("js/z3950_search.js") | $raw %] > [% INCLUDE 'datatables.inc' %] >+ [% INCLUDE 'columns_settings.inc' %] > <script> > $(document).ready(function(){ > >@@ -248,15 +250,16 @@ > }); > }); > >- $("#resultst").dataTable($.extend(true, {}, dataTablesDefaults, { >- "sDom": 't', >+ var columns_settings = [% ColumnsSettings.GetColumns( 'cataloguing', 'z3950_search', 'resultst', 'json' ) | $raw %]; >+ var thetable = KohaTable("resultst", { > "aoColumnDefs": [ >- { "aTargets": [ -1,-2,-3 ], "bSortable": false, "bSearchable": false }, >+ { "targets": [ "NoSort" ],"sortable": false,"searchable": false }, > { "aTargets": [ 1 ], "sType": "nsb-nse" }, > ], > "aaSorting": [[ 1, "asc" ]], > "bPaginate": false >- })); >+ }, columns_settings ); >+ > > /* Display actions menu anywhere the table is clicked */ > $("td").click(function(event){ >@@ -284,6 +287,11 @@ > } > }); > }); >+ >+ function columnsInit(){ >+ $(".dataTables_info").text( $("#result_pagenumbers").text() ); >+ $("#result_pagenumbers").hide(); >+ } > </script> > [% INCLUDE 'z3950_search.inc' %] > [% END %] >-- >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 23307
:
91492
|
91535
|
91879
|
92080