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 229-240 foreach my $r (@{$budgets}) { Link Here
229
        b_sort2_authcat => $r->{'sort2_authcat'},
229
        b_sort2_authcat => $r->{'sort2_authcat'},
230
        b_active => $r->{budget_period_active},
230
        b_active => $r->{budget_period_active},
231
        b_sel => ( $r->{budget_id} == $budget_id ) ? 1 : 0,
231
        b_sel => ( $r->{budget_id} == $budget_id ) ? 1 : 0,
232
        b_level => $r->{budget_level},
232
    };
233
    };
233
}
234
}
234
235
235
@{$budget_loop} =
236
  sort { uc( $a->{b_txt}) cmp uc( $b->{b_txt}) } @{$budget_loop};
237
238
if ($close) {
236
if ($close) {
239
    $budget_id      =  $data->{'budget_id'};
237
    $budget_id      =  $data->{'budget_id'};
240
    $budget_name    =   $budget->{'budget_name'};
238
    $budget_name    =   $budget->{'budget_name'};
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt (-4 / +9 lines)
Lines 505-516 $(document).ready(function() Link Here
505
                [% FOREACH budget_loo IN budget_loop %]
505
                [% FOREACH budget_loo IN budget_loop %]
506
                    [% IF ( budget_loo.b_sel ) %]
506
                    [% IF ( budget_loo.b_sel ) %]
507
                        [% active_count = 0 #select no other fund %]
507
                        [% active_count = 0 #select no other fund %]
508
                        <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
                        <option value="[% budget_loo.b_id %]" selected="selected" data-sort1-authcat="[% budget_loo.b_sort1_authcat %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat %]"
509
                                style="[% IF ( budget_loo.b_level == 0 ) %]font-weight:bold;[% END %] padding-left:[% budget_loo.b_level %]em;"
510
                        >
509
                    [% ELSIF active_count==1 && budget_loo.b_active %]
511
                    [% ELSIF active_count==1 && budget_loo.b_active %]
510
                        <option value="[% budget_loo.b_id %]" selected="selected" data-sort1-authcat="[% budget_loo.b_sort1_authcat %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat %]">
512
                        <option value="[% budget_loo.b_id %]" selected="selected" 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
                        >
511
                    [% ELSE %]
515
                    [% ELSE %]
512
                        [% bdgclass=budget_loo.b_active? "": "b_inactive" %]
516
                        [% bdgclass=budget_loo.b_active? "": "b_inactive" %]
513
                        <option value="[% budget_loo.b_id %]" class="[% bdgclass %]" data-sort1-authcat="[% budget_loo.b_sort1_authcat %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat %]">
517
                        <option value="[% budget_loo.b_id %]" class="[% bdgclass %]" data-sort1-authcat="[% budget_loo.b_sort1_authcat %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat %]"
518
                                style="[% IF ( budget_loo.b_level == 0 ) %]font-weight:bold;[% END %] padding-left:[% budget_loo.b_level %]em;"
519
                        >
514
                    [% END %]
520
                    [% END %]
515
                    [% budget_loo.b_txt %][% IF !budget_loo.b_active %] (inactive)[% END %]
521
                    [% budget_loo.b_txt %][% IF !budget_loo.b_active %] (inactive)[% END %]
516
                    </option>
522
                    </option>
517
- 

Return to bug 16123