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