Bugzilla – Attachment 51933 Details for
Bug 16123
Display budget hierarchy in the budget dropdown menu used when placing a new order
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16123 - Display budget hierarchy in the budget dropdown menu used when placing a new order
Bug-16123---Display-budget-hierarchy-in-the-budget.patch (text/plain), 5.14 KB, created by
Marc Véron
on 2016-05-31 15:27:28 UTC
(
hide
)
Description:
Bug 16123 - Display budget hierarchy in the budget dropdown menu used when placing a new order
Filename:
MIME Type:
Creator:
Marc Véron
Created:
2016-05-31 15:27:28 UTC
Size:
5.14 KB
patch
obsolete
>From 6bff67b1c75e2971844c78bd025268d349998e27 Mon Sep 17 00:00:00 2001 >From: Blou <philippe.blouin@inlibro.com> >Date: Thu, 20 Aug 2015 11:52:03 -0400 >Subject: [PATCH] Bug 16123 - Display budget hierarchy in the budget dropdown > menu used when placing a new order >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >When placing a new order, the budget dropdown will display the budget hierarchy. > >TEST PLAN : > >1. Go to the Administration module >2. Add a new budget (ie : Budget 2016) >3. Add a fund to this budget (ie : Book) >4. Add a child fund (ie : Adult fiction) > >You will have this hierarchy : > >Budget 2016 > |____ Book > |_____ Adult fiction > >5. Go to the Acquisition module >6. Select a vendor and create a new basket >7. Place an order >8. Check the budget dropdown menu > >BEFORE PATCH >Book >Adult fiction > >AFTER PATCH >Book > Adult fiction > >Dropbown menu is hierarchical as expected. >Signed-off-by: Marc Véron <veron@veron.ch> >--- > C4/Budgets.pm | 5 +++-- > acqui/neworderempty.pl | 4 +--- > .../intranet-tmpl/prog/en/modules/acqui/neworderempty.tt | 12 +++++++++--- > 3 files changed, 13 insertions(+), 8 deletions(-) > >diff --git a/C4/Budgets.pm b/C4/Budgets.pm >index d0c4400..a342fd7 100644 >--- a/C4/Budgets.pm >+++ b/C4/Budgets.pm >@@ -545,7 +545,7 @@ sub GetBudgetHierarchy { > > my @sort = (); > foreach my $first_parent (@first_parents) { >- _add_budget_children(\@sort, $first_parent); >+ _add_budget_children(\@sort, $first_parent, 0); > } > > foreach my $budget (@sort) { >@@ -561,11 +561,12 @@ sub GetBudgetHierarchy { > sub _add_budget_children { > my $res = shift; > my $budget = shift; >+ $budget->{budget_level} = shift; > push @$res, $budget; > my $children = $budget->{'children'} || []; > return unless @$children; # break recursivity > foreach my $child (@$children) { >- _add_budget_children($res, $child); >+ _add_budget_children($res, $child, $budget->{budget_level} + 1); > } > } > >diff --git a/acqui/neworderempty.pl b/acqui/neworderempty.pl >index da5acd5..03fe8d1 100755 >--- a/acqui/neworderempty.pl >+++ b/acqui/neworderempty.pl >@@ -248,12 +248,10 @@ foreach my $r (@{$budgets}) { > b_sort2_authcat => $r->{'sort2_authcat'}, > b_active => $r->{budget_period_active}, > b_sel => ( $r->{budget_id} == $budget_id ) ? 1 : 0, >+ b_level => $r->{budget_level}, > }; > } > >-@{$budget_loop} = >- sort { uc( $a->{b_txt}) cmp uc( $b->{b_txt}) } @{$budget_loop}; >- > if ($close) { > $budget_id = $data->{'budget_id'}; > $budget_name = $budget->{'budget_name'}; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt >index 805b1a6..8efd5f2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt >@@ -500,12 +500,18 @@ $(document).ready(function() > [% FOREACH budget_loo IN budget_loop %] > [% IF ( budget_loo.b_sel ) %] > [% active_count = 0 #select no other fund %] >- <option value="[% budget_loo.b_id %]" selected="selected" data-sort1-authcat="[% budget_loo.b_sort1_authcat %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat %]"> >+ <option value="[% budget_loo.b_id %]" selected="selected" data-sort1-authcat="[% budget_loo.b_sort1_authcat %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat %]" >+ style="[% IF ( budget_loo.b_level == 0 ) %]font-weight:bold;[% END %] padding-left:[% budget_loo.b_level %]em;" >+ > > [% ELSIF active_count==1 && budget_loo.b_active %] >- <option value="[% budget_loo.b_id %]" selected="selected" data-sort1-authcat="[% budget_loo.b_sort1_authcat %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat %]"> >+ <option value="[% budget_loo.b_id %]" selected="selected" data-sort1-authcat="[% budget_loo.b_sort1_authcat %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat %]" >+ style="[% IF ( budget_loo.b_level == 0 ) %]font-weight:bold;[% END %] padding-left:[% budget_loo.b_level %]em;" >+ > > [% ELSE %] > [% bdgclass=budget_loo.b_active? "": "b_inactive" %] >- <option value="[% budget_loo.b_id %]" class="[% bdgclass %]" data-sort1-authcat="[% budget_loo.b_sort1_authcat %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat %]"> >+ <option value="[% budget_loo.b_id %]" class="[% bdgclass %]" data-sort1-authcat="[% budget_loo.b_sort1_authcat %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat %]" >+ style="[% IF ( budget_loo.b_level == 0 ) %]font-weight:bold;[% END %] padding-left:[% budget_loo.b_level %]em;" >+ > > [% END %] > [% budget_loo.b_txt %][% IF !budget_loo.b_active %] (inactive)[% END %] > </option> >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 16123
:
50436
|
51933
|
56303
|
56406
|
56407
|
56890
|
56891
|
56892