Lines 72-78
my $budget_period_hashref= $input->Vars;
Link Here
|
72 |
#my $sort1_authcat = $input->param('sort1_authcat'); |
72 |
#my $sort1_authcat = $input->param('sort1_authcat'); |
73 |
#my $sort2_authcat = $input->param('sort2_authcat'); |
73 |
#my $sort2_authcat = $input->param('sort2_authcat'); |
74 |
|
74 |
|
75 |
my $pagesize = 20; |
|
|
76 |
$searchfield =~ s/\,//g; |
75 |
$searchfield =~ s/\,//g; |
77 |
|
76 |
|
78 |
my ($template, $borrowernumber, $cookie, $staff_flags ) = get_template_and_user( |
77 |
my ($template, $borrowernumber, $cookie, $staff_flags ) = get_template_and_user( |
Lines 245-271
elsif ( $op eq 'duplicate_budget' ){
Link Here
|
245 |
# DEFAULT - DISPLAY AQPERIODS TABLE |
244 |
# DEFAULT - DISPLAY AQPERIODS TABLE |
246 |
# ------------------------------------------------------------------- |
245 |
# ------------------------------------------------------------------- |
247 |
# display the list of budget periods |
246 |
# display the list of budget periods |
248 |
my $results = GetBudgetPeriods(); |
247 |
my $results = GetBudgetPeriods(); |
249 |
$template->param( period_button_only => 1 ) unless (@$results) ; |
248 |
$template->param( period_button_only => 1 ) unless (@$results) ; |
250 |
my $page = $input->param('page') || 1; |
249 |
my @period_loop; |
251 |
my $first = ( $page - 1 ) * $pagesize; |
250 |
foreach my $result ( @$results ) { |
252 |
# if we are on the last page, the number of the last word to display |
251 |
my $budgetperiod = $result; |
253 |
# must not exceed the length of the results array |
252 |
FormatData($budgetperiod); |
254 |
my $last = min( $first + $pagesize - 1, scalar @{$results} - 1, ); |
253 |
$budgetperiod->{'budget_period_total'} = |
255 |
my $toggle = 0; |
254 |
$num->format_price( $budgetperiod->{'budget_period_total'} ); |
256 |
my @period_loop; |
255 |
$budgetperiod->{budget_active} = 1; |
257 |
foreach my $result ( @{$results}[ $first .. $last ] ) { |
256 |
push( @period_loop, $budgetperiod ); |
258 |
my $budgetperiod = $result; |
257 |
} |
259 |
FormatData($budgetperiod); |
|
|
260 |
$budgetperiod->{'budget_period_total'} = $num->format_price( $budgetperiod->{'budget_period_total'} ); |
261 |
$budgetperiod->{budget_active} = 1; |
262 |
push( @period_loop, $budgetperiod ); |
263 |
} |
264 |
|
258 |
|
265 |
$template->param( |
259 |
$template->param( |
266 |
period_loop => \@period_loop, |
260 |
period_loop => \@period_loop, |
267 |
pagination_bar => pagination_bar("aqbudgetperiods.pl",getnbpages(scalar(@$results),$pagesize),$page), |
261 |
); |
268 |
); |
|
|
269 |
|
262 |
|
270 |
$template->param($op=>1); |
263 |
$template->param($op=>1); |
271 |
output_html_with_http_headers $input, $cookie, $template->output; |
264 |
output_html_with_http_headers $input, $cookie, $template->output; |