From fc2120c6df76341f5b5889717554462fd4ac4e06 Mon Sep 17 00:00:00 2001 From: Colin Campbell Date: Thu, 11 Feb 2010 19:38:34 +0000 Subject: [PATCH] Bug 4163 Preserve budget value unless changed by user Signed-off-by: Galen Charlton --- acqui/neworderempty.pl | 30 ++++++++----------- .../prog/en/modules/acqui/neworderempty.tmpl | 8 ++++- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/acqui/neworderempty.pl b/acqui/neworderempty.pl index 9fb1870de9..cedec85519 100755 --- a/acqui/neworderempty.pl +++ b/acqui/neworderempty.pl @@ -230,23 +230,19 @@ my ( $flags, $homebranch )= ($borrower->{'flags'},$borrower->{'branchcode'}); my $budget = GetBudget($budget_id); # build budget list -my %labels; -my @values; -my $budgets = GetBudgetHierarchy('','',$borrower->{'borrowernumber'}); -foreach my $r (@$budgets) { - $labels{"$r->{budget_id}"} = $r->{budget_name}; - next if sprintf ("%00d", $r->{budget_amount}) == 0; - push @values, $r->{budget_id}; +my $budget_loop = []; +my $budgets = GetBudgetHierarchy(q{},q{},$borrower->{borrowernumber}); +foreach my $r (@{$budgets}) { + if (!defined $r->{budget_amount} || $r->{budget_amount} == 0) { + next; + } + push @{$budget_loop}, { + b_id => $r->{budget_id}, + b_txt => $r->{budget_name}, + b_sel => ( $r->{budget_id} == $budget_id ) ? 1 : 0, + }; } -# if no budget_id is passed then its an add -my $budget_dropbox = CGI::scrolling_list( - -name => 'budget_id', - -id => 'budget_id', - -values => \@values, - -size => 1, - -labels => \%labels, - -onChange => "fetchSortDropbox(this.form)", -); + if ($close) { $budget_id = $data->{'budget_id'}; @@ -345,7 +341,7 @@ $template->param( title => $data->{'title'}, author => $data->{'author'}, publicationyear => $data->{'publicationyear'}, - budget_dropbox => $budget_dropbox, + budget_loop => $budget_loop, isbn => $data->{'isbn'}, seriestitle => $data->{'seriestitle'}, quantity => $data->{'quantity'}, diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tmpl index a77e214432..f42e58eb0b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tmpl @@ -252,7 +252,13 @@ ff.submit(); " /> - +
  • -- 2.39.5