if ( state.needs_override === true ) {
$text = $(
'<span>' + state.text + '</span> <span style="float:right;" title="' +
- _("This pickup location is not allowed according to circulation rules") +
+ __("This pickup location is not allowed according to circulation rules") +
'"><i class="fa fa-exclamation-circle" aria-hidden="true"></i></span>'
);
}
url = '/api/v1/holds/' + encodeURIComponent(hold_id) + '/pickup_locations';
}
- select.select2({
+ select.kohaSelect({
width: 'style',
allowClear: false,
ajax: {
);
});
return { "results": results, "pagination": { "more": data.pagination.more } };
- },
- transport: kohaSelect2Transport,
+ }
},
templateResult: display_pickup_location
});
title = "<a href='/cgi-bin/koha/reserve/request.pl?biblionumber="
+ oObj.biblionumber
+ "'>"
- + oObj.title.escapeHtml();
+ + (oObj.title ? oObj.title.escapeHtml() : '');
$.each(oObj.subtitle, function( index, value ) {
title += " " + value.escapeHtml();
{
"mDataProp": function( oObj ) {
var data = "";
+ if ( oObj.itemtype ) {
+ data += oObj.itemtype_description;
+ }
+ return data;
+ }
+ },
+ {
+ "mDataProp": function( oObj ) {
+ var data = "";
if ( oObj.barcode ) {
data += " <a href='/cgi-bin/koha/catalogue/moredetail.pl?biblionumber="
+ oObj.biblionumber
alert(__("Unable to resume, hold not found"));
}
else {
- alert(_("Your request could not be processed. Check the logs"));
+ alert(__("Your request could not be processed. Check the logs"));
}
holdsTable.api().ajax.reload();
});
<input type='hidden' id='suspend-modal-reserve_id' name='reserve_id' />\
\
<label for='suspend-modal-until'>" + __("Suspend until:") + "</label>\
- <input name='suspend_until' id='suspend-modal-until' class='suspend-until' size='10' />\
+ <input name='suspend_until' id='suspend-modal-until' class='suspend-until flatpickr' data-flatpickr-futuredate='true' size='10' />\
\
<p><a class='btn btn-link' id='suspend-modal-clear-date' >" + __("Clear date to suspend indefinitely") + "</a></p>\
\
</div>\
");
- $("#suspend-modal-until").flatpickr({
- minDate: new Date().fp_incr(1) // Require that "until date" be in the future
- });
$("#suspend-modal-clear-date").on( "click", function() { $("#suspend-modal-until").val(""); } );
$("#suspend-modal-submit").on( "click", function( e ) {
alert(__("Unable to suspend, hold not found"));
}
else {
- alert(_("Your request could not be processed. Check the logs"));
+ alert(__("Your request could not be processed. Check the logs"));
}
holdsTable.api().ajax.reload();
}).done(function() {
$('#suspend-modal').modal('hide');
});
});
+
+ $(".toggle-suspend").on('click', function(e) {
+ e.preventDefault();
+ let reserve_id = $(this).data('reserve-id');
+ let biblionumber = $(this).data('biblionumber');
+ let suspend_until = $('#suspend_until_' + reserve_id).val();
+ window.location.href='request.pl?action=toggleSuspend&reserve_id=' + reserve_id + '&biblionumber=' + biblionumber + '&suspend_until=' + suspend_until;
+ return false;
+ });
});