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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt (-1 / +1 lines)
Lines 310-316 Link Here
310
            let options = [... new Set(column
310
            let options = [... new Set(column
311
                .data()
311
                .data()
312
                .toArray()
312
                .toArray()
313
                .map(d => d.replace(regex, '').trim().split(/\n/gi).flat())
313
                .map(d => d.replace(regex, '').trim().split(/\n/gi).map(s => s.trim()).flat())
314
                .flat()
314
                .flat()
315
                .sort())];
315
                .sort())];
316
316
(-)a/koha-tmpl/intranet-tmpl/prog/js/datatables.js (-12 / +21 lines)
Lines 847-862 function _dt_add_filters(table_node, table_dt, filters_options = {}) { Link Here
847
                } else if ( typeof filters_options[i] === "function" ) {
847
                } else if ( typeof filters_options[i] === "function" ) {
848
                    filters_options[i] = filters_options[i](table_dt)
848
                    filters_options[i] = filters_options[i](table_dt)
849
                }
849
                }
850
                $(filters_options[i]).each(function(){
850
                $(filters_options[i])
851
                    let o = $('<option value="%s">%s</option>'.format(this._id, this._str));
851
                    .filter(function () {
852
                    // Compare with lc, or selfreg won't match ^SELFREG$ for instance, see bug 32517
852
                        return this._id && this._str;
853
                    // This is only for category, we might want to apply it only in this case.
853
                    })
854
                    existing_search = existing_search.toLowerCase()
854
                    .each(function () {
855
                    if ( existing_search === this._id || (existing_search && this._id.toLowerCase().match(existing_search)) ) {
855
                        let optionValue =
856
                        o.prop("selected", "selected");
856
                            table_dt.settings()[0].ajax !== null
857
                    }
857
                                ? `^${this._id}$`
858
                    o.appendTo(select);
858
                                : this._id;
859
                });
859
                        let o = $(
860
                            `<option value="${optionValue}">${this._str}</option>`
861
                        );
862
863
                        // Compare with lc, or selfreg won't match ^SELFREG$ for instance, see bug 32517
864
                        // This is only for category, we might want to apply it only in this case.
865
                        existing_search = existing_search.toLowerCase()
866
                        if ( existing_search === this._id || (existing_search && this._id.toLowerCase().match(existing_search)) ) {
867
                            o.prop("selected", "selected");
868
                        }
869
                        o.appendTo(select);
870
                    });
860
                $(th).html( select );
871
                $(th).html( select );
861
            } else {
872
            } else {
862
                var title = $(th).text();
873
                var title = $(th).text();
Lines 911-917 function _dt_add_delay_filters(table_dt, table_node) { Link Here
911
        $(this).find("select")
922
        $(this).find("select")
912
            .unbind()
923
            .unbind()
913
            .bind("keyup change", function(){
924
            .bind("keyup change", function(){
914
                let value = this.value.length ? '^'+this.value+'$' : '';
915
                col_select_search(i, this.value)
925
                col_select_search(i, this.value)
916
            });
926
            });
917
    });
927
    });
918
- 

Return to bug 40118