From d5cb07c4cd7af6b4c38cbf0346d132bd978f29cb Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 21 Mar 2016 09:32:39 -0400 Subject: [PATCH] Bug 13464 - Standardize the pagination class MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There are a few template which use a different wrapper class for the pagination links. These should be made consistent for a consistent style. To test, apply the patch and go to Administration -> Budgets. - On this page the pagination markup has been removed in favor of DataTables pagination. The budget tables were already sorted using DataTables, so having server-side pagination on top of that doesn't make sense. In Administration -> Class sources: - This page had pagination markup which was unused. In Authorities -> Authority search results: - Perform an authority search which will return more than one page of results. Confirm that the pagination links are correctly styled. In Search -> Item search: - Perform a search which will return more than one page of results. Confirm that the pagination links are correctly styled. Signed-off-by: Marc VĂ©ron Signed-off-by: Jonathan Druart Since the funds are all displayed (and nobody complained), it makes sense to display all budgets. --- admin/aqbudgetperiods.pl | 19 +++---------------- .../prog/en/modules/admin/aqbudgetperiods.tt | 10 +++------- .../prog/en/modules/admin/classsources.tt | 3 --- .../prog/en/modules/authorities/searchresultlist.tt | 2 +- .../prog/en/modules/catalogue/itemsearch.tt | 2 +- 5 files changed, 8 insertions(+), 28 deletions(-) diff --git a/admin/aqbudgetperiods.pl b/admin/aqbudgetperiods.pl index 653f916..2800a98 100755 --- a/admin/aqbudgetperiods.pl +++ b/admin/aqbudgetperiods.pl @@ -75,8 +75,6 @@ my $budget_period_hashref = { map { join(' ',@columns) =~ /$_/ ? ( $_ => $input- $budget_period_hashref->{budget_period_startdate} = dt_from_string( $input->param('budget_period_startdate') ); $budget_period_hashref->{budget_period_enddate} = dt_from_string( $input->param('budget_period_enddate') ); -my $activepagesize = 20; -my $inactivepagesize = 20; $searchfield =~ s/\,//g; my ($template, $borrowernumber, $cookie, $staff_flags ) = get_template_and_user( @@ -261,18 +259,14 @@ my $results = GetBudgetPeriods( { budget_period_active => 1 }, { -asc => 'budget_period_description' }, ); -my $first = ( $activepage - 1 ) * $activepagesize; -my $last = min( $first + $activepagesize - 1, scalar @{$results} - 1, ); + my @period_active_loop; -foreach my $result ( @{$results}[ $first .. $last ] ) { +foreach my $result ( @{$results} ) { my $budgetperiod = $result; $budgetperiod->{budget_active} = 1; push( @period_active_loop, $budgetperiod ); } -my $url = "aqbudgetperiods.pl"; -$url .= "?ipage=$inactivepage" if($inactivepage != 1); -my $active_pagination_bar = pagination_bar ($url, getnbpages( scalar(@$results), $activepagesize), $activepage, "apage"); # Get inactive budget periods $results = GetBudgetPeriods( @@ -280,17 +274,12 @@ $results = GetBudgetPeriods( { -desc => 'budget_period_enddate' }, ); -$first = ( $inactivepage - 1 ) * $inactivepagesize; -$last = min( $first + $inactivepagesize - 1, scalar @{$results} - 1, ); my @period_inactive_loop; -foreach my $result ( @{$results}[ $first .. $last ] ) { +foreach my $result ( @{$results} ) { my $budgetperiod = $result; $budgetperiod->{budget_active} = 1; push( @period_inactive_loop, $budgetperiod ); } -$url = "aqbudgetperiods.pl?tab=2"; -$url .= "&apage=$activepage" if($activepage != 1); -my $inactive_pagination_bar = pagination_bar ($url, getnbpages( scalar(@$results), $inactivepagesize), $inactivepage, "ipage"); my $branchloop = C4::Branch::GetBranchesLoop(); @@ -298,8 +287,6 @@ my $tab = $input->param('tab') ? $input->param('tab') - 1 : 0; $template->param( period_active_loop => \@period_active_loop, period_inactive_loop => \@period_inactive_loop, - active_pagination_bar => $active_pagination_bar, - inactive_pagination_bar => $inactive_pagination_bar, tab => $tab, branchloop => $branchloop, ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt index 27f3247..e58a21d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt @@ -112,13 +112,11 @@ tabs.tabs("option", "active", [% tab %]); [% END %] $("#activeperiodst,#inactiveperiodst").dataTable($.extend(true, {}, dataTablesDefaults, { - "sDom": 't', - "aaSorting": [], "aoColumnDefs": [ { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }, { "sType": "title-string", "aTargets" : [ "title-string" ] } ], - "bPaginate": false, + "sPaginationType": "four_button", 'bAutoWidth': false } ) ); @@ -169,8 +167,8 @@ ], 'bSort': true, 'aaSortingFixed': [[ 1, 'asc' ]], - 'bPaginate': false, - "bAutoWidth": false + "bAutoWidth": false, + "sPaginationType": "full_numbers" })); [% END %] }); @@ -573,7 +571,6 @@ [% ELSE %] No active budgets [% END %] -
[% active_pagination_bar %]
[% IF ( period_inactive_loop ) %] @@ -606,7 +603,6 @@ [% ELSE %] No inactive budgets [% END %] -
[% inactive_pagination_bar %]
[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/classsources.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/classsources.tt index c9c63a8..d0a5741 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/classsources.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/classsources.tt @@ -265,8 +265,6 @@ function CheckRuleForm(f) { [% END %] -
[% pagination_bar %]
-

Classification filing rules

[% IF ( added_rule ) %]
Added filing rule [% added_rule %]
@@ -296,7 +294,6 @@ function CheckRuleForm(f) { [% END %] -
[% pagination_bar %]
[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt index e6bd923..18cea64 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt @@ -96,7 +96,7 @@ function searchauthority() { -
[% pagination_bar %]
+
[% pagination_bar %]
[% ELSE %] No results found diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt index bc1ffb9..15cbb91 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt @@ -459,7 +459,7 @@ [% INCLUDE 'catalogue/itemsearch_items.inc' items = results %] [% END %] -
+
[% pagination_bar %]
-- 2.7.0