|
Lines 302-308
KOHA.OverDriveCirculation = new function() {
Link Here
|
| 302 |
if( confirm( __("Are you sure you want to return this item?") ) ) { |
302 |
if( confirm( __("Are you sure you want to return this item?") ) ) { |
| 303 |
item_action({action: "return", id: id}, el, copies_available + 1); |
303 |
item_action({action: "return", id: id}, el, copies_available + 1); |
| 304 |
} |
304 |
} |
| 305 |
}) ); |
305 |
}, "checkin") ); |
| 306 |
|
306 |
|
| 307 |
return item; |
307 |
return item; |
| 308 |
} |
308 |
} |
|
Lines 343-354
KOHA.OverDriveCirculation = new function() {
Link Here
|
| 343 |
} |
343 |
} |
| 344 |
}); |
344 |
}); |
| 345 |
} |
345 |
} |
| 346 |
}) ); |
346 |
}, "checkout") ); |
| 347 |
} |
347 |
} |
| 348 |
else if (!item) { |
348 |
else if (!item) { |
| 349 |
$(el).append( ajax_button( __("Place hold"), function() { |
349 |
$(el).append( ajax_button( __("Place hold"), function() { |
| 350 |
item_action({action: "place-hold", id: id}, el, copies_available); |
350 |
item_action({action: "place-hold", id: id}, el, copies_available); |
| 351 |
}) ); |
351 |
}, "placehold") ); |
| 352 |
} |
352 |
} |
| 353 |
|
353 |
|
| 354 |
if (item) { |
354 |
if (item) { |
|
Lines 356-382
KOHA.OverDriveCirculation = new function() {
Link Here
|
| 356 |
if( confirm( __("Are you sure you want to cancel this hold?") ) ) { |
356 |
if( confirm( __("Are you sure you want to cancel this hold?") ) ) { |
| 357 |
item_action({action: "remove-hold", id: id}, el, copies_available); |
357 |
item_action({action: "remove-hold", id: id}, el, copies_available); |
| 358 |
} |
358 |
} |
| 359 |
}) ); |
359 |
}, "cancelhold") ); |
| 360 |
} |
360 |
} |
| 361 |
return item; |
361 |
return item; |
| 362 |
} |
362 |
} |
| 363 |
} |
363 |
} |
| 364 |
|
364 |
|
| 365 |
function ajax_button(label, on_click) { |
365 |
function ajax_button(label, on_click, uniqueName) { |
| 366 |
var button = $('<a href="#">') |
366 |
var button = $('<a href="#">') |
| 367 |
.click(function(e) { |
367 |
.click(function(e) { |
| 368 |
e.preventDefault(); |
368 |
e.preventDefault(); |
| 369 |
on_click(); |
369 |
on_click(); |
| 370 |
}); |
370 |
}); |
| 371 |
decorate_button(button, label); |
371 |
decorate_button(button, label, uniqueName); |
| 372 |
return button; |
372 |
return button; |
| 373 |
} |
373 |
} |
| 374 |
|
374 |
|
| 375 |
function decorate_button(button, label) { |
375 |
function decorate_button(button, label, uniqueName) { |
| 376 |
$(button) |
376 |
$(button) |
| 377 |
.addClass("btn btn-primary btn-sm") |
377 |
.addClass("btn btn-primary btn-sm") |
| 378 |
.css("color","white") |
378 |
.css("color","white") |
| 379 |
.text(label); |
379 |
.text(label) |
|
|
380 |
.addClass(uniqueName); |
| 380 |
} |
381 |
} |
| 381 |
|
382 |
|
| 382 |
function checkout_format(el, id, formats, copies_available) { |
383 |
function checkout_format(el, id, formats, copies_available) { |
| 383 |
- |
|
|