fixed maximum offset detection

2.1@2833
Daniel Tiefnig 16 years ago
parent 3df23ec198
commit 3fbee5f333

@ -442,7 +442,7 @@ sub search_fees : Local {
if($$fee_list{total_count} > @{$$fee_list{fees}}) {
# paginate!
$c->stash->{pagination} = admin::Utils::paginate($$fee_list{total_count}, $offset, $limit);
$c->stash->{max_offset} = $#{$c->stash->{pagination}};
$c->stash->{max_offset} = ${$c->stash->{pagination}}[-1]{offset};
if(@{$$fee_list{fees}} == 1) {
$c->stash->{last_one} = 1;
}

@ -70,7 +70,7 @@ sub search : Local {
if($$customer_list{total_count} > @{$$customer_list{customers}}) {
# paginate!
$c->stash->{pagination} = admin::Utils::paginate($$customer_list{total_count}, $offset, $limit);
$c->stash->{max_offset} = $#{$c->stash->{pagination}};
$c->stash->{max_offset} = ${$c->stash->{pagination}}[-1]{offset};
}
}

@ -50,7 +50,7 @@ sub index : Private {
# paginate!
$c->stash->{pagination} =
admin::Utils::paginate($$nums{total_count}, $c->session->{searched_lnp_numbers}{offset}, $c->session->{searched_lnp_numbers}{limit});
$c->stash->{max_offset} = $#{$c->stash->{pagination}};
$c->stash->{max_offset} = ${$c->stash->{pagination}}[-1]{offset};
# delete_number will decrease offset if no number remains on current page
if(@{$$nums{numbers}} == 1) {
$c->stash->{last_one} = 1;

@ -98,7 +98,7 @@ sub search : Local {
if($$subscriber_list{total_count} > @{$$subscriber_list{subscribers}}) {
# paginate!
$c->stash->{pagination} = admin::Utils::paginate($$subscriber_list{total_count}, $offset, $limit);
$c->stash->{max_offset} = $#{$c->stash->{pagination}};
$c->stash->{max_offset} = ${$c->stash->{pagination}}[-1]{offset};
}
}

Loading…
Cancel
Save