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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/search.tt (-7 / +9 lines)
Lines 165-184 Link Here
165
                    if (!start_with) return "";
165
                    if (!start_with) return "";
166
                    return { "like": start_with + "%" }
166
                    return { "like": start_with + "%" }
167
                },
167
                },
168
                [% IF Koha.Preference('ExtendedPatronAttributes') %]
168
                "-and": function(){
169
                "-or": function(){
170
                    let filter = $("#searchmember_filter").val();
169
                    let filter = $("#searchmember_filter").val();
171
                    if (!filter) return "";
170
                    if (!filter) return "";
171
                    [% SET search_fields = Koha.Preference('DefaultPatronSearchFields') || 'surname,firstname,othernames,cardnumber,userid' %]
172
                    return [
172
                    return [
173
                        [% FOR search_field IN search_fields.split(',') %]
174
                        {"me.[% search_field %]":{"like":"%"+filter+"%"}},
175
                        [% END %]
176
                        [% IF Koha.Preference('ExtendedPatronAttributes') %]
173
                        {
177
                        {
174
                            "extended_attributes.value": { "like": "%" + filter + "%" }
178
                            "extended_attributes.value": { "like": "%" + filter + "%" },
175
                        },
176
                        {
177
                            "extended_attributes.code": extended_attribute_types
179
                            "extended_attributes.code": extended_attribute_types
178
                        }
180
                        }
181
                        [% END %]
179
                    ];
182
                    ];
180
                },
183
                },
181
                [% END %]
182
            };
184
            };
183
            patrons_table = $("#memberresultst").kohaTable({
185
            patrons_table = $("#memberresultst").kohaTable({
184
                "ajax": {
186
                "ajax": {
Lines 344-350 Link Here
344
                    table_dt.column([% loop.count - 1 %]).search(category_id);
346
                    table_dt.column([% loop.count - 1 %]).search(category_id);
345
                [% END %]
347
                [% END %]
346
            [% END %]
348
            [% END %]
347
            table_dt.search($("#searchmember_filter").val());
349
            table_dt.search("");
348
            table_dt.draw();
350
            table_dt.draw();
349
            return false;
351
            return false;
350
        }
352
        }
(-)a/koha-tmpl/intranet-tmpl/prog/js/datatables.js (-1 / +2 lines)
Lines 614-619 jQuery.fn.dataTable.ext.errMode = function(settings, note, message) { Link Here
614
                                        // It's not the usual DBIC notation!
614
                                        // It's not the usual DBIC notation!
615
                                        if ( f == '-or' ) {
615
                                        if ( f == '-or' ) {
616
                                            if (v) or_query_parameters.push(v)
616
                                            if (v) or_query_parameters.push(v)
617
                                        } else if ( f == '-and' ) {
618
                                            if (v) and_query_parameters.push(v)
617
                                        } else if ( v ) {
619
                                        } else if ( v ) {
618
                                            additional_filters[k] = v;
620
                                            additional_filters[k] = v;
619
                                        }
621
                                        }
620
- 

Return to bug 30055