Lines 153-186
$(document).ready(function() {
Link Here
|
153 |
params.date_due = dueDate |
153 |
params.date_due = dueDate |
154 |
} |
154 |
} |
155 |
|
155 |
|
156 |
$.post( "/cgi-bin/koha/svc/renew", params, function( data ) { |
156 |
if( parseFloat(fines) > parseFloat(amountlimit) ) { |
157 |
var id = "#renew_" + data.itemnumber; |
157 |
|
158 |
|
158 |
if(confirm("The patron has a debt of "+ fines +".\n Are you sure you want to renew checkout(s)?")){ |
159 |
var content = ""; |
159 |
renew(params); |
160 |
if ( data.renew_okay ) { |
|
|
161 |
content = CIRCULATION_RENEWED_DUE + " " + data.date_due; |
162 |
$('#date_due_' + data.itemnumber).replaceWith( data.date_due ); |
163 |
} else { |
164 |
content = CIRCULATION_RENEW_FAILED + " "; |
165 |
if ( data.error == "no_checkout" ) { |
166 |
content += NOT_CHECKED_OUT; |
167 |
} else if ( data.error == "too_many" ) { |
168 |
content += TOO_MANY_RENEWALS; |
169 |
} else if ( data.error == "on_reserve" ) { |
170 |
content += ON_RESERVE; |
171 |
} else if ( data.error == "restriction" ) { |
172 |
content += NOT_RENEWABLE_RESTRICTION; |
173 |
} else if ( data.error == "overdue" ) { |
174 |
content += NOT_RENEWABLE_OVERDUE; |
175 |
} else if ( data.error ) { |
176 |
content += data.error; |
177 |
} else { |
178 |
content += REASON_UNKNOWN; |
179 |
} |
180 |
} |
160 |
} |
181 |
|
161 |
|
182 |
$(id).replaceWith( content ); |
162 |
} else { |
183 |
}, "json") |
163 |
renew(params); |
|
|
164 |
} |
184 |
}); |
165 |
}); |
185 |
|
166 |
|
186 |
// Refocus on barcode field if it exists |
167 |
// Refocus on barcode field if it exists |
Lines 192-197
$(document).ready(function() {
Link Here
|
192 |
return false; |
173 |
return false; |
193 |
}); |
174 |
}); |
194 |
|
175 |
|
|
|
176 |
function renew(params){ |
177 |
$.post( "/cgi-bin/koha/svc/renew", params, function( data ) { |
178 |
var id = "#renew_" + data.itemnumber; |
179 |
|
180 |
var content = ""; |
181 |
if ( data.renew_okay ) { |
182 |
content = CIRCULATION_RENEWED_DUE + " " + data.date_due; |
183 |
$('#date_due_' + data.itemnumber).replaceWith( data.date_due ); |
184 |
} else { |
185 |
content = CIRCULATION_RENEW_FAILED + " "; |
186 |
if ( data.error == "no_checkout" ) { |
187 |
content += NOT_CHECKED_OUT; |
188 |
} else if ( data.error == "too_many" ) { |
189 |
content += TOO_MANY_RENEWALS; |
190 |
} else if ( data.error == "on_reserve" ) { |
191 |
content += ON_RESERVE; |
192 |
} else if ( data.error == "restriction" ) { |
193 |
content += NOT_RENEWABLE_RESTRICTION; |
194 |
} else if ( data.error == "overdue" ) { |
195 |
content += NOT_RENEWABLE_OVERDUE; |
196 |
} else if ( data.error ) { |
197 |
content += data.error; |
198 |
} else { |
199 |
content += REASON_UNKNOWN; |
200 |
} |
201 |
} |
202 |
|
203 |
$(id).replaceWith( content ); |
204 |
}, "json") |
205 |
} |
206 |
|
195 |
$("#RenewAll").on("click",function(){ |
207 |
$("#RenewAll").on("click",function(){ |
196 |
$("#CheckAllRenewals").click(); |
208 |
$("#CheckAllRenewals").click(); |
197 |
$("#UncheckAllCheckins").click(); |
209 |
$("#UncheckAllCheckins").click(); |
198 |
- |
|
|