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

(-)a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss (-2 / +4 lines)
Lines 4023-4030 span { Link Here
4023
    }
4023
    }
4024
}
4024
}
4025
4025
4026
#illfilter_dateplaced,
4026
#illfilter_dateplaced_start,
4027
#illfilter_datemodified {
4027
#illfilter_datemodified_start,
4028
#illfilter_dateplaced_end,
4029
#illfilter_datemodified_end {
4028
    width: 80%;
4030
    width: 80%;
4029
}
4031
}
4030
4032
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt (-37 / +41 lines)
Lines 154-196 Link Here
154
                }
154
                }
155
            },
155
            },
156
            dateModified: {
156
            dateModified: {
157
                listener: function() {
158
                    var me = 'dateModified';
159
                    $('#illfilter_datemodified').change(function() {
160
                        var val = $('#illfilter_datemodified').val();
161
                        if (val && val.length > 0) {
162
                            activeFilters[me] = function() {
163
                                table.column(10).search(val);
164
                            }
165
                        } else {
166
                            if (activeFilters.hasOwnProperty(me)) {
167
                                delete activeFilters[me];
168
                            }
169
                        }
170
                    });
171
                },
172
                clear: function() {
157
                clear: function() {
173
                    $('#illfilter_datemodified').val('');
158
                    $('#illfilter_datemodified_start, #illfilter_datemodified_end').val('');
174
                }
159
                }
175
            },
160
            },
176
            datePlaced: {
161
            datePlaced: {
177
                listener: function() {
178
                    var me = 'datePlaced';
179
                    $('#illfilter_dateplaced').change(function() {
180
                        var val = $('#illfilter_dateplaced').val();
181
                        if (val && val.length > 0) {
182
                            activeFilters[me] = function() {
183
                                table.column(8).search(val);
184
                            }
185
                        } else {
186
                            if (activeFilters.hasOwnProperty(me)) {
187
                                delete activeFilters[me];
188
                            }
189
                        }
190
                    });
191
                },
192
                clear: function() {
162
                clear: function() {
193
                    $('#illfilter_dateplaced').val('');
163
                    $('#illfilter_dateplaced_start, #illfilter_dateplaced_end').val('');
194
                }
164
                }
195
            }
165
            }
196
        };
166
        };
Lines 484-489 Link Here
484
                    }
454
                    }
485
                }));
455
                }));
486
456
457
                // Custom date range filtering
458
                $.fn.dataTable.ext.search.push(function(settings, data, dataIndex) {
459
                    var placedStart = $('#illfilter_dateplaced_start').datepicker('getDate');
460
                    var placedEnd = $('#illfilter_dateplaced_end').datepicker('getDate');
461
                    var modifiedStart = $('#illfilter_datemodified_start').datepicker('getDate');
462
                    var modifiedEnd = $('#illfilter_datemodified_end').datepicker('getDate');
463
                    var rowPlaced = data[8] ? new Date(data[8]) : null;
464
                    var rowModified = data[10] ? new Date(data[10]) : null;
465
                    var placedPassed = true;
466
                    var modifiedPassed = true;
467
                    if (placedStart && rowPlaced && rowPlaced < placedStart) {
468
                        placedPassed = false
469
                    };
470
                    if (placedEnd && rowPlaced && rowPlaced > placedEnd) {
471
                        placedPassed = false;
472
                    }
473
                    if (modifiedStart && rowModified && rowModified < modifiedStart) {
474
                        modifiedPassed = false
475
                    };
476
                    if (modifiedEnd && rowModified && rowModified > modifiedEnd) {
477
                        modifiedPassed = false;
478
                    }
479
480
                    return placedPassed && modifiedPassed;
481
482
                });
483
487
            }
484
            }
488
        );
485
        );
489
486
Lines 553-564 Link Here
553
                            </select>
550
                            </select>
554
                        </li>
551
                        </li>
555
                        <li>
552
                        <li>
556
                            <label for="illfilter_dateplaced">Date placed:</label>
553
                            <label for="illfilter_dateplaced_start">Date placed between:</label>
557
                            <input type="text" name="illfilter_dateplaced" id="illfilter_dateplaced" class="datepicker">
554
                            <input type="text" name="illfilter_dateplaced_start" id="illfilter_dateplaced_start" class="datepicker">
555
                        </li>
556
                        <li>
557
                            <label for="illfilter_dateplaced_end">and:</label>
558
                            <input type="text" name="illfilter_dateplaced_end" id="illfilter_dateplaced_end" class="datepicker">
559
                        </li>
560
                        <li>
561
                            <label for="illfilter_datemodified_start">Updated between:</label>
562
                            <input type="text" name="illfilter_datemodified_start" id="illfilter_datemodified_start" class="datepicker">
558
                        </li>
563
                        </li>
559
                        <li>
564
                        <li>
560
                            <label for="illfilter_datemodified">Updated on:</label>
565
                            <label for="illfilter_datemodified_end">and:</label>
561
                            <input type="text" name="illfilter_datemodified" id="illfilter_datemodified" class="datepicker">
566
                            <input type="text" name="illfilter_datemodified_end" id="illfilter_datemodified_end" class="datepicker">
562
                        </li>
567
                        </li>
563
                        <li>
568
                        <li>
564
                            <label for="illfilter_branchname">Library:</label>
569
                            <label for="illfilter_branchname">Library:</label>
565
- 

Return to bug 20600