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 1423-1429 sub GetborCatFromCatType { Link Here
1423
    my $dbh     = C4::Context->dbh;
1423
    my $dbh     = C4::Context->dbh;
1424
1424
1425
    my $request = qq{
1425
    my $request = qq{
1426
        SELECT categories.categorycode, categories.description
1426
        SELECT DISTINCT categories.categorycode, categories.description
1427
        FROM categories
1427
        FROM categories
1428
    };
1428
    };
1429
    $request .= qq{
1429
    $request .= qq{
Lines 1431-1439 sub GetborCatFromCatType { Link Here
1431
    } if $branch_limit;
1431
    } if $branch_limit;
1432
    if($action) {
1432
    if($action) {
1433
        $request .= " $action ";
1433
        $request .= " $action ";
1434
        $request .= " AND (branchcode = ? OR branchcode IS NULL) GROUP BY description" if $branch_limit;
1434
        $request .= " AND (branchcode = ? OR branchcode IS NULL)" if $branch_limit;
1435
    } else {
1435
    } else {
1436
        $request .= " WHERE branchcode = ? OR branchcode IS NULL GROUP BY description" if $branch_limit;
1436
        $request .= " WHERE branchcode = ? OR branchcode IS NULL" if $branch_limit;
1437
    }
1437
    }
1438
    $request .= " ORDER BY categorycode";
1438
    $request .= " ORDER BY categorycode";
1439
1439
1440
- 

Return to bug 16716