From: Alex Arnaud Date: Thu, 24 Jun 2010 17:26:21 +0000 (+0200) Subject: (BUG #4857) aqplan.pl: consideration of Planning categories with authorised values X-Git-Tag: v3.02.00-beta~2 X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=commitdiff_plain;ds=sidebyside;h=47f49d2e7fb9963e6beb562ccb353a4cc5589ac6;hp=7e8f7eb2589bc6d7a1c2867bf10a0a57d1a4fe0e;p=koha-ffzg.git (BUG #4857) aqplan.pl: consideration of Planning categories with authorised values Signed-off-by: Galen Charlton --- diff --git a/admin/aqplan.pl b/admin/aqplan.pl index 5fb70973b3..da4717925c 100755 --- a/admin/aqplan.pl +++ b/admin/aqplan.pl @@ -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; 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 93a3d6a68a..627b3f75b0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tmpl @@ -90,6 +90,7 @@ YAHOO.util.Event.onAvailable("popmenu", function () {
+"/>
Planning for by