Lines 954-965
$(document).ready(function() {
Link Here
|
954 |
"bAutoWidth": false, |
954 |
"bAutoWidth": false, |
955 |
"sDom": "rt", |
955 |
"sDom": "rt", |
956 |
"aaSorting": [], |
956 |
"aaSorting": [], |
|
|
957 |
"aoColumnDefs": [ |
958 |
{ "bSortable": false, "bSearchable": false, 'aTargets': ['NoSort'] }, |
959 |
{ "sType": "anti-the", "aTargets": ["anti-the"] }, |
960 |
], |
957 |
"aoColumns": [ |
961 |
"aoColumns": [ |
958 |
{ |
962 |
{ |
959 |
"mDataProp": "id", |
963 |
"mDataProp": "id", |
960 |
"bVisible": false, |
964 |
"bVisible": false, |
961 |
}, |
965 |
}, |
962 |
{ |
966 |
{ |
|
|
967 |
"mDataProp": function (oObj) { |
968 |
if (oObj.resolution) { |
969 |
return "is_resolved"; |
970 |
} else { |
971 |
return "is_unresolved"; |
972 |
} |
973 |
}, |
974 |
"bVisible": false, |
975 |
}, |
976 |
{ |
963 |
"mDataProp": function ( oObj ) { |
977 |
"mDataProp": function ( oObj ) { |
964 |
let title = '<a class="return-claim-title strong" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=' + oObj.biblionumber + '">' |
978 |
let title = '<a class="return-claim-title strong" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=' + oObj.biblionumber + '">' |
965 |
+ oObj.title |
979 |
+ oObj.title |
Lines 1068-1077
$(document).ready(function() {
Link Here
|
1068 |
fnCallback(json) |
1082 |
fnCallback(json) |
1069 |
} ); |
1083 |
} ); |
1070 |
}, |
1084 |
}, |
|
|
1085 |
"search": { "search": "is_unresolved" }, |
1086 |
"footerCallback": function (row, data, start, end, display) { |
1087 |
var api = this.api(); |
1088 |
// Total over all pages |
1089 |
var colData = api.column(1).data(); |
1090 |
var is_unresolved = 0; |
1091 |
var is_resolved = 0; |
1092 |
colData.each(function( index, value ){ |
1093 |
if( index == "is_unresolved" ){ is_unresolved++; } |
1094 |
if (index == "is_resolved") { is_resolved++; } |
1095 |
}); |
1096 |
// Update footer |
1097 |
$("#return-claims-controls").html( showClaimFilter( is_unresolved, is_resolved ) ) |
1098 |
} |
1071 |
}); |
1099 |
}); |
1072 |
} |
1100 |
} |
1073 |
} |
1101 |
} |
1074 |
|
1102 |
|
|
|
1103 |
function showClaimFilter( is_unresolved, is_resolved ){ |
1104 |
var showAll, showUnresolved; |
1105 |
var total = Number( is_unresolved ) + Number( is_resolved ); |
1106 |
if( total > 0 ){ |
1107 |
showAll = __nx("Show 1 claim", "Show all {count} claims", total, { count: total }); |
1108 |
} else { |
1109 |
showAll = ""; |
1110 |
} |
1111 |
if( is_unresolved > 0 ){ |
1112 |
showUnresolved = __nx("Show 1 unresolved claim", "Show {count} unresolved claims", is_unresolved, { count: is_unresolved }) |
1113 |
} else { |
1114 |
showUnresolved = ""; |
1115 |
} |
1116 |
$("#show_all_claims").html( showAll ); |
1117 |
$("#show_unresolved_claims").html( showUnresolved ); |
1118 |
} |
1119 |
|
1075 |
$('body').on('click', '.return-claim-tools-editnotes', function() { |
1120 |
$('body').on('click', '.return-claim-tools-editnotes', function() { |
1076 |
let id = $(this).data('return-claim-id'); |
1121 |
let id = $(this).data('return-claim-id'); |
1077 |
$('#return-claim-notes-static-' + id).parent().dblclick(); |
1122 |
$('#return-claim-notes-static-' + id).parent().dblclick(); |
Lines 1182-1185
$(document).ready(function() {
Link Here
|
1182 |
|
1227 |
|
1183 |
}); |
1228 |
}); |
1184 |
|
1229 |
|
|
|
1230 |
$("#show_all_claims").on("click", function(e){ |
1231 |
e.preventDefault(); |
1232 |
$(".ctrl_link").removeClass("disabled"); |
1233 |
$(this).addClass("disabled"); |
1234 |
$("#return-claims-table").DataTable().search("").draw(); |
1235 |
}); |
1236 |
|
1237 |
$("#show_unresolved_claims").on("click", function (e) { |
1238 |
e.preventDefault(); |
1239 |
$(".ctrl_link").removeClass("disabled"); |
1240 |
$(this).addClass("disabled"); |
1241 |
$("#return-claims-table").DataTable().search("is_unresolved").draw(); |
1242 |
}); |
1243 |
|
1185 |
}); |
1244 |
}); |
1186 |
- |
|
|