View | Details | Raw Unified | Return to bug 16123
Collapse All | Expand All

(-)a/C4/Budgets.pm (-2 / +3 lines)
Lines 545-551 sub GetBudgetHierarchy { Link Here
545
545
546
    my @sort = ();
546
    my @sort = ();
547
    foreach my $first_parent (@first_parents) {
547
    foreach my $first_parent (@first_parents) {
548
        _add_budget_children(\@sort, $first_parent);
548
        _add_budget_children(\@sort, $first_parent, 0);
549
    }
549
    }
550
550
551
    foreach my $budget (@sort) {
551
    foreach my $budget (@sort) {
Lines 561-571 sub GetBudgetHierarchy { Link Here
561
sub _add_budget_children {
561
sub _add_budget_children {
562
    my $res = shift;
562
    my $res = shift;
563
    my $budget = shift;
563
    my $budget = shift;
564
    $budget->{budget_level} = shift;
564
    push @$res, $budget;
565
    push @$res, $budget;
565
    my $children = $budget->{'children'} || [];
566
    my $children = $budget->{'children'} || [];
566
    return unless @$children; # break recursivity
567
    return unless @$children; # break recursivity
567
    foreach my $child (@$children) {
568
    foreach my $child (@$children) {
568
        _add_budget_children($res, $child);
569
        _add_budget_children($res, $child, $budget->{budget_level} + 1);
569
    }
570
    }
570
}
571
}
571
572
(-)a/acqui/neworderempty.pl (-3 / +1 lines)
Lines 248-259 foreach my $r (@{$budgets}) { Link Here
248
        b_sort2_authcat => $r->{'sort2_authcat'},
248
        b_sort2_authcat => $r->{'sort2_authcat'},
249
        b_active => $r->{budget_period_active},
249
        b_active => $r->{budget_period_active},
250
        b_sel => ( $r->{budget_id} == $budget_id ) ? 1 : 0,
250
        b_sel => ( $r->{budget_id} == $budget_id ) ? 1 : 0,
251
        b_level => $r->{budget_level},
251
    };
252
    };
252
}
253
}
253
254
254
@{$budget_loop} =
255
  sort { uc( $a->{b_txt}) cmp uc( $b->{b_txt}) } @{$budget_loop};
256
257
if ($close) {
255
if ($close) {
258
    $budget_id      =  $data->{'budget_id'};
256
    $budget_id      =  $data->{'budget_id'};
259
    $budget_name    =   $budget->{'budget_name'};
257
    $budget_name    =   $budget->{'budget_name'};
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt (-4 / +9 lines)
Lines 500-511 $(document).ready(function() Link Here
500
                [% FOREACH budget_loo IN budget_loop %]
500
                [% FOREACH budget_loo IN budget_loop %]
501
                    [% IF ( budget_loo.b_sel ) %]
501
                    [% IF ( budget_loo.b_sel ) %]
502
                        [% active_count = 0 #select no other fund %]
502
                        [% active_count = 0 #select no other fund %]
503
                        <option value="[% budget_loo.b_id %]" selected="selected" data-sort1-authcat="[% budget_loo.b_sort1_authcat %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat %]">
503
                        <option value="[% budget_loo.b_id %]" selected="selected" data-sort1-authcat="[% budget_loo.b_sort1_authcat %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat %]"
504
                                style="[% IF ( budget_loo.b_level == 0 ) %]font-weight:bold;[% END %] padding-left:[% budget_loo.b_level %]em;"
505
                        >
504
                    [% ELSIF active_count==1 && budget_loo.b_active %]
506
                    [% ELSIF active_count==1 && budget_loo.b_active %]
505
                        <option value="[% budget_loo.b_id %]" selected="selected" data-sort1-authcat="[% budget_loo.b_sort1_authcat %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat %]">
507
                        <option value="[% budget_loo.b_id %]" selected="selected" data-sort1-authcat="[% budget_loo.b_sort1_authcat %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat %]"
508
                                style="[% IF ( budget_loo.b_level == 0 ) %]font-weight:bold;[% END %] padding-left:[% budget_loo.b_level %]em;"
509
                        >
506
                    [% ELSE %]
510
                    [% ELSE %]
507
                        [% bdgclass=budget_loo.b_active? "": "b_inactive" %]
511
                        [% bdgclass=budget_loo.b_active? "": "b_inactive" %]
508
                        <option value="[% budget_loo.b_id %]" class="[% bdgclass %]" data-sort1-authcat="[% budget_loo.b_sort1_authcat %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat %]">
512
                        <option value="[% budget_loo.b_id %]" class="[% bdgclass %]" data-sort1-authcat="[% budget_loo.b_sort1_authcat %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat %]"
513
                                style="[% IF ( budget_loo.b_level == 0 ) %]font-weight:bold;[% END %] padding-left:[% budget_loo.b_level %]em;"
514
                        >
509
                    [% END %]
515
                    [% END %]
510
                    [% budget_loo.b_txt %][% IF !budget_loo.b_active %] (inactive)[% END %]
516
                    [% budget_loo.b_txt %][% IF !budget_loo.b_active %] (inactive)[% END %]
511
                    </option>
517
                    </option>
512
- 

Return to bug 16123