Lines 934-945
$(document).ready(function() {
Link Here
|
934 |
"bAutoWidth": false, |
934 |
"bAutoWidth": false, |
935 |
"sDom": "rt", |
935 |
"sDom": "rt", |
936 |
"aaSorting": [], |
936 |
"aaSorting": [], |
|
|
937 |
"aoColumnDefs": [ |
938 |
{ "bSortable": false, "bSearchable": false, 'aTargets': ['NoSort'] }, |
939 |
{ "sType": "anti-the", "aTargets": ["anti-the"] }, |
940 |
], |
937 |
"aoColumns": [ |
941 |
"aoColumns": [ |
938 |
{ |
942 |
{ |
939 |
"mDataProp": "id", |
943 |
"mDataProp": "id", |
940 |
"bVisible": false, |
944 |
"bVisible": false, |
941 |
}, |
945 |
}, |
942 |
{ |
946 |
{ |
|
|
947 |
"mDataProp": function (oObj) { |
948 |
if (oObj.resolution) { |
949 |
return "is_resolved"; |
950 |
} else { |
951 |
return "is_unresolved"; |
952 |
} |
953 |
}, |
954 |
"bVisible": false, |
955 |
}, |
956 |
{ |
943 |
"mDataProp": function ( oObj ) { |
957 |
"mDataProp": function ( oObj ) { |
944 |
let title = '<a class="return-claim-title strong" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=' + oObj.biblionumber + '">' |
958 |
let title = '<a class="return-claim-title strong" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=' + oObj.biblionumber + '">' |
945 |
+ oObj.title |
959 |
+ oObj.title |
Lines 1047-1056
$(document).ready(function() {
Link Here
|
1047 |
fnCallback(json) |
1061 |
fnCallback(json) |
1048 |
} ); |
1062 |
} ); |
1049 |
}, |
1063 |
}, |
|
|
1064 |
"search": { "search": "is_unresolved" }, |
1065 |
"footerCallback": function (row, data, start, end, display) { |
1066 |
var api = this.api(); |
1067 |
// Total over all pages |
1068 |
var colData = api.column(1).data(); |
1069 |
var is_unresolved = 0; |
1070 |
var is_resolved = 0; |
1071 |
colData.each(function( index, value ){ |
1072 |
if( index == "is_unresolved" ){ is_unresolved++; } |
1073 |
if (index == "is_resolved") { is_resolved++; } |
1074 |
}); |
1075 |
// Update footer |
1076 |
$("#return-claims-controls").html( showClaimFilter( is_unresolved, is_resolved ) ) |
1077 |
} |
1050 |
}); |
1078 |
}); |
1051 |
} |
1079 |
} |
1052 |
} |
1080 |
} |
1053 |
|
1081 |
|
|
|
1082 |
function showClaimFilter( is_unresolved, is_resolved ){ |
1083 |
var showAll, showUnresolved; |
1084 |
var total = Number( is_unresolved ) + Number( is_resolved ); |
1085 |
if( total > 0 ){ |
1086 |
showAll = __nx("Show 1 claim", "Show all {count} claims", total, { count: total }); |
1087 |
} else { |
1088 |
showAll = ""; |
1089 |
} |
1090 |
if( is_unresolved > 0 ){ |
1091 |
showUnresolved = __nx("Show 1 unresolved claim", "Show {count} unresolved claims", is_unresolved, { count: is_unresolved }) |
1092 |
} else { |
1093 |
showUnresolved = ""; |
1094 |
} |
1095 |
$("#show_all_claims").html( showAll ); |
1096 |
$("#show_unresolved_claims").html( showUnresolved ); |
1097 |
} |
1098 |
|
1054 |
$('body').on('click', '.return-claim-tools-editnotes', function() { |
1099 |
$('body').on('click', '.return-claim-tools-editnotes', function() { |
1055 |
let id = $(this).data('return-claim-id'); |
1100 |
let id = $(this).data('return-claim-id'); |
1056 |
$('#return-claim-notes-static-' + id).parent().dblclick(); |
1101 |
$('#return-claim-notes-static-' + id).parent().dblclick(); |
Lines 1155-1158
$(document).ready(function() {
Link Here
|
1155 |
|
1200 |
|
1156 |
}); |
1201 |
}); |
1157 |
|
1202 |
|
|
|
1203 |
$("#show_all_claims").on("click", function(e){ |
1204 |
e.preventDefault(); |
1205 |
$(".ctrl_link").removeClass("disabled"); |
1206 |
$(this).addClass("disabled"); |
1207 |
$("#return-claims-table").DataTable().search("").draw(); |
1208 |
}); |
1209 |
|
1210 |
$("#show_unresolved_claims").on("click", function (e) { |
1211 |
e.preventDefault(); |
1212 |
$(".ctrl_link").removeClass("disabled"); |
1213 |
$(this).addClass("disabled"); |
1214 |
$("#return-claims-table").DataTable().search("is_unresolved").draw(); |
1215 |
}); |
1216 |
|
1158 |
}); |
1217 |
}); |
1159 |
- |
|
|