|
Lines 521-528
Link Here
|
| 521 |
<th scope="col">Order ID</th> |
521 |
<th scope="col">Order ID</th> |
| 522 |
<th scope="col">Patron ID</th> |
522 |
<th scope="col">Patron ID</th> |
| 523 |
<th scope="col" class="patron_cardnumber">Patron barcode</th> |
523 |
<th scope="col" class="patron_cardnumber">Patron barcode</th> |
| 524 |
<th scope="col">Biblio ID</th> |
|
|
| 525 |
<th scope="col">Patron</th> |
524 |
<th scope="col">Patron</th> |
|
|
525 |
<th scope="col">Biblio ID</th> |
| 526 |
<th scope="col">Branch</th> |
526 |
<th scope="col">Branch</th> |
| 527 |
<th scope="col">Status</th> |
527 |
<th scope="col">Status</th> |
| 528 |
<th scope="col" class="placed"> </th> |
528 |
<th scope="col" class="placed"> </th> |
|
Lines 530-535
Link Here
|
| 530 |
<th scope="col">Replied</th> |
530 |
<th scope="col">Replied</th> |
| 531 |
<th scope="col" class="updated"> </th> |
531 |
<th scope="col" class="updated"> </th> |
| 532 |
<th scope="col" class="updated_formatted">Updated on</th> |
532 |
<th scope="col" class="updated_formatted">Updated on</th> |
|
|
533 |
<th scope="col">Replied</th> |
| 533 |
<th scope="col">Completed on</th> |
534 |
<th scope="col">Completed on</th> |
| 534 |
<th scope="col">Access URL</th> |
535 |
<th scope="col">Access URL</th> |
| 535 |
<th scope="col">Cost</th> |
536 |
<th scope="col">Cost</th> |
|
Lines 615-621
Link Here
|
| 615 |
var sel = $('#illfilter_status option:selected').val(); |
616 |
var sel = $('#illfilter_status option:selected').val(); |
| 616 |
if (sel && sel.length > 0) { |
617 |
if (sel && sel.length > 0) { |
| 617 |
activeFilters[me] = function() { |
618 |
activeFilters[me] = function() { |
| 618 |
table.column(5).search(sel); |
619 |
table.api().column(15).search(sel); |
| 619 |
} |
620 |
} |
| 620 |
} else { |
621 |
} else { |
| 621 |
if (activeFilters.hasOwnProperty(me)) { |
622 |
if (activeFilters.hasOwnProperty(me)) { |
|
Lines 632-638
Link Here
|
| 632 |
prep: function(tableData, oData) { |
633 |
prep: function(tableData, oData) { |
| 633 |
var uniques = {}; |
634 |
var uniques = {}; |
| 634 |
tableData.forEach(function(row) { |
635 |
tableData.forEach(function(row) { |
| 635 |
uniques[row.library.branchname] = 1 |
636 |
uniques[row.library_branchname] = 1 |
| 636 |
}); |
637 |
}); |
| 637 |
Object.keys(uniques).sort().forEach(function(unique) { |
638 |
Object.keys(uniques).sort().forEach(function(unique) { |
| 638 |
$('#illfilter_branchname').append( |
639 |
$('#illfilter_branchname').append( |
|
Lines 647-653
Link Here
|
| 647 |
var sel = $('#illfilter_branchname option:selected').val(); |
648 |
var sel = $('#illfilter_branchname option:selected').val(); |
| 648 |
if (sel && sel.length > 0) { |
649 |
if (sel && sel.length > 0) { |
| 649 |
activeFilters[me] = function() { |
650 |
activeFilters[me] = function() { |
| 650 |
table.column(4).search(sel); |
651 |
table.api().column(14).search(sel); |
| 651 |
} |
652 |
} |
| 652 |
} else { |
653 |
} else { |
| 653 |
if (activeFilters.hasOwnProperty(me)) { |
654 |
if (activeFilters.hasOwnProperty(me)) { |
|
Lines 667-673
Link Here
|
| 667 |
var val = $('#illfilter_barcode').val(); |
668 |
var val = $('#illfilter_barcode').val(); |
| 668 |
if (val && val.length > 0) { |
669 |
if (val && val.length > 0) { |
| 669 |
activeFilters[me] = function() { |
670 |
activeFilters[me] = function() { |
| 670 |
table.column(12).search(val); |
671 |
table.api().column(11).search(val); |
| 671 |
} |
672 |
} |
| 672 |
} else { |
673 |
} else { |
| 673 |
if (activeFilters.hasOwnProperty(me)) { |
674 |
if (activeFilters.hasOwnProperty(me)) { |
|
Lines 736-743
Link Here
|
| 736 |
if ( row.patron_firstname ) { |
737 |
if ( row.patron_firstname ) { |
| 737 |
patronLink = patronLink + row.patron_firstname + ' '; |
738 |
patronLink = patronLink + row.patron_firstname + ' '; |
| 738 |
} |
739 |
} |
| 739 |
patronLink = patronLink + row.patron_surname + |
740 |
patronLink = patronLink + row.patron_surname + '</a>'; |
| 740 |
' [' + row.patron_cardnumber + ' ]</a>'; |
|
|
| 741 |
return patronLink; |
741 |
return patronLink; |
| 742 |
}; |
742 |
}; |
| 743 |
|
743 |
|
|
Lines 883-893
Link Here
|
| 883 |
}); |
883 |
}); |
| 884 |
}); |
884 |
}); |
| 885 |
|
885 |
|
| 886 |
// Display the modal containing request supplier metadata |
886 |
// Display the modal containing request supplier metadata |
| 887 |
$('#ill-request-display-metadata').on('click', function(e) { |
887 |
$('#ill-request-display-metadata').on('click', function(e) { |
| 888 |
e.preventDefault(); |
888 |
e.preventDefault(); |
| 889 |
$('#dataPreview').modal({show:true}); |
889 |
$('#dataPreview').modal({show:true}); |
| 890 |
}); |
890 |
}); |
| 891 |
|
891 |
|
| 892 |
// Get our data from the API and process it prior to passing |
892 |
// Get our data from the API and process it prior to passing |
| 893 |
// it to datatables |
893 |
// it to datatables |
|
Lines 913-918
Link Here
|
| 913 |
var colObj = $.extend({}, thisCol); |
913 |
var colObj = $.extend({}, thisCol); |
| 914 |
colObj.name = colName; |
914 |
colObj.name = colName; |
| 915 |
colObj.className = colName; |
915 |
colObj.className = colName; |
|
|
916 |
colObj.defaultContent = ''; |
| 916 |
|
917 |
|
| 917 |
// We may need to process the data going in this |
918 |
// We may need to process the data going in this |
| 918 |
// column, so do it if necessary |
919 |
// column, so do it if necessary |
|
Lines 936-941
Link Here
|
| 936 |
}); |
937 |
}); |
| 937 |
|
938 |
|
| 938 |
// Initialise the datatable |
939 |
// Initialise the datatable |
|
|
940 |
table = KohaTable("ill-requests", {}) |
| 939 |
var illTable = KohaTable("ill-requests", { |
941 |
var illTable = KohaTable("ill-requests", { |
| 940 |
'aoColumnDefs': [ |
942 |
'aoColumnDefs': [ |
| 941 |
{ // Last column shouldn't be sortable or searchable |
943 |
{ // Last column shouldn't be sortable or searchable |
|
Lines 943-962
Link Here
|
| 943 |
'bSortable': false, |
945 |
'bSortable': false, |
| 944 |
'bSearchable': false |
946 |
'bSearchable': false |
| 945 |
}, |
947 |
}, |
| 946 |
{ // Hide the two date columns we use just for sorting |
|
|
| 947 |
'aTargets': [ 'placed', 'updated' ], |
| 948 |
'bVisible': false, |
| 949 |
'bSearchable': true |
| 950 |
}, |
| 951 |
{ // When sorting 'placed', we want to use the |
948 |
{ // When sorting 'placed', we want to use the |
| 952 |
// unformatted column |
949 |
// unformatted column |
| 953 |
'aTargets': [ 'placed_formatted'], |
950 |
'aTargets': [ 'placed_formatted'], |
| 954 |
'iDataSort': 7 |
951 |
'iDataSort': 16 |
| 955 |
}, |
952 |
}, |
| 956 |
{ // When sorting 'updated', we want to use the |
953 |
{ // When sorting 'updated', we want to use the |
| 957 |
// unformatted column |
954 |
// unformatted column |
| 958 |
'aTargets': [ 'updated_formatted'], |
955 |
'aTargets': [ 'updated_formatted'], |
| 959 |
'iDataSort': 9 |
956 |
'iDataSort': 18 |
| 960 |
}, |
957 |
}, |
| 961 |
{ |
958 |
{ |
| 962 |
'aTargets': [ 'patron_cardnumber' ], |
959 |
'aTargets': [ 'patron_cardnumber' ], |
|
Lines 964-970
Link Here
|
| 964 |
'bSearchable': true |
961 |
'bSearchable': true |
| 965 |
} |
962 |
} |
| 966 |
], |
963 |
], |
| 967 |
'aaSorting': [[ 9, 'desc' ]], // Default sort, updated descending |
964 |
'aaSorting': [[ 18, 'desc' ]], // Default sort, updated descending |
| 968 |
'processing': true, // Display a message when manipulating |
965 |
'processing': true, // Display a message when manipulating |
| 969 |
'sPaginationType': "full_numbers", // Pagination display |
966 |
'sPaginationType': "full_numbers", // Pagination display |
| 970 |
'deferRender': true, // Improve performance on big datasets |
967 |
'deferRender': true, // Improve performance on big datasets |
|
Lines 995-1002
Link Here
|
| 995 |
var placedEnd = $('#illfilter_dateplaced_end').datepicker('getDate'); |
992 |
var placedEnd = $('#illfilter_dateplaced_end').datepicker('getDate'); |
| 996 |
var modifiedStart = $('#illfilter_datemodified_start').datepicker('getDate'); |
993 |
var modifiedStart = $('#illfilter_datemodified_start').datepicker('getDate'); |
| 997 |
var modifiedEnd = $('#illfilter_datemodified_end').datepicker('getDate'); |
994 |
var modifiedEnd = $('#illfilter_datemodified_end').datepicker('getDate'); |
| 998 |
var rowPlaced = data[6] ? new Date(data[6]) : null; |
995 |
var rowPlaced = data[16] ? new Date(data[16]) : null; |
| 999 |
var rowModified = data[8] ? new Date(data[8]) : null; |
996 |
var rowModified = data[18] ? new Date(data[18]) : null; |
| 1000 |
var placedPassed = true; |
997 |
var placedPassed = true; |
| 1001 |
var modifiedPassed = true; |
998 |
var modifiedPassed = true; |
| 1002 |
if (placedStart && rowPlaced && rowPlaced < placedStart) { |
999 |
if (placedStart && rowPlaced && rowPlaced < placedStart) { |
|
Lines 1020-1026
Link Here
|
| 1020 |
); |
1017 |
); |
| 1021 |
|
1018 |
|
| 1022 |
var clearSearch = function() { |
1019 |
var clearSearch = function() { |
| 1023 |
table.search('').columns().search(''); |
1020 |
table.api().search('').columns().search(''); |
| 1024 |
activeFilters = {}; |
1021 |
activeFilters = {}; |
| 1025 |
for (var filter in filterable) { |
1022 |
for (var filter in filterable) { |
| 1026 |
if ( |
1023 |
if ( |
|
Lines 1030-1036
Link Here
|
| 1030 |
filterable[filter].clear(); |
1027 |
filterable[filter].clear(); |
| 1031 |
} |
1028 |
} |
| 1032 |
} |
1029 |
} |
| 1033 |
table.draw(); |
1030 |
table.api().draw(); |
| 1034 |
}; |
1031 |
}; |
| 1035 |
|
1032 |
|
| 1036 |
// Apply any search filters, or clear any previous |
1033 |
// Apply any search filters, or clear any previous |
|
Lines 1043-1049
Link Here
|
| 1043 |
activeFilters[active](); |
1040 |
activeFilters[active](); |
| 1044 |
} |
1041 |
} |
| 1045 |
} |
1042 |
} |
| 1046 |
table.draw(); |
1043 |
table.api().draw(); |
| 1047 |
}); |
1044 |
}); |
| 1048 |
|
1045 |
|
| 1049 |
// Clear all filters |
1046 |
// Clear all filters |
| 1050 |
- |
|
|