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

(-)a/C4/Koha.pm (-3 / +2 lines)
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'
(-)a/C4/Members.pm (-4 / +3 lines)
Lines 1321-1327 sub GetborCatFromCatType { Link Here
1321
    my $dbh     = C4::Context->dbh;
1321
    my $dbh     = C4::Context->dbh;
1322
1322
1323
    my $request = qq{
1323
    my $request = qq{
1324
        SELECT categories.categorycode, categories.description
1324
        SELECT DISTINCT categories.categorycode, categories.description
1325
        FROM categories
1325
        FROM categories
1326
    };
1326
    };
1327
    $request .= qq{
1327
    $request .= qq{
Lines 1329-1337 sub GetborCatFromCatType { Link Here
1329
    } if $branch_limit;
1329
    } if $branch_limit;
1330
    if($action) {
1330
    if($action) {
1331
        $request .= " $action ";
1331
        $request .= " $action ";
1332
        $request .= " AND (branchcode = ? OR branchcode IS NULL) GROUP BY description" if $branch_limit;
1332
        $request .= " AND (branchcode = ? OR branchcode IS NULL)" if $branch_limit;
1333
    } else {
1333
    } else {
1334
        $request .= " WHERE branchcode = ? OR branchcode IS NULL GROUP BY description" if $branch_limit;
1334
        $request .= " WHERE branchcode = ? OR branchcode IS NULL" if $branch_limit;
1335
    }
1335
    }
1336
    $request .= " ORDER BY categorycode";
1336
    $request .= " ORDER BY categorycode";
1337
1337
1338
- 

Return to bug 16716