|
Lines 1024-1031
sub GetAuthorisedValues {
Link Here
|
| 1024 |
my @results; |
1024 |
my @results; |
| 1025 |
my $dbh = C4::Context->dbh; |
1025 |
my $dbh = C4::Context->dbh; |
| 1026 |
my $query = qq{ |
1026 |
my $query = qq{ |
| 1027 |
SELECT * |
1027 |
SELECT DISTINCT av.* |
| 1028 |
FROM authorised_values |
1028 |
FROM authorised_values av |
| 1029 |
}; |
1029 |
}; |
| 1030 |
$query .= qq{ |
1030 |
$query .= qq{ |
| 1031 |
LEFT JOIN authorised_values_branches ON ( id = av_id ) |
1031 |
LEFT JOIN authorised_values_branches ON ( id = av_id ) |
|
Lines 1043-1049
sub GetAuthorisedValues {
Link Here
|
| 1043 |
if(@where_strings > 0) { |
1043 |
if(@where_strings > 0) { |
| 1044 |
$query .= " WHERE " . join(" AND ", @where_strings); |
1044 |
$query .= " WHERE " . join(" AND ", @where_strings); |
| 1045 |
} |
1045 |
} |
| 1046 |
$query .= " GROUP BY lib"; |
|
|
| 1047 |
$query .= ' ORDER BY category, ' . ( |
1046 |
$query .= ' ORDER BY category, ' . ( |
| 1048 |
$opac ? 'COALESCE(lib_opac, lib)' |
1047 |
$opac ? 'COALESCE(lib_opac, lib)' |
| 1049 |
: 'lib, lib_opac' |
1048 |
: 'lib, lib_opac' |