From 784a9483f1b6dc2feecf75e96d0a17ff0c8c96c4 Mon Sep 17 00:00:00 2001 From: Alex Arnaud Date: Tue, 8 Jun 2010 13:50:37 +0200 Subject: [PATCH] (BUG #4857) aqplan.pl: consideration of Planning categories with authorised values. --- admin/aqplan.pl | 16 ++++++++++++++-- .../prog/en/modules/admin/aqplan.tmpl | 1 + 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/admin/aqplan.pl b/admin/aqplan.pl index 0090208..2e5a7dd 100755 --- a/admin/aqplan.pl +++ b/admin/aqplan.pl @@ -56,7 +56,7 @@ my ( $template, $borrowernumber, $cookie, $staff_flags ) = get_template_and_user ); my $budget_period_id = $input->param('budget_period_id'); - +warn "budget_period_id : " . Data::Dumper::Dumper($budget_period_id); # ' ------- get periods stuff ------------------' # IF PERIOD_ID IS DEFINED, GET THE PERIOD - ELSE GET THE ACTIVE PERIOD BY DEFAULT my $period = GetBudgetPeriod($budget_period_id); @@ -156,6 +156,7 @@ while ( my ($category) = $sth->fetchrow_array ) { push( @category_list, 'MONTHS' ); push( @category_list, 'ITEMTYPES' ); push( @category_list, 'BRANCHES' ); +push( @category_list, $$_{'authcat'} ) foreach @$auth_cats_loop; #reorder the list @category_list = sort { $a cmp $b } @category_list; @@ -177,7 +178,6 @@ my @authvals; my %labels; my @names = $input->param(); - # ------------------------------------------------------------ if ( $op eq 'save' ) { @@ -294,6 +294,18 @@ elsif ( $authcat eq 'ITEMTYPES' ) { } } $sth->finish; +} elsif ($authcat) { + my $query = qq{ SELECT * FROM authorised_values WHERE category=? order by lib }; + my $sth = $dbh->prepare($query); + $sth->execute($authcat); + if ( $sth->rows > 0 ) { + for ( my $i = 0 ; $i < $sth->rows ; $i++ ) { + my $results = $sth->fetchrow_hashref; + push @authvals, $results->{authorised_value}; + $labels{ $results->{authorised_value} } = $results->{lib}; + } + } + $sth->finish; } my @authvals_row; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tmpl index 97e4aed..91bd6a7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tmpl @@ -103,6 +103,7 @@ YAHOO.util.Event.onAvailable("popmenu", function () {
+"/>
Planning for by -- 1.6.3.3