Lines 57-64
BEGIN {
Link Here
|
57 |
&AddBudgetPeriod |
57 |
&AddBudgetPeriod |
58 |
&DelBudgetPeriod |
58 |
&DelBudgetPeriod |
59 |
|
59 |
|
60 |
&GetAuthvalueDropbox |
|
|
61 |
|
62 |
&ModBudgetPlan |
60 |
&ModBudgetPlan |
63 |
|
61 |
|
64 |
&GetCurrency |
62 |
&GetCurrency |
Lines 401-444
sub GetBudgetAuthCats {
Link Here
|
401 |
} |
399 |
} |
402 |
|
400 |
|
403 |
# ------------------------------------------------------------------- |
401 |
# ------------------------------------------------------------------- |
404 |
sub GetAuthvalueDropbox { |
|
|
405 |
my ( $authcat, $default ) = @_; |
406 |
my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : ""; |
407 |
my $dbh = C4::Context->dbh; |
408 |
|
409 |
my $query = qq{ |
410 |
SELECT * |
411 |
FROM authorised_values |
412 |
}; |
413 |
$query .= qq{ |
414 |
LEFT JOIN authorised_values_branches ON ( id = av_id ) |
415 |
} if $branch_limit; |
416 |
$query .= qq{ |
417 |
WHERE category = ? |
418 |
}; |
419 |
$query .= " AND ( branchcode = ? OR branchcode IS NULL )" if $branch_limit; |
420 |
$query .= " GROUP BY lib ORDER BY category, lib, lib_opac"; |
421 |
my $sth = $dbh->prepare($query); |
422 |
$sth->execute( $authcat, $branch_limit ? $branch_limit : () ); |
423 |
|
424 |
|
425 |
my $option_list = []; |
426 |
my @authorised_values = ( q{} ); |
427 |
while (my $av = $sth->fetchrow_hashref) { |
428 |
push @{$option_list}, { |
429 |
value => $av->{authorised_value}, |
430 |
label => $av->{lib}, |
431 |
default => ($default eq $av->{authorised_value}), |
432 |
}; |
433 |
} |
434 |
|
435 |
if ( @{$option_list} ) { |
436 |
return $option_list; |
437 |
} |
438 |
return; |
439 |
} |
440 |
|
441 |
# ------------------------------------------------------------------- |
442 |
sub GetBudgetPeriods { |
402 |
sub GetBudgetPeriods { |
443 |
my ($filters,$orderby) = @_; |
403 |
my ($filters,$orderby) = @_; |
444 |
return SearchInTable("aqbudgetperiods",$filters, $orderby, undef,undef, undef, "wide"); |
404 |
return SearchInTable("aqbudgetperiods",$filters, $orderby, undef,undef, undef, "wide"); |