Lines 75-82
my $budget_period_hashref = { map { join(' ',@columns) =~ /$_/ ? ( $_ => $input-
Link Here
|
75 |
$budget_period_hashref->{budget_period_startdate} = dt_from_string( $input->param('budget_period_startdate') ); |
75 |
$budget_period_hashref->{budget_period_startdate} = dt_from_string( $input->param('budget_period_startdate') ); |
76 |
$budget_period_hashref->{budget_period_enddate} = dt_from_string( $input->param('budget_period_enddate') ); |
76 |
$budget_period_hashref->{budget_period_enddate} = dt_from_string( $input->param('budget_period_enddate') ); |
77 |
|
77 |
|
78 |
my $activepagesize = 20; |
|
|
79 |
my $inactivepagesize = 20; |
80 |
$searchfield =~ s/\,//g; |
78 |
$searchfield =~ s/\,//g; |
81 |
|
79 |
|
82 |
my ($template, $borrowernumber, $cookie, $staff_flags ) = get_template_and_user( |
80 |
my ($template, $borrowernumber, $cookie, $staff_flags ) = get_template_and_user( |
Lines 261-278
my $results = GetBudgetPeriods(
Link Here
|
261 |
{ budget_period_active => 1 }, |
259 |
{ budget_period_active => 1 }, |
262 |
{ -asc => 'budget_period_description' }, |
260 |
{ -asc => 'budget_period_description' }, |
263 |
); |
261 |
); |
264 |
my $first = ( $activepage - 1 ) * $activepagesize; |
262 |
|
265 |
my $last = min( $first + $activepagesize - 1, scalar @{$results} - 1, ); |
|
|
266 |
my @period_active_loop; |
263 |
my @period_active_loop; |
267 |
|
264 |
|
268 |
foreach my $result ( @{$results}[ $first .. $last ] ) { |
265 |
foreach my $result ( @{$results} ) { |
269 |
my $budgetperiod = $result; |
266 |
my $budgetperiod = $result; |
270 |
$budgetperiod->{budget_active} = 1; |
267 |
$budgetperiod->{budget_active} = 1; |
271 |
push( @period_active_loop, $budgetperiod ); |
268 |
push( @period_active_loop, $budgetperiod ); |
272 |
} |
269 |
} |
273 |
my $url = "aqbudgetperiods.pl"; |
|
|
274 |
$url .= "?ipage=$inactivepage" if($inactivepage != 1); |
275 |
my $active_pagination_bar = pagination_bar ($url, getnbpages( scalar(@$results), $activepagesize), $activepage, "apage"); |
276 |
|
270 |
|
277 |
# Get inactive budget periods |
271 |
# Get inactive budget periods |
278 |
$results = GetBudgetPeriods( |
272 |
$results = GetBudgetPeriods( |
Lines 280-296
$results = GetBudgetPeriods(
Link Here
|
280 |
{ -desc => 'budget_period_enddate' }, |
274 |
{ -desc => 'budget_period_enddate' }, |
281 |
); |
275 |
); |
282 |
|
276 |
|
283 |
$first = ( $inactivepage - 1 ) * $inactivepagesize; |
|
|
284 |
$last = min( $first + $inactivepagesize - 1, scalar @{$results} - 1, ); |
285 |
my @period_inactive_loop; |
277 |
my @period_inactive_loop; |
286 |
foreach my $result ( @{$results}[ $first .. $last ] ) { |
278 |
foreach my $result ( @{$results} ) { |
287 |
my $budgetperiod = $result; |
279 |
my $budgetperiod = $result; |
288 |
$budgetperiod->{budget_active} = 1; |
280 |
$budgetperiod->{budget_active} = 1; |
289 |
push( @period_inactive_loop, $budgetperiod ); |
281 |
push( @period_inactive_loop, $budgetperiod ); |
290 |
} |
282 |
} |
291 |
$url = "aqbudgetperiods.pl?tab=2"; |
|
|
292 |
$url .= "&apage=$activepage" if($activepage != 1); |
293 |
my $inactive_pagination_bar = pagination_bar ($url, getnbpages( scalar(@$results), $inactivepagesize), $inactivepage, "ipage"); |
294 |
|
283 |
|
295 |
my $branchloop = C4::Branch::GetBranchesLoop(); |
284 |
my $branchloop = C4::Branch::GetBranchesLoop(); |
296 |
|
285 |
|
Lines 298-305
my $tab = $input->param('tab') ? $input->param('tab') - 1 : 0;
Link Here
|
298 |
$template->param( |
287 |
$template->param( |
299 |
period_active_loop => \@period_active_loop, |
288 |
period_active_loop => \@period_active_loop, |
300 |
period_inactive_loop => \@period_inactive_loop, |
289 |
period_inactive_loop => \@period_inactive_loop, |
301 |
active_pagination_bar => $active_pagination_bar, |
|
|
302 |
inactive_pagination_bar => $inactive_pagination_bar, |
303 |
tab => $tab, |
290 |
tab => $tab, |
304 |
branchloop => $branchloop, |
291 |
branchloop => $branchloop, |
305 |
); |
292 |
); |