(BUG #4857) aqplan.pl: consideration of Planning categories with authorised values

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
This commit is contained in:
Alex Arnaud 2010-06-24 19:26:21 +02:00 committed by Galen Charlton
parent 7e8f7eb258
commit 47f49d2e7f
2 changed files with 15 additions and 3 deletions

View File

@ -153,6 +153,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;
@ -173,9 +174,7 @@ my $CGISort;
my @authvals;
my %labels;
my @names = $input->param();
my @names = $input->param();
# ------------------------------------------------------------
if ( $op eq 'save' ) {
#get budgets
@ -292,6 +291,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;

View File

@ -90,6 +90,7 @@ YAHOO.util.Event.onAvailable("popmenu", function () {
<form method="post" id='Aform' name="Aform" action="/cgi-bin/koha/admin/aqplan.pl">
<input type="hidden" id="budget_period_id" name="budget_period_id" value="<!-- TMPL_VAR NAME="budget_period_id" -->"/>
<fieldset style=" border:2px solid #EEEEEE; " >
<legend>Planning for <!-- TMPL_VAR NAME="budget_period_description" --> by <!-- TMPL_VAR NAME="authcat" --></legend>
<table class="invis" >