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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc (-2 / +2 lines)
Lines 150-163 Link Here
150
                        [% SWITCH column %]
150
                        [% SWITCH column %]
151
                            [% CASE 'checkbox' %]<th class="noExport"></th>
151
                            [% CASE 'checkbox' %]<th class="noExport"></th>
152
                            [% CASE 'cardnumber' %]<th>Card</th>
152
                            [% CASE 'cardnumber' %]<th>Card</th>
153
                            [% CASE 'dateofbirth' %]<th>Date of birth</th>
153
                            [% CASE 'dateofbirth' %]<th data-datatype="date">Date of birth</th>
154
                            [% CASE 'name' %]<th>Name</th>
154
                            [% CASE 'name' %]<th>Name</th>
155
                            [% CASE 'name-address' %]<th>Name</th>
155
                            [% CASE 'name-address' %]<th>Name</th>
156
                            [% CASE 'address' %]<th>Address</th>
156
                            [% CASE 'address' %]<th>Address</th>
157
                            [% CASE 'address-library' %]<th>Address</th>
157
                            [% CASE 'address-library' %]<th>Address</th>
158
                            [% CASE 'branch' %]<th data-filter="libraries">Library</th>
158
                            [% CASE 'branch' %]<th data-filter="libraries">Library</th>
159
                            [% CASE 'category' %]<th data-filter="categories">Category</th>
159
                            [% CASE 'category' %]<th data-filter="categories">Category</th>
160
                            [% CASE 'dateexpiry' %]<th>Expires on</td>
160
                            [% CASE 'dateexpiry' %]<th data-datatype="date">Expires on</td>
161
                            [% CASE 'borrowernotes' %]<th>Notes</th>
161
                            [% CASE 'borrowernotes' %]<th>Notes</th>
162
                            [% CASE 'phone' %]<th>Phone</th>
162
                            [% CASE 'phone' %]<th>Phone</th>
163
                            [% CASE 'checkouts' %]<th>Checkouts</th>
163
                            [% CASE 'checkouts' %]<th>Checkouts</th>
(-)a/koha-tmpl/intranet-tmpl/prog/js/datatables.js (-4 / +22 lines)
Lines 597-605 jQuery.fn.dataTable.ext.errMode = function(settings, note, message) { Link Here
597
                                           // escape SQL LIKE special characters % and _
597
                                           // escape SQL LIKE special characters % and _
598
                                           value = value.replace(/(\%|\\)/g, "\\$1");
598
                                           value = value.replace(/(\%|\\)/g, "\\$1");
599
                                        }
599
                                        }
600
                                        part[!attr.includes('.')?'me.'+attr:attr] = criteria === 'exact'
600
601
                                            ? value
601
                                        let built_value;
602
                                            : {like: (['contains', 'ends_with'].indexOf(criteria) !== -1?'%':'') + value + (['contains', 'starts_with'].indexOf(criteria) !== -1?'%':'')};
602
                                        if ( col.datatype !== undefined ) {
603
                                            if ( col.datatype == 'date' ) {
604
                                                let rfc3339 = $date_to_rfc3339(value);
605
                                                if ( rfc3339 != 'Invalid Date' ) {
606
                                                    built_value = rfc3339;
607
                                                }
608
                                            } else {
609
                                                console.log("datatype %s not supported yet".format(col.datatype));
610
                                            }
611
                                        }
612
613
                                        let value_part;
614
                                        if ( criteria === 'exact' ) {
615
                                            value_part = built_value ? [value, built_value] : value
616
                                        } else {
617
                                            let like = {like: (['contains', 'ends_with'].indexOf(criteria) !== -1?'%':'') + value + (['contains', 'starts_with'].indexOf(criteria) !== -1?'%':'')};
618
                                            value_part = built_value ? [like, built_value] : like;
619
                                        }
620
621
                                        part[!attr.includes('.')?'me.'+attr:attr] = value_part;
603
                                        parts.push(part);
622
                                        parts.push(part);
604
                                    }
623
                                    }
605
                                    return parts;
624
                                    return parts;
606
- 

Return to bug 32559