Bugzilla – Attachment 141065 Details for
Bug 28396
Call number browse pagination
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28396: Add dataTable to cn_browser
Bug-28396-Add-dataTable-to-cnbrowser.patch (text/plain), 3.38 KB, created by
Lucas Gass (lukeg)
on 2022-09-28 18:10:36 UTC
(
hide
)
Description:
Bug 28396: Add dataTable to cn_browser
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2022-09-28 18:10:36 UTC
Size:
3.38 KB
patch
obsolete
>From 4cb47bd3d21ac9db76b237d209ff5116f5b7489f Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Wed, 28 Sep 2022 18:05:29 +0000 >Subject: [PATCH] Bug 28396: Add dataTable to cn_browser > >To test: >1. Have a bunch of similar or exactly the same call numbers. I updated all mine to '123abc'. >2. Set up the cn_browser.pl plugin for some frameworks, I am usiong the default one. >3. Go to '/cgi-bin/koha/cataloguing/plugin_launcher.pl?q=123abc&plugin_name=cn_browser.pl' and search for the call number '123abc'. >4. You will see 15 results and have no way of seeing any more. >5. Apply patch, restart_all >6. Perform the search again. You should see all your results in a paginated dataTable. >--- > cataloguing/value_builder/cn_browser.pl | 9 ++------- > .../modules/cataloguing/value_builder/cn_browser.tt | 11 +++++++++++ > 2 files changed, 13 insertions(+), 7 deletions(-) > >diff --git a/cataloguing/value_builder/cn_browser.pl b/cataloguing/value_builder/cn_browser.pl >index 832ca51bf2..743232c46a 100755 >--- a/cataloguing/value_builder/cn_browser.pl >+++ b/cataloguing/value_builder/cn_browser.pl >@@ -46,7 +46,6 @@ function Click$function_name(i) { > my $launcher = sub { > my ( $params ) = @_; > my $cgi = $params->{cgi}; >- my $results_per_page = 30; > my $current_page = $cgi->param('page') || 1; > > my ( $template, $loggedinuser, $cookie ) = get_template_and_user( >@@ -61,7 +60,6 @@ my $launcher = sub { > my $sth; > my @cn; > my $query; >- my $real_limit = $results_per_page / 2; > my $rows_lt = 999; > my $rows_gt = 999; > my $search; >@@ -86,7 +84,6 @@ my $launcher = sub { > my @class_sources = Koha::ClassSources->search({ used => 1})->as_list; > > #Don't show half the results of show lt or gt >- $real_limit = $results_per_page if $search ne $q; > my $cn_sort = GetClassSort( $cn_source, undef, $search ); > > my $red = 0; >@@ -100,8 +97,7 @@ my $launcher = sub { > LEFT OUTER JOIN branches ON (branches.branchcode = homebranch) > WHERE cn_sort < ? > AND itemcallnumber != '' >- ORDER BY cn_sort DESC, itemnumber >- LIMIT $real_limit;"; >+ ORDER BY cn_sort DESC, itemnumber"; > $sth = $dbh->prepare($query); > $sth->execute($cn_sort); > while ( my $data = $sth->fetchrow_hashref ) { >@@ -130,8 +126,7 @@ my $launcher = sub { > LEFT OUTER JOIN branches ON (branches.branchcode = homebranch) > WHERE i.cn_sort >= '$cn_sort' > AND itemcallnumber != '' >- ORDER BY cn_sort, itemnumber >- LIMIT $real_limit"; >+ ORDER BY cn_sort, itemnumber"; > $sth = $dbh->prepare($query); > $sth->execute(); > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/cn_browser.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/cn_browser.tt >index dc239e2624..628716e82c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/cn_browser.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/cn_browser.tt >@@ -64,4 +64,15 @@ > </tbody> > </table> > >+[% MACRO jsinclude BLOCK %] >+ [% INCLUDE 'datatables.inc' %] >+ [% INCLUDE 'columns_settings.inc' %] >+ <script> >+ $(document).ready(function () { >+ KohaTable("cn_browser_table", { >+ "bPaginate": true >+ }); >+ }); >+ </script> >+[% END %] > [% INCLUDE 'intranet-bottom.inc' popup_window=1 %] >-- >2.30.2
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 28396
:
141065
|
141169