|
Lines 808-818
Link Here
|
| 808 |
<div class="date-select" id="return_date_override_fields"> |
808 |
<div class="date-select" id="return_date_override_fields"> |
| 809 |
<div class="hint">Specify return date [% INCLUDE 'date-format.inc' %]: </div> |
809 |
<div class="hint">Specify return date [% INCLUDE 'date-format.inc' %]: </div> |
| 810 |
|
810 |
|
| 811 |
<input type="text" size="13" id="return_date_override" name="return_date_override" value="[% return_date_override | html %]" /> |
811 |
<input type="text" size="20" class="pastdate" id="return_date_override" name="return_date_override" value="[% return_date_override | html %]" /> |
| 812 |
|
812 |
|
| 813 |
|
|
|
| 814 |
|
| 815 |
<button type="button" class="action btn btn-default btn-xs" id="cleardate" name="cleardate">Clear</button> |
| 816 |
<div class="circ-setting"> |
813 |
<div class="circ-setting"> |
| 817 |
[% IF ( return_date_override_remember ) %] |
814 |
[% IF ( return_date_override_remember ) %] |
| 818 |
<input type="checkbox" id="return_date_override_remember" name="return_date_override_remember" checked="checked" /> |
815 |
<input type="checkbox" id="return_date_override_remember" name="return_date_override_remember" checked="checked" /> |
|
Lines 1041-1084
Link Here
|
| 1041 |
"dom": 'B<"clearfix">t', |
1038 |
"dom": 'B<"clearfix">t', |
| 1042 |
}, columns_settings); |
1039 |
}, columns_settings); |
| 1043 |
|
1040 |
|
| 1044 |
$("#return_date_override").datetimepicker({ |
1041 |
$("#return_date_override").flatpickr({ |
| 1045 |
onClose: function(dateText, inst) { |
1042 |
enableTime: true, |
| 1046 |
if (validate_date(dateText, inst) ) { |
1043 |
dateFormat: flatpickr_dateformat_string + " " + flatpickr_timeformat_string, |
| 1047 |
$("#barcode").focus(); |
1044 |
maxDate: "today", |
| 1048 |
} |
1045 |
onClose: function() { |
| 1049 |
}, |
1046 |
$("#barcode").focus(); |
| 1050 |
defaultDate: -1, |
|
|
| 1051 |
hour: 23, |
| 1052 |
minute: 59, |
| 1053 |
maxDate: 0 |
| 1054 |
}).on("change", function(e, value) { |
| 1055 |
if ( ! is_valid_date( $(this).val() ) ) {$(this).val("");} |
| 1056 |
}); |
| 1057 |
$("#return_date_override").on("blur", function() { |
| 1058 |
check_valid_return_date(); |
| 1059 |
}); |
| 1060 |
$("#checkin-form").submit(function( event ) { |
| 1061 |
if ( !check_valid_return_date() ) { |
| 1062 |
event.preventDefault(); |
| 1063 |
} |
1047 |
} |
| 1064 |
}); |
1048 |
}); |
| 1065 |
|
1049 |
|
| 1066 |
function check_valid_return_date() { |
|
|
| 1067 |
if ( $("#return_date_override").val() ) { |
| 1068 |
var datetime = DateTime_from_syspref( $("#return_date_override").val() ); |
| 1069 |
var now = new Date(); |
| 1070 |
if ( !datetime || datetime > now ) { |
| 1071 |
alert("Invalid return date/time!"); |
| 1072 |
$("#return_date_override").val("") |
| 1073 |
return false; |
| 1074 |
} |
| 1075 |
} |
| 1076 |
// Add saved date information to onscreen message, which |
| 1077 |
// may or may not be hidden |
| 1078 |
$("#saved_return_date").text( $("#return_date_override").val() ); |
| 1079 |
return true; |
| 1080 |
} |
| 1081 |
|
| 1082 |
$("#exemptcheck").change(function () { |
1050 |
$("#exemptcheck").change(function () { |
| 1083 |
if (this.checked == true) { |
1051 |
if (this.checked == true) { |
| 1084 |
$("#barcode").addClass("input-warning"); |
1052 |
$("#barcode").addClass("input-warning"); |
|
Lines 1089-1110
Link Here
|
| 1089 |
} |
1057 |
} |
| 1090 |
$("#barcode").focus(); |
1058 |
$("#barcode").focus(); |
| 1091 |
}); |
1059 |
}); |
|
|
1060 |
|
| 1092 |
$("#dropboxcheck").change(function () { |
1061 |
$("#dropboxcheck").change(function () { |
| 1093 |
if (this.checked == true) { |
1062 |
if (this.checked == true) { |
| 1094 |
$("#barcode").addClass("input-warning"); |
1063 |
$("#barcode").addClass("input-warning"); |
| 1095 |
$("#dropboxmode").show(); |
1064 |
$("#dropboxmode").show(); |
| 1096 |
|
1065 |
|
| 1097 |
$("#return_date_override_fields :input").prop('disabled', true); |
1066 |
$("#return_date_override_fields :input").prop('disabled', true); |
| 1098 |
$("#return_date_override").datetimepicker("disable"); |
|
|
| 1099 |
} else { |
1067 |
} else { |
| 1100 |
$("#barcode").removeClass("input-warning"); |
1068 |
$("#barcode").removeClass("input-warning"); |
| 1101 |
$("#dropboxmode").hide(); |
1069 |
$("#dropboxmode").hide(); |
| 1102 |
|
1070 |
|
| 1103 |
$("#return_date_override_fields :input").prop('disabled', false); |
1071 |
$("#return_date_override_fields :input").prop('disabled', false); |
| 1104 |
$("#return_date_override").datetimepicker("enable"); |
|
|
| 1105 |
} |
1072 |
} |
| 1106 |
$("#barcode").focus(); |
1073 |
$("#barcode").focus(); |
| 1107 |
}); |
1074 |
}); |
|
|
1075 |
|
| 1108 |
$("#forgivemanualholdsexpire").change(function () { |
1076 |
$("#forgivemanualholdsexpire").change(function () { |
| 1109 |
if (this.checked == true) { |
1077 |
if (this.checked == true) { |
| 1110 |
$("#barcode").addClass("input-warning"); |
1078 |
$("#barcode").addClass("input-warning"); |