From d2d6af45a6405e5b38f331e92de9bf029ebbbe08 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Tue, 21 Feb 2023 04:07:25 +0000 Subject: [PATCH] Bug 8628: (follow-up) Fix search calls and table pagination --- .../intranet-tmpl/prog/en/modules/tools/signs.tt | 4 ++-- opac/opac-signs.pl | 5 ++--- tools/signs.pl | 11 ++++------- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/signs.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/signs.tt index 931079996c..e3e3569c49 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/signs.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/signs.tt @@ -451,13 +451,13 @@ "aoColumnDefs": [ { "aTargets": [ -1 ], "bSearchable": false, "bSortable": false }, ], - "sPaginationType": "four_button" + "sPaginationType": "full" })); $("#table_streams").dataTable($.extend(true, {}, dataTablesDefaults, { "aoColumnDefs": [ { "aTargets": [ -1 ], "bSearchable": false, "bSortable": false }, ], - "sPaginationType": "four_button" + "sPaginationType": "full" })); $(".detach").on("click", function(){ diff --git a/opac/opac-signs.pl b/opac/opac-signs.pl index 7434788123..91fb5d9857 100755 --- a/opac/opac-signs.pl +++ b/opac/opac-signs.pl @@ -50,8 +50,7 @@ if ( C4::Context->preference('OPACDigitalSigns') ) { $template->{VARS}->{'sign'} = Koha::Signs->find( $sign_id ); # Getting sign streams attached to sign with records - my $schema = Koha::Database->new()->schema(); - my @signstostreams = $schema->resultset('SignsToStream')->search({ 'me.sign_id' => $sign_id }, { prefetch => 'sign_stream' }); + my @signstostreams = Koha::SignsToStreams->search({ 'me.sign_id' => $sign_id }, { prefetch => 'sign_stream' })->as_list; my @changedstreams; my %record_cache = (); foreach my $s ( @signstostreams ) { @@ -106,7 +105,7 @@ if ( C4::Context->preference('OPACDigitalSigns') ) { } $template->{VARS}->{'streams'} = \@changedstreams; } else { # Display a list of all available signs - $template->{VARS}->{'signs'} = Koha::Signs->search({}); + $template->{VARS}->{'signs'} = Koha::Signs->search; } } diff --git a/tools/signs.pl b/tools/signs.pl index e243b59b97..8f8dddf7af 100755 --- a/tools/signs.pl +++ b/tools/signs.pl @@ -31,9 +31,7 @@ Allows authorized users to create and manage digital signs for the OPAC. =cut -use Koha::Sign; use Koha::Signs; -use Koha::SignStream; use Koha::SignStreams; use Koha::SignsToStreams; use Koha::Reports; @@ -176,8 +174,7 @@ if ( $op eq 'add_stream' ) { } elsif ( $op eq 'view_sign' && $sign_id ne '' ) { # Getting sign streams attached to sign with records - my $schema = Koha::Database->new()->schema(); - my @signstostreams = $schema->resultset('SignsToStream')->search({ 'me.sign_id' => $sign_id }, { prefetch => 'sign_stream' }); + my @signstostreams = Koha::SignsToStreams->search({ 'me.sign_id' => $sign_id }, { prefetch => 'sign_stream' })->as_list; my @changedstreams; foreach my $s ( @signstostreams ) { @@ -230,7 +227,7 @@ if ( $op eq 'add_stream' ) { } elsif ( $op eq 'edit_streams' && $sign_id ne '') { my $sign = Koha::Signs->find( $sign_id ); - my $streams = Koha::SignStreams->search({}); + my $streams = Koha::SignStreams->search; my $signstostreams = Koha::SignsToStreams->search({ 'sign_id' => $sign_id }); $template->param( @@ -302,8 +299,8 @@ if ( $op eq 'add_stream' ) { } else { - my @streams = Koha::SignStreams->search(); - my @signs = Koha::Signs->search(); + my @streams = Koha::SignStreams->search->as_list; + my @signs = Koha::Signs->search->as_list; $template->param( streams => \@streams, -- 2.20.1