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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-6 / +19 lines)
Lines 1353-1358 Note that permanent location is a code, and location may be an authval. Link Here
1353
            $(document).ready(function() {
1353
            $(document).ready(function() {
1354
                var table_settings = [% TablesSettings.GetTableSettings( 'cataloguing', 'concerns', 'table_concerns', 'json' ) | $raw %];
1354
                var table_settings = [% TablesSettings.GetTableSettings( 'cataloguing', 'concerns', 'table_concerns', 'json' ) | $raw %];
1355
1355
1356
                var filtered = false;
1357
                let additional_filters = {
1358
                    resolved_date: function(){
1359
                        if ( filtered ) {
1360
                            return { "=": null };
1361
                        } else {
1362
                            return;
1363
                        }
1364
                    },
1365
                    biblio_id: [% biblionumber | uri %]
1366
                };
1367
1356
                var tickets_url = '/api/v1/tickets';
1368
                var tickets_url = '/api/v1/tickets';
1357
                var tickets = $("#table_concerns").kohaTable({
1369
                var tickets = $("#table_concerns").kohaTable({
1358
                    "ajax": {
1370
                    "ajax": {
Lines 1434-1448 Note that permanent location is a code, and location may be an authval. Link Here
1434
                            "orderable": false
1446
                            "orderable": false
1435
                        },
1447
                        },
1436
                    ]
1448
                    ]
1437
                }, table_settings, 0, { biblio_id: [% biblionumber | uri %]});
1449
                }, table_settings, 0, additional_filters);
1438
1450
1439
                $('#hideResolved').on( "click", function() {
1451
                $('#hideResolved').on("click", function() {
1440
                    // It would be great if we could pass null here but it gets stringified
1452
                    filtered = true;
1441
                    concerns.DataTable().columns('3').search('special:undefined').draw();
1453
                    tickets.DataTable().draw();
1442
                });
1454
                });
1443
1455
1444
                $('#showAll').on( "click", function() {
1456
                $('#showAll').on("click", function() {
1445
                    concerns.DataTable().columns('3').search('').draw();
1457
                    filtered = false;
1458
                    tickets.DataTable().draw();
1446
                });
1459
                });
1447
            });
1460
            });
1448
        </script>
1461
        </script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/concerns.tt (-4 / +16 lines)
Lines 78-83 Link Here
78
78
79
            var table_settings = [% TablesSettings.GetTableSettings('cataloguing', 'concerns', 'table_concerns', 'json') | $raw %];
79
            var table_settings = [% TablesSettings.GetTableSettings('cataloguing', 'concerns', 'table_concerns', 'json') | $raw %];
80
80
81
            var filtered = false;
82
            let additional_filters = {
83
                resolved_date: function(){
84
                    if ( filtered ) {
85
                        return { "=": null };
86
                    } else {
87
                        return;
88
                    }
89
                }
90
            };
91
81
            var tickets_url = '/api/v1/tickets';
92
            var tickets_url = '/api/v1/tickets';
82
            var tickets = $("#table_concerns").kohaTable({
93
            var tickets = $("#table_concerns").kohaTable({
83
                "ajax": {
94
                "ajax": {
Lines 168-182 Link Here
168
                        "orderable": false
179
                        "orderable": false
169
                    },
180
                    },
170
                ]
181
                ]
171
            }, table_settings, 1);
182
            }, table_settings, 1, additional_filters);
172
183
173
            $('#hideResolved').on("click", function() {
184
            $('#hideResolved').on("click", function() {
174
                // It would be great if we could pass null here but it gets stringified
185
                filtered = true;
175
                tickets.DataTable().columns('3').search('special:undefined').draw();
186
                tickets.DataTable().draw();
176
            });
187
            });
177
188
178
            $('#showAll').on("click", function() {
189
            $('#showAll').on("click", function() {
179
                tickets.DataTable().columns('3').search('').draw();
190
                filtered = false;
191
                tickets.DataTable().draw();
180
            });
192
            });
181
        });
193
        });
182
    </script>
194
    </script>
(-)a/koha-tmpl/intranet-tmpl/prog/js/datatables.js (-12 / +5 lines)
Lines 586-603 jQuery.fn.dataTable.ext.errMode = function(settings, note, message) { Link Here
586
                                        var part = {};
586
                                        var part = {};
587
                                        var attr = attributes[i];
587
                                        var attr = attributes[i];
588
                                        let criteria = options.criteria;
588
                                        let criteria = options.criteria;
589
                                        if ( value === 'special:undefined' ) {
589
                                        if ( value.match(/^\^(.*)\$$/) ) {
590
                                            value = null;
590
                                            value = value.replace(/^\^/, '').replace(/\$$/, '');
591
                                            criteria = "exact";
591
                                            criteria = "exact";
592
                                        }
592
                                        } else {
593
                                        if ( value !== null ) {
593
                                            // escape SQL LIKE special characters %
594
                                            if ( value.match(/^\^(.*)\$$/) ) {
594
                                            value = value.replace(/(\%|\\)/g, "\\$1");
595
                                                value = value.replace(/^\^/, '').replace(/\$$/, '');
596
                                                criteria = "exact";
597
                                            } else {
598
                                                // escape SQL LIKE special characters %
599
                                                value = value.replace(/(\%|\\)/g, "\\$1");
600
                                            }
601
                                        }
595
                                        }
602
                                        part[!attr.includes('.')?'me.'+attr:attr] = criteria === 'exact'
596
                                        part[!attr.includes('.')?'me.'+attr:attr] = criteria === 'exact'
603
                                            ? value
597
                                            ? value
604
- 

Return to bug 31028