1 $(document).ready(function() {
3 $(".cancel_recall").click(function(e){
4 if (confirmDelete(__("Are you sure you want to remove this recall?"))){
6 var $recall_id = $(this).data('id');
7 var $action = $(this).data('action');
9 'recall_id': $recall_id,
14 url: '/cgi-bin/koha/svc/recall',
19 .done(function(data) {
21 if(data.success == 0) {
22 message = __("The recall may have already been cancelled. Please refresh the page.");
24 message = __("Cancelled");
26 $self.parent().parent().parent().parent().html(message);
31 $(".expire_recall").click(function(e){
32 if (confirmDelete(__("Are you sure you want to expire this recall?"))){
34 var $recall_id = $(this).data('id');
35 var $action = $(this).data('action');
37 'recall_id': $recall_id,
42 url: '/cgi-bin/koha/svc/recall',
47 .done(function(data) {
49 if(data.success == 0) {
50 message = __("The recall may have already been expired. Please refresh the page.");
52 message = __("Expired");
54 $self.parent().parent().parent().parent().html(message);
59 $(".revert_recall").click(function(e){
60 if (confirmDelete(__("Are you sure you want to revert the waiting status of this recall?"))){
62 var $recall_id = $(this).data('id');
63 var $action = $(this).data('action');
65 'recall_id': $recall_id,
70 url: '/cgi-bin/koha/svc/recall',
75 .done(function(data) {
77 if(data.success == 0) {
78 message = __("The recall waiting status may have already been reverted. Please refresh the page.");
80 message = __("Waiting status reverted");
82 $self.parent().parent().parent().parent().html(message);
87 $(".overdue_recall").click(function(e){
88 if (confirmDelete(__("Are you sure you want to mark this recall as overdue?"))){
90 var $recall_id = $(this).data('id');
91 var $action = $(this).data('action');
93 'recall_id': $recall_id,
98 url: '/cgi-bin/koha/svc/recall',
103 .done(function(data) {
105 if(data.success == 0) {
106 message = __("The recall may have already been marked as overdue. Please refresh the page.");
108 message = __("Marked overdue");
110 $self.parent().parent().parent().parent().html(message);
115 $(".transit_recall").click(function(e){
116 if (confirmDelete(__("Are you sure you want to remove this recall and return the item to it's home library?"))){
118 var $recall_id = $(this).data('id');
119 var $action = $(this).data('action');
121 'recall_id': $recall_id,
126 url: '/cgi-bin/koha/svc/recall',
131 .done(function(data) {
133 if(data.success == 0) {
134 message = __("The recall may have already been removed. Please refresh the page.");
136 message = __("Cancelled");
138 $self.parent().parent().parent().parent().html(message);
143 $("#recalls-table").dataTable($.extend(true, {}, dataTablesDefaults, {
145 { 'bSortable': false, 'aTargets': [ 'nosort' ] },
146 { "sType": "title-string", "aTargets" : [ "title-string" ] },
147 { "sType": "anti-the", "aTargets": [ "anti-the" ] }
149 "sPaginationType": "full_numbers"
152 $("#cancel_selected").click(function(e){
153 if ($("input[name='recall_ids']:checked").length > 0){
154 return confirmDelete(__("Are you sure you want to remove the selected recall(s)?"));
156 alert(__("Please make a selection."));
160 $("#select_all").click(function(){
161 if ($("#select_all").prop("checked")){
162 $("input[name='recall_ids']").prop("checked", true);
164 $("input[name='recall_ids']").prop("checked", false);
168 $("#hide_old").click(function(){
169 if ($("#hide_old").prop("checked")){