Lines 527-533
Link Here
|
527 |
<th scope="col" class="updated"> </th> |
527 |
<th scope="col" class="updated"> </th> |
528 |
<th scope="col" class="updated_formatted">Updated on</th> |
528 |
<th scope="col" class="updated_formatted">Updated on</th> |
529 |
<th scope="col">Replied</th> |
529 |
<th scope="col">Replied</th> |
530 |
<th scope="col">Completed on</th> |
530 |
<th scope="col" class="completed"> </th> |
|
|
531 |
<th scope="col" class="completed_formatted">Completed on</th> |
531 |
<th scope="col">Access URL</th> |
532 |
<th scope="col">Access URL</th> |
532 |
<th scope="col">Cost</th> |
533 |
<th scope="col">Cost</th> |
533 |
<th scope="col">Comments</th> |
534 |
<th scope="col">Comments</th> |
Lines 749-754
Link Here
|
749 |
'</a>' : ''; |
750 |
'</a>' : ''; |
750 |
}; |
751 |
}; |
751 |
|
752 |
|
|
|
753 |
// Our 'render' function for title |
754 |
var createTitle = function(data, type, row) { |
755 |
return ( |
756 |
row.hasOwnProperty('metadata_container_title') && |
757 |
row.metadata_container_title |
758 |
) ? row.metadata_container_title : row.metadata_title; |
759 |
}; |
760 |
|
752 |
// Render function for request ID |
761 |
// Render function for request ID |
753 |
var createRequestId = function(data, type, row) { |
762 |
var createRequestId = function(data, type, row) { |
754 |
return row.id_prefix + row.illrequest_id; |
763 |
return row.id_prefix + row.illrequest_id; |
Lines 834-839
Link Here
|
834 |
func: createBiblioLink, |
843 |
func: createBiblioLink, |
835 |
skipSanitize: true |
844 |
skipSanitize: true |
836 |
}, |
845 |
}, |
|
|
846 |
metadata_title: { |
847 |
func: createTitle |
848 |
}, |
837 |
metadata_Type: { |
849 |
metadata_Type: { |
838 |
func: createType |
850 |
func: createType |
839 |
}, |
851 |
}, |
Lines 905-911
Link Here
|
905 |
// Get our data from the API and process it prior to passing |
917 |
// Get our data from the API and process it prior to passing |
906 |
// it to datatables |
918 |
// it to datatables |
907 |
var ajax = $.ajax( |
919 |
var ajax = $.ajax( |
908 |
'/api/v1/illrequests?embed=metadata,patron,capabilities,library,status_alias' |
920 |
'/api/v1/illrequests?embed=metadata,patron,capabilities,library,status_alias,comments' |
909 |
).done(function() { |
921 |
).done(function() { |
910 |
var data = JSON.parse(ajax.responseText); |
922 |
var data = JSON.parse(ajax.responseText); |
911 |
// Make a copy, we'll be removing columns next and need |
923 |
// Make a copy, we'll be removing columns next and need |
Lines 960-965
Link Here
|
960 |
}); |
972 |
}); |
961 |
colData.push(colObj); |
973 |
colData.push(colObj); |
962 |
}); |
974 |
}); |
|
|
975 |
console.log(colData); |
963 |
|
976 |
|
964 |
// Initialise the datatable |
977 |
// Initialise the datatable |
965 |
table = KohaTable("ill-requests", { |
978 |
table = KohaTable("ill-requests", { |
Lines 978-983
Link Here
|
978 |
// unformatted column |
991 |
// unformatted column |
979 |
'aTargets': [ 'updated_formatted'], |
992 |
'aTargets': [ 'updated_formatted'], |
980 |
'iDataSort': 16 |
993 |
'iDataSort': 16 |
|
|
994 |
}, |
995 |
{ // When sorting 'completed', we want to use the |
996 |
// unformatted column |
997 |
'aTargets': [ 'completed_formatted'], |
998 |
'iDataSort': 19 |
981 |
} |
999 |
} |
982 |
], |
1000 |
], |
983 |
'aaSorting': [[ 16, 'desc' ]], // Default sort, updated descending |
1001 |
'aaSorting': [[ 16, 'desc' ]], // Default sort, updated descending |
984 |
- |
|
|