From fbfe0276a0e1d20b6b573c12da7c6c5e606fac5b Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Delaune?= Date: Tue, 31 Aug 2010 15:44:11 +0200 Subject: [PATCH] (MT #1654) followup : Adding jquery.tablesorter and jquery.tablesorter.pager support for auth_tag_structure.pl --- admin/auth_tag_structure.pl | 11 ++---- .../en/modules/admin/auth_tag_structure.tmpl | 38 ++++++++++++++----- 2 files changed, 33 insertions(+), 16 deletions(-) diff --git a/admin/auth_tag_structure.pl b/admin/auth_tag_structure.pl index 6314c0acfc..b6ae347271 100755 --- a/admin/auth_tag_structure.pl +++ b/admin/auth_tag_structure.pl @@ -39,7 +39,7 @@ my $offset = $input->param('offset') || 0; my $op = $input->param('op') || ''; $searchfield =~ s/\,//g; -my $pagesize = 20; + my $script_name = "/cgi-bin/koha/admin/auth_tag_structure.pl"; my $dbh = C4::Context->dbh; @@ -221,7 +221,7 @@ if ($op eq 'add_form') { } my ($count,$results)=StringSearch($searchfield,$authtypecode); my @loop_data = (); - for (my $i=$offset; $i < ($offset+$pagesize<$count?$offset+$pagesize:$count); $i++){ + for ( my $i = $offset ; $i < $count ; $i++ ) { my %row_data; # get a fresh hash for the row data $row_data{tagfield} = $results->[$i]{'tagfield'}; $row_data{liblibrarian} = $results->[$i]{'liblibrarian'}; @@ -237,15 +237,12 @@ if ($op eq 'add_form') { authtypecode => $authtypecode, ); if ($offset>0) { - my $prevpage = $offset-$pagesize; $template->param(isprevpage => $offset, - prevpage=> $prevpage, searchfield => $searchfield, ); } - if ($offset+$pagesize<$count) { - my $nextpage =$offset+$pagesize; - $template->param(nextpage =>$nextpage, + if ( $offset < $count ) { + $template->param( searchfield => $searchfield, ); } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_tag_structure.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_tag_structure.tmpl index 3b4f9c613f..5752cfeacd 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_tag_structure.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_tag_structure.tmpl @@ -4,6 +4,14 @@ FrameworkDefault Framework › New tag FrameworkDefault Framework › Confirm Deletion FrameworkDefault Framework › Data Deleted + + +