View | Details | Raw Unified | Return to bug 18212
Collapse All | Expand All

(-)a/C4/Acquisition.pm (+18 lines)
Lines 2980-2985 sub GetOrderUsers { Link Here
2980
    return @borrowernumbers;
2980
    return @borrowernumbers;
2981
}
2981
}
2982
2982
2983
=head3 GetAuthorisedValues
2984
2985
2986
2987
=cut
2988
2989
sub GetAuthValuesForCategory{
2990
    my ($self, $category) = @_;
2991
    my $schema = Koha::Database->new()->schema();
2992
    my $authvalues = Koha::AuthorisedValues->search({
2993
            'category' => $category,
2994
             order_by => { -asc => 'lib'}
2995
            });
2996
    return $authvalues;
2997
}
2998
2999
3000
2983
=head3 ModOrderUsers
3001
=head3 ModOrderUsers
2984
3002
2985
    my @order_users_ids = (1, 2, 3);
3003
    my @order_users_ids = (1, 2, 3);
(-)a/admin/aqplan.pl (-9 / +7 lines)
Lines 192-209 HideCols($authcat, @hide_cols); Link Here
192
}
192
}
193
# ------------------------------------------------------------
193
# ------------------------------------------------------------
194
if ( $authcat =~ m/^Asort/ ) {
194
if ( $authcat =~ m/^Asort/ ) {
195
   my $query = qq{ SELECT * FROM authorised_values WHERE category=? order by lib };
195
    my $categoryauthvalues = C4::Acquisition->GetAuthValuesForCategory($authcat);
196
    my $sth   = $dbh->prepare($query);
196
197
    $sth->execute($authcat  );
197
    if ( $categoryauthvalues->rows > 0 ) {
198
    if ( $sth->rows > 0 ) {
198
        for ( my $i = 0 ; $i < $categoryauthvalues->rows ; $i++ ) {
199
        for ( my $i = 0 ; $i < $sth->rows ; $i++ ) {
199
            my $results = $categoryauthvalues->fetchrow_hashref;
200
            my $results = $sth->fetchrow_hashref;
201
            push @authvals, $results->{authorised_value};
200
            push @authvals, $results->{authorised_value};
202
            $labels{ $results->{authorised_value} } = $results->{lib};
201
            $labels{ $results->{authorised_value} } = $results->{lib};
203
        }
202
        }
204
    }
203
    }
205
    $sth->finish;
204
   $categoryauthvalues->finish;
206
    @authvals = sort { $a <=> $b } @authvals;
205
   @authvals = sort { $a <=> $b } @authvals;
207
}
206
}
208
elsif ( $authcat eq 'MONTHS' && $budget_period_startdate && $budget_period_enddate ) {
207
elsif ( $authcat eq 'MONTHS' && $budget_period_startdate && $budget_period_enddate ) {
209
208
210
- 

Return to bug 18212