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

(-)a/admin/columns_settings.yml (-11 / +21 lines)
Lines 262-282 modules: Link Here
262
        -
262
        -
263
          columnname: illrequest_id
263
          columnname: illrequest_id
264
        -
264
        -
265
          columnname: metadata_Author
265
          columnname: metadata_author
266
        -
266
        -
267
          columnname: metadata_Title
267
          columnname: metadata_title
268
        -
268
        -
269
          columnname: metadata_Item_part_title
269
          columnname: metadata_item_part_title
270
        -
270
        -
271
          columnname: metadata_Issue
271
          columnname: metadata_issue
272
        -
272
        -
273
          columnname: metadata_Volume
273
          columnname: metadata_volume
274
        -
274
        -
275
          columnname: metadata_Year
275
          columnname: metadata_year
276
        -
276
        -
277
          columnname: metadata_Item_part_pages
277
          columnname: metadata_item_part_pages
278
        -
278
        -
279
          columnname: metadata_Type
279
          columnname: metadata_type
280
        -
280
        -
281
          columnname: orderid
281
          columnname: orderid
282
        -
282
        -
Lines 284-302 modules: Link Here
284
        -
284
        -
285
          columnname: patron_cardnumber
285
          columnname: patron_cardnumber
286
        -
286
        -
287
          columnname: biblio_id
287
          columnname: patron
288
        -
288
        -
289
          columnname: borrowernumber
289
          columnname: biblio_id
290
        -
290
        -
291
          columnname: library_branchname
291
          columnname: library_branchname
292
        -
292
        -
293
          columnname: status
293
          columnname: status
294
        -
294
        -
295
          columnname: placed
295
          columnname: placed
296
          cannot_be_toggled: 1
297
          cannot_be_modified: 1
298
          is_hidden: 1
296
        -
299
        -
297
          columnname: replied
300
          columnname: placed_formatted
298
        -
301
        -
299
          columnname: updated
302
          columnname: updated
303
          cannot_be_toggled: 1
304
          cannot_be_modified: 1
305
          is_hidden: 1
306
        -
307
          columnname: updated_formatted
308
        -
309
          columnname: replied
300
        -
310
        -
301
          columnname: completed
311
          columnname: completed
302
        -
312
        -
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt (-36 / +24 lines)
Lines 507-521 Link Here
507
                                    <th scope="col">Order ID</th>
507
                                    <th scope="col">Order ID</th>
508
                                    <th scope="col">Patron ID</th>
508
                                    <th scope="col">Patron ID</th>
509
                                    <th scope="col" class="patron_cardnumber">Patron barcode</th>
509
                                    <th scope="col" class="patron_cardnumber">Patron barcode</th>
510
                                    <th scope="col">Biblio ID</th>
511
                                    <th scope="col">Patron</th>
510
                                    <th scope="col">Patron</th>
511
                                    <th scope="col">Biblio ID</th>
512
                                    <th scope="col">Branch</th>
512
                                    <th scope="col">Branch</th>
513
                                    <th scope="col">Status</th>
513
                                    <th scope="col">Status</th>
514
                                    <th scope="col" class="placed">&nbsp;</th>
514
                                    <th scope="col" class="placed">&nbsp;</th>
515
                                    <th scope="col" class="placed_formatted">Placed on</th>
515
                                    <th scope="col" class="placed_formatted">Placed on</th>
516
                                    <th scope="col">Replied</th>
517
                                    <th scope="col" class="updated">&nbsp;</th>
516
                                    <th scope="col" class="updated">&nbsp;</th>
518
                                    <th scope="col" class="updated_formatted">Updated on</th>
517
                                    <th scope="col" class="updated_formatted">Updated on</th>
518
                                    <th scope="col">Replied</th>
519
                                    <th scope="col">Completed on</th>
519
                                    <th scope="col">Completed on</th>
520
                                    <th scope="col">Access URL</th>
520
                                    <th scope="col">Access URL</th>
521
                                    <th scope="col">Cost</th>
521
                                    <th scope="col">Cost</th>
Lines 597-603 Link Here
597
                            var sel = $('#illfilter_status option:selected').val();
597
                            var sel = $('#illfilter_status option:selected').val();
598
                            if (sel && sel.length > 0) {
598
                            if (sel && sel.length > 0) {
599
                                activeFilters[me] = function() {
599
                                activeFilters[me] = function() {
600
                                    table.column(5).search(sel);
600
                                    table.api().column(15).search(sel);
601
                                }
601
                                }
602
                            } else {
602
                            } else {
603
                                if (activeFilters.hasOwnProperty(me)) {
603
                                if (activeFilters.hasOwnProperty(me)) {
Lines 614-620 Link Here
614
                    prep: function(tableData, oData) {
614
                    prep: function(tableData, oData) {
615
                        var uniques = {};
615
                        var uniques = {};
616
                        tableData.forEach(function(row) {
616
                        tableData.forEach(function(row) {
617
                            uniques[row.library.branchname] = 1
617
                            uniques[row.library_branchname] = 1
618
                        });
618
                        });
619
                        Object.keys(uniques).sort().forEach(function(unique) {
619
                        Object.keys(uniques).sort().forEach(function(unique) {
620
                            $('#illfilter_branchname').append(
620
                            $('#illfilter_branchname').append(
Lines 629-635 Link Here
629
                            var sel = $('#illfilter_branchname option:selected').val();
629
                            var sel = $('#illfilter_branchname option:selected').val();
630
                            if (sel && sel.length > 0) {
630
                            if (sel && sel.length > 0) {
631
                                activeFilters[me] = function() {
631
                                activeFilters[me] = function() {
632
                                    table.column(4).search(sel);
632
                                    table.api().column(14).search(sel);
633
                                }
633
                                }
634
                            } else {
634
                            } else {
635
                                if (activeFilters.hasOwnProperty(me)) {
635
                                if (activeFilters.hasOwnProperty(me)) {
Lines 649-655 Link Here
649
                            var val = $('#illfilter_barcode').val();
649
                            var val = $('#illfilter_barcode').val();
650
                            if (val && val.length > 0) {
650
                            if (val && val.length > 0) {
651
                                activeFilters[me] = function() {
651
                                activeFilters[me] = function() {
652
                                    table.column(12).search(val);
652
                                    table.api().column(11).search(val);
653
                                }
653
                                }
654
                            } else {
654
                            } else {
655
                                if (activeFilters.hasOwnProperty(me)) {
655
                                if (activeFilters.hasOwnProperty(me)) {
Lines 718-725 Link Here
718
                if ( row.patron_firstname ) {
718
                if ( row.patron_firstname ) {
719
                    patronLink = patronLink + row.patron_firstname + ' ';
719
                    patronLink = patronLink + row.patron_firstname + ' ';
720
                }
720
                }
721
                patronLink = patronLink + row.patron_surname +
721
                patronLink = patronLink + row.patron_surname + '</a>';
722
                    ' [' + row.patron_cardnumber + ' ]</a>';
723
                return patronLink;
722
                return patronLink;
724
            };
723
            };
725
724
Lines 806-812 Link Here
806
                action: {
805
                action: {
807
                    func: createActionLink
806
                    func: createActionLink
808
                },
807
                },
809
                borrowernumber: {
808
                patron: {
810
                    func: createPatronLink
809
                    func: createPatronLink
811
                },
810
                },
812
                illrequest_id: {
811
                illrequest_id: {
Lines 865-875 Link Here
865
                });
864
                });
866
            });
865
            });
867
866
868
        // Display the modal containing request supplier metadata
867
            // Display the modal containing request supplier metadata
869
        $('#ill-request-display-metadata').on('click', function(e) {
868
            $('#ill-request-display-metadata').on('click', function(e) {
870
            e.preventDefault();
869
                e.preventDefault();
871
            $('#dataPreview').modal({show:true});
870
                $('#dataPreview').modal({show:true});
872
        });
871
            });
873
872
874
            // Get our data from the API and process it prior to passing
873
            // Get our data from the API and process it prior to passing
875
            // it to datatables
874
            // it to datatables
Lines 895-900 Link Here
895
                        var colObj = $.extend({}, thisCol);
894
                        var colObj = $.extend({}, thisCol);
896
                        colObj.name = colName;
895
                        colObj.name = colName;
897
                        colObj.className = colName;
896
                        colObj.className = colName;
897
                        colObj.defaultContent = '';
898
898
899
                        // We may need to process the data going in this
899
                        // We may need to process the data going in this
900
                        // column, so do it if necessary
900
                        // column, so do it if necessary
Lines 918-952 Link Here
918
                    });
918
                    });
919
919
920
                    // Initialise the datatable
920
                    // Initialise the datatable
921
                    var illTable = KohaTable("ill-requests", {
921
                    table = KohaTable("ill-requests", {
922
                        'aoColumnDefs': [
922
                        'aoColumnDefs': [
923
                            { // Last column shouldn't be sortable or searchable
923
                            { // Last column shouldn't be sortable or searchable
924
                                'aTargets': [ 'actions' ],
924
                                'aTargets': [ 'actions' ],
925
                                'bSortable': false,
925
                                'bSortable': false,
926
                                'bSearchable': false
926
                                'bSearchable': false
927
                            },
927
                            },
928
                            { // Hide the two date columns we use just for sorting
929
                                'aTargets': [ 'placed', 'updated' ],
930
                                'bVisible': false,
931
                                'bSearchable': true
932
                            },
933
                            { // When sorting 'placed', we want to use the
928
                            { // When sorting 'placed', we want to use the
934
                              // unformatted column
929
                              // unformatted column
935
                              'aTargets': [ 'placed_formatted'],
930
                              'aTargets': [ 'placed_formatted'],
936
                              'iDataSort': 7
931
                              'iDataSort': 16
937
                            },
932
                            },
938
                            { // When sorting 'updated', we want to use the
933
                            { // When sorting 'updated', we want to use the
939
                              // unformatted column
934
                              // unformatted column
940
                              'aTargets': [ 'updated_formatted'],
935
                              'aTargets': [ 'updated_formatted'],
941
                              'iDataSort': 9
936
                              'iDataSort': 18
942
                            },
943
                            {
944
                                'aTargets': [ 'patron_cardnumber' ],
945
                                'bVisible': false,
946
                                'bSearchable': true
947
                            }
937
                            }
948
                        ],
938
                        ],
949
                        'aaSorting': [[ 9, 'desc' ]], // Default sort, updated descending
939
                        'aaSorting': [[ 18, 'desc' ]], // Default sort, updated descending
950
                        'processing': true, // Display a message when manipulating
940
                        'processing': true, // Display a message when manipulating
951
                        'sPaginationType': "full_numbers", // Pagination display
941
                        'sPaginationType': "full_numbers", // Pagination display
952
                        'deferRender': true, // Improve performance on big datasets
942
                        'deferRender': true, // Improve performance on big datasets
Lines 955-961 Link Here
955
                        'originalData': data, // Enable render functions to access
945
                        'originalData': data, // Enable render functions to access
956
                                              // our original data
946
                                              // our original data
957
                        'initComplete': function() {
947
                        'initComplete': function() {
958
959
                            // Prepare any filter elements that need it
948
                            // Prepare any filter elements that need it
960
                            for (var el in filterable) {
949
                            for (var el in filterable) {
961
                                if (filterable.hasOwnProperty(el)) {
950
                                if (filterable.hasOwnProperty(el)) {
Lines 977-984 Link Here
977
                        var placedEnd = $('#illfilter_dateplaced_end').datepicker('getDate');
966
                        var placedEnd = $('#illfilter_dateplaced_end').datepicker('getDate');
978
                        var modifiedStart = $('#illfilter_datemodified_start').datepicker('getDate');
967
                        var modifiedStart = $('#illfilter_datemodified_start').datepicker('getDate');
979
                        var modifiedEnd = $('#illfilter_datemodified_end').datepicker('getDate');
968
                        var modifiedEnd = $('#illfilter_datemodified_end').datepicker('getDate');
980
                        var rowPlaced = data[6] ? new Date(data[6]) : null;
969
                        var rowPlaced = data[16] ? new Date(data[16]) : null;
981
                        var rowModified = data[8] ? new Date(data[8]) : null;
970
                        var rowModified = data[18] ? new Date(data[18]) : null;
982
                        var placedPassed = true;
971
                        var placedPassed = true;
983
                        var modifiedPassed = true;
972
                        var modifiedPassed = true;
984
                        if (placedStart && rowPlaced && rowPlaced < placedStart) {
973
                        if (placedStart && rowPlaced && rowPlaced < placedStart) {
Lines 1002-1008 Link Here
1002
            );
991
            );
1003
992
1004
            var clearSearch = function() {
993
            var clearSearch = function() {
1005
                table.search('').columns().search('');
994
                table.api().search('').columns().search('');
1006
                activeFilters = {};
995
                activeFilters = {};
1007
                for (var filter in filterable) {
996
                for (var filter in filterable) {
1008
                    if (
997
                    if (
Lines 1012-1031 Link Here
1012
                        filterable[filter].clear();
1001
                        filterable[filter].clear();
1013
                    }
1002
                    }
1014
                }
1003
                }
1015
                table.draw();
1004
                table.api().draw();
1016
            };
1005
            };
1017
1006
1018
            // Apply any search filters, or clear any previous
1007
            // Apply any search filters, or clear any previous
1019
            // ones
1008
            // ones
1020
            $('#illfilter_form').submit(function(event) {
1009
            $('#illfilter_form').submit(function(event) {
1021
                event.preventDefault();
1010
                event.preventDefault();
1022
                table.search('').columns().search('');
1011
                table.api().search('').columns().search('');
1023
                for (var active in activeFilters) {
1012
                for (var active in activeFilters) {
1024
                    if (activeFilters.hasOwnProperty(active)) {
1013
                    if (activeFilters.hasOwnProperty(active)) {
1025
                        activeFilters[active]();
1014
                        activeFilters[active]();
1026
                    }
1015
                    }
1027
                }
1016
                }
1028
                table.draw();
1017
                table.api().draw();
1029
            });
1018
            });
1030
1019
1031
            // Clear all filters
1020
            // Clear all filters
1032
- 

Return to bug 21063