Bug 17847: Remove C4::Koha::GetAuthvalueDropbox
Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
parent
7dad38e88f
commit
c8c52ba72e
38
C4/Koha.pm
38
C4/Koha.pm
|
|
@ -847,44 +847,6 @@ sub GetNormalizedOCLCNumber {
|
|||
return
|
||||
}
|
||||
|
||||
sub GetAuthvalueDropbox {
|
||||
my ( $authcat, $default ) = @_;
|
||||
my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : "";
|
||||
my $dbh = C4::Context->dbh;
|
||||
|
||||
my $query = qq{
|
||||
SELECT *
|
||||
FROM authorised_values
|
||||
};
|
||||
$query .= qq{
|
||||
LEFT JOIN authorised_values_branches ON ( id = av_id )
|
||||
} if $branch_limit;
|
||||
$query .= qq{
|
||||
WHERE category = ?
|
||||
};
|
||||
$query .= " AND ( branchcode = ? OR branchcode IS NULL )" if $branch_limit;
|
||||
$query .= " GROUP BY lib ORDER BY category, lib, lib_opac";
|
||||
my $sth = $dbh->prepare($query);
|
||||
$sth->execute( $authcat, $branch_limit ? $branch_limit : () );
|
||||
|
||||
|
||||
my $option_list = [];
|
||||
my @authorised_values = ( q{} );
|
||||
while (my $av = $sth->fetchrow_hashref) {
|
||||
push @{$option_list}, {
|
||||
value => $av->{authorised_value},
|
||||
label => $av->{lib},
|
||||
default => ($default eq $av->{authorised_value}),
|
||||
};
|
||||
}
|
||||
|
||||
if ( @{$option_list} ) {
|
||||
return $option_list;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
=head2 GetDailyQuote($opts)
|
||||
|
||||
Takes a hashref of options
|
||||
|
|
|
|||
Loading…
Reference in New Issue