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

(-)a/Koha/REST/Plugin/Query.pm (-1 / +2 lines)
Lines 92-100 Generates the DBIC order_by attributes based on I<$params>, and merges into I<$a Link Here
92
92
93
            if ( defined $args->{params}->{_order_by} ) {
93
            if ( defined $args->{params}->{_order_by} ) {
94
                my $order_by = $args->{params}->{_order_by};
94
                my $order_by = $args->{params}->{_order_by};
95
                $order_by = [ split(/,/, $order_by) ] if ( index(',',$order_by) == -1);
95
                if ( reftype($order_by) and reftype($order_by) eq 'ARRAY' ) {
96
                if ( reftype($order_by) and reftype($order_by) eq 'ARRAY' ) {
96
                    my @order_by = map { _build_order_atom({ string => $_, result_set => $result_set }) }
97
                    my @order_by = map { _build_order_atom({ string => $_, result_set => $result_set }) }
97
                                @{ $args->{params}->{_order_by} };
98
                                @{ $order_by };
98
                    $attributes->{order_by} = \@order_by;
99
                    $attributes->{order_by} = \@order_by;
99
                }
100
                }
100
                else {
101
                else {
(-)a/api/v1/swagger/parameters.json (-1 / +1 lines)
Lines 72-78 Link Here
72
    "required": false,
72
    "required": false,
73
    "description": "Sorting criteria",
73
    "description": "Sorting criteria",
74
    "type": "array",
74
    "type": "array",
75
    "collectionFormat": "pipes",
75
    "collectionFormat": "csv",
76
    "items": {
76
    "items": {
77
        "type": "string"
77
        "type": "string"
78
    }
78
    }
(-)a/koha-tmpl/intranet-tmpl/prog/js/datatables.js (-3 / +2 lines)
Lines 637-645 jQuery.fn.dataTable.ext.errMode = function(settings, note, message) { Link Here
637
                                    order.forEach(function (e,i) {
637
                                    order.forEach(function (e,i) {
638
                                        var order_col      = e.column;
638
                                        var order_col      = e.column;
639
                                        var order_by       = options.columns[order_col].data;
639
                                        var order_by       = options.columns[order_col].data;
640
                                        order_by           = order_by.split(':')[0];
640
                                        order_by           = order_by.split(':');
641
                                        var order_dir      = e.dir == 'asc' ? '+' : '-';
641
                                        var order_dir      = e.dir == 'asc' ? '+' : '-';
642
                                        dataSet._order_by = order_dir + (!order_by.includes('.')?'me.'+order_by:order_by);
642
                                        dataSet._order_by = order_by.map(x => order_dir + (!x.includes('.')?'me.'+x:x)).join(',');
643
                                    });
643
                                    });
644
                                }
644
                                }
645
645
646
- 

Return to bug 27680