Bugzilla – Attachment 11663 Details for
Bug 8654
DataTables in Acquisition module: aqbudgetperiods.tt
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8654: Replace tablesorter by datatables in aqbudgetperiods.tt
Bug-8654-Replace-tablesorter-by-datatables-in-aqbu.patch (text/plain), 4.13 KB, created by
Julian Maurice
on 2012-08-17 14:29:34 UTC
(
hide
)
Description:
Bug 8654: Replace tablesorter by datatables in aqbudgetperiods.tt
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2012-08-17 14:29:34 UTC
Size:
4.13 KB
patch
obsolete
>From 40f8d760a05e4da6d0dfb788d015666065da9d94 Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Fri, 17 Aug 2012 16:27:16 +0200 >Subject: [PATCH] Bug 8654: Replace tablesorter by datatables in > aqbudgetperiods.tt > >--- > admin/aqbudgetperiods.pl | 35 ++++++++------------ > .../prog/en/modules/admin/aqbudgetperiods.tt | 17 +++++----- > 2 files changed, 23 insertions(+), 29 deletions(-) > >diff --git a/admin/aqbudgetperiods.pl b/admin/aqbudgetperiods.pl >index 64b333a..fbd1e86 100755 >--- a/admin/aqbudgetperiods.pl >+++ b/admin/aqbudgetperiods.pl >@@ -72,7 +72,6 @@ my $budget_period_hashref= $input->Vars; > #my $sort1_authcat = $input->param('sort1_authcat'); > #my $sort2_authcat = $input->param('sort2_authcat'); > >-my $pagesize = 20; > $searchfield =~ s/\,//g; > > my ($template, $borrowernumber, $cookie, $staff_flags ) = get_template_and_user( >@@ -245,27 +244,21 @@ elsif ( $op eq 'duplicate_budget' ){ > # DEFAULT - DISPLAY AQPERIODS TABLE > # ------------------------------------------------------------------- > # display the list of budget periods >- my $results = GetBudgetPeriods(); >- $template->param( period_button_only => 1 ) unless (@$results) ; >- my $page = $input->param('page') || 1; >- my $first = ( $page - 1 ) * $pagesize; >- # if we are on the last page, the number of the last word to display >- # must not exceed the length of the results array >- my $last = min( $first + $pagesize - 1, scalar @{$results} - 1, ); >- my $toggle = 0; >- my @period_loop; >- foreach my $result ( @{$results}[ $first .. $last ] ) { >- my $budgetperiod = $result; >- FormatData($budgetperiod); >- $budgetperiod->{'budget_period_total'} = $num->format_price( $budgetperiod->{'budget_period_total'} ); >- $budgetperiod->{budget_active} = 1; >- push( @period_loop, $budgetperiod ); >- } >+my $results = GetBudgetPeriods(); >+$template->param( period_button_only => 1 ) unless (@$results) ; >+my @period_loop; >+foreach my $result ( @$results ) { >+ my $budgetperiod = $result; >+ FormatData($budgetperiod); >+ $budgetperiod->{'budget_period_total'} = >+ $num->format_price( $budgetperiod->{'budget_period_total'} ); >+ $budgetperiod->{budget_active} = 1; >+ push( @period_loop, $budgetperiod ); >+} > >- $template->param( >- period_loop => \@period_loop, >- pagination_bar => pagination_bar("aqbudgetperiods.pl",getnbpages(scalar(@$results),$pagesize),$page), >- ); >+$template->param( >+ period_loop => \@period_loop, >+); > > $template->param($op=>1); > output_html_with_http_headers $input, $cookie, $template->output; >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 deb5442..f2fb0a6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt >@@ -1,8 +1,11 @@ > [% INCLUDE 'doc-head-open.inc' %] > [% INCLUDE 'doc-head-close.inc' %] > [% INCLUDE 'calendar.inc' %] >+<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" /> >+<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js" ></script> >+[% INCLUDE 'datatables-strings.inc' %] >+<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script> > <script type="text/javascript" src="[% themelang %]/js/acq.js"></script> >-<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script> > <script type="text/javascript"> > // ################################################################################# > // Javascript >@@ -69,13 +72,11 @@ > alert(alertString2); > } > } >- $(document).ready(function() { >- $("#periodsh").tablesorter({ >- widgets : ['zebra'], >- sortList: [[0,0]], >- headers: {6:{sorter:false}} >- }); >- }); >+ $(document).ready(function() { >+ $("#periodsh").dataTable($.extend(true, {}, dataTablesDefaults, { >+ 'sPaginationType': 'four_button' >+ })); >+ }); > </script> > > <title> >-- >1.7.10.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 8654
:
11663
|
11684