(MT #1654) followup : Adding jquery.tablesorter and jquery.tablesorter.pager support for auth_tag_structure.pl
This commit is contained in:
parent
f1762530d1
commit
fbfe0276a0
2 changed files with 33 additions and 16 deletions
|
@ -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,
|
||||
);
|
||||
}
|
||||
|
|
|
@ -4,6 +4,14 @@
|
|||
<!-- TMPL_IF NAME="heading-add-tag-p" -->› <!-- TMPL_IF NAME="authtypecode" --><!-- TMPL_VAR NAME="authtypecode" --> Framework<!-- TMPL_ELSE -->Default Framework<!-- /TMPL_IF --> › New tag<!-- /TMPL_IF -->
|
||||
<!-- TMPL_ELSE -->› <!-- TMPL_VAR NAME="action" --><!-- /TMPL_IF --><!-- /TMPL_IF --><!-- TMPL_IF NAME="delete_confirm" -->› <!-- TMPL_IF NAME="authtypecode" --><!-- TMPL_VAR NAME="authtypecode" --> Framework<!-- TMPL_ELSE -->Default Framework<!-- /TMPL_IF --> › Confirm Deletion<!-- /TMPL_IF --><!-- TMPL_IF NAME="delete_confirmed" -->› <!-- TMPL_IF NAME="authtypecode" --><!-- TMPL_VAR NAME="authtypecode" --> Framework<!-- TMPL_ELSE -->Default Framework<!-- /TMPL_IF --> › Data Deleted<!-- /TMPL_IF --></title>
|
||||
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
|
||||
<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
|
||||
<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.tablesorter.pager.js"></script>
|
||||
<script type="text/javascript" id="js">$(document).ready(function() {
|
||||
$("#table_authtagstructure").tablesorter({
|
||||
sortList: [[0,0]],
|
||||
headers: { 5: { sorter: false},6: { sorter: false},7: { sorter: false}}
|
||||
}).tablesorterPager({container: $("#pagertable_authtagstructure"),positionFixed: false,size: 20});
|
||||
}); </script>
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -199,9 +207,27 @@ return false;
|
|||
</select>
|
||||
<input type="text" name="searchfield" value="<!-- TMPL_VAR NAME="searchfield" -->" />
|
||||
<input type="submit" value="OK" class="submit" />
|
||||
</form><br />
|
||||
<span id="pagertable_authtagstructure" class="pager">
|
||||
<form class="formpager"> <strong>page(s)</strong> :
|
||||
<img src="<!-- TMPL_VAR name="interface" -->/prog/img/first.png" class="first"/>
|
||||
<img src="<!-- TMPL_VAR name="interface" -->/prog/img/prev.png" class="prev"/>
|
||||
<input type="text" size="5" class="pagedisplay"/>
|
||||
<img src="<!-- TMPL_VAR name="interface" -->/prog/img/next.png" class="next"/>
|
||||
<img src="<!-- TMPL_VAR name="interface" -->/prog/img/last.png" class="last"/>
|
||||
, entries/page :
|
||||
<select class="pagesize">
|
||||
<option value="10">10</option>
|
||||
<option selected="selected" value="20">20</option>
|
||||
<option value="30">30</option>
|
||||
<option value="40">40</option>
|
||||
<option value="50">50</option>
|
||||
<option value="100">100</option>
|
||||
</select>
|
||||
</form>
|
||||
<table>
|
||||
<tr>
|
||||
</span>
|
||||
<table id="table_authtagstructure">
|
||||
<thead>
|
||||
<th>Tag</th>
|
||||
<th>Lib</th>
|
||||
<th>Repeatable</th>
|
||||
|
@ -210,7 +236,7 @@ return false;
|
|||
<th>Subfields</th>
|
||||
<th>Edit</th>
|
||||
<th>Delete</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<!-- TMPL_LOOP NAME="loop" -->
|
||||
<!-- TMPL_UNLESS NAME="__odd__" -->
|
||||
<tr class="highlight">
|
||||
|
@ -229,12 +255,6 @@ return false;
|
|||
<!-- /TMPL_LOOP -->
|
||||
</table>
|
||||
|
||||
<div class="pages"><!-- TMPL_IF NAME="isprevpage" -->
|
||||
<a href="<!-- TMPL_VAR NAME="script_name" -->?offset=<!-- TMPL_VAR NAME="prevpage" -->&searchfield=<!-- TMPL_VAR NAME="searchfield" -->&authtypecode=<!-- TMPL_VAR NAME="authtypecode" --> "><< Previous Page</a>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF NAME="nextpage" -->
|
||||
<a href="<!-- TMPL_VAR NAME="script_name" -->?offset=<!-- TMPL_VAR NAME="nextpage" -->&searchfield=<!-- TMPL_VAR NAME="searchfield" -->&authtypecode=<!-- TMPL_VAR NAME="authtypecode" --> ">Next Page >></a>
|
||||
<!-- /TMPL_IF --></div>
|
||||
<!-- /TMPL_IF -->
|
||||
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue