View | Details | Raw Unified | Return to bug 10694
Collapse All | Expand All

(-)a/Koha/Template/Plugin/Borrowers.pm (+2 lines)
Lines 44-49 in any way in the script. Link Here
44
sub IsDebarred {
44
sub IsDebarred {
45
    my ( $self, $borrower ) = @_;
45
    my ( $self, $borrower ) = @_;
46
46
47
    return unless $borrower;
48
47
    if ( $borrower->{'debarred'} && check_date( split( /-/, $borrower->{'debarred'} ) ) ) {
49
    if ( $borrower->{'debarred'} && check_date( split( /-/, $borrower->{'debarred'} ) ) ) {
48
        if ( Date_to_Days(Date::Calc::Today) < Date_to_Days( split( /-/, $borrower->{'debarred'} ) ) ) {
50
        if ( Date_to_Days(Date::Calc::Today) < Date_to_Days( split( /-/, $borrower->{'debarred'} ) ) ) {
49
            return 1;
51
            return 1;
(-)a/installer/data/mysql/updatedatabase.pl (-1 / +1 lines)
Lines 8018-8024 if ( CheckVersion($DBversion) ) { Link Here
8018
        INSERT INTO systempreferences
8018
        INSERT INTO systempreferences
8019
            (variable,value,explanation,options,type)
8019
            (variable,value,explanation,options,type)
8020
        VALUES
8020
        VALUES
8021
            ('SpecifyReturnDate',1,'Define whether to display \"Specify Return Date\" form in Circulation','','YesNo')
8021
            ('SpecifyReturnDate',0,'Define whether to display \"Specify Return Date\" form in Circulation','','YesNo')
8022
    });
8022
    });
8023
    print "Upgrade to $DBversion done (Bug 10694 - Allow arbitrary backdating of returns)\n";
8023
    print "Upgrade to $DBversion done (Bug 10694 - Allow arbitrary backdating of returns)\n";
8024
    SetVersion($DBversion);
8024
    SetVersion($DBversion);
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc (+28 lines)
Lines 21-26 function Date_from_syspref(dstring) { Link Here
21
        }
21
        }
22
}
22
}
23
23
24
function DateTime_from_syspref(date_time) {
25
        var parts = date_time.split(" ");
26
        var date = parts[0];
27
        var time = parts[1];
28
        parts = time.split(":");
29
        var hour = parts[0];
30
        var minute = parts[1];
31
32
        if ( hour < 0 || hour > 23 ) {
33
            return 0;
34
        }
35
        if ( minute < 0 || minute > 59 ) {
36
            return 0;
37
        }
38
39
        var datetime = Date_from_syspref( date );
40
41
        if ( isNaN( datetime.getTime() ) ) {
42
            return 0;
43
        }
44
45
        datetime.setHours( hour );
46
        datetime.setMinutes( minute );
47
48
        return datetime;
49
}
50
51
24
/* Instead of including multiple localization files as you would normally see with
52
/* Instead of including multiple localization files as you would normally see with
25
   jQueryUI we expose the localization strings in the default configuration */
53
   jQueryUI we expose the localization strings in the default configuration */
26
jQuery(function($){
54
jQuery(function($){
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-4 / +27 lines)
Lines 8-14 Link Here
8
[% INCLUDE 'doc-head-close.inc' %]
8
[% INCLUDE 'doc-head-close.inc' %]
9
9
10
[% INCLUDE 'calendar.inc' %]
10
[% INCLUDE 'calendar.inc' %]
11
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery-ui-timepicker-addon.js"></script>
11
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery-ui-timepicker-addon.min.js"></script>
12
12
13
<script type="text/javascript">
13
<script type="text/javascript">
14
//<![CDATA[
14
//<![CDATA[
Lines 19-27 function Dopop(link) { Link Here
19
$(document).ready(function () {
19
$(document).ready(function () {
20
    $("#return_date_override").datetimepicker({
20
    $("#return_date_override").datetimepicker({
21
        onClose: function(dateText, inst) { $("#barcode").focus(); },
21
        onClose: function(dateText, inst) { $("#barcode").focus(); },
22
        defaultDate: -1,
22
        hour: 23,
23
        hour: 23,
23
        minute: 59
24
        minute: 59,
25
        maxDate: 0
24
    });
26
    });
27
    $("#return_date_override").on("blur", function() {
28
            check_valid_return_date();
29
    });
30
    $("#checkin-form").submit(function( event ) {
31
        if ( !check_valid_return_date() ) {
32
            event.preventDefault();
33
        }
34
    });
35
36
    function check_valid_return_date() {
37
        if ( $("#return_date_override").val() ) {
38
            var datetime = DateTime_from_syspref( $("#return_date_override").val() );
39
            var now = new Date();
40
            if ( !datetime || datetime > now ) {
41
                alert("Invalid return date/time!");
42
                $("#return_date_override").val("")
43
                return false;
44
            }
45
        }
46
        return true;
47
    }
48
25
    $("#exemptcheck").change(function () {
49
    $("#exemptcheck").change(function () {
26
        if (this.checked == true) {
50
        if (this.checked == true) {
27
            $("#barcode").addClass("alert");
51
            $("#barcode").addClass("alert");
Lines 407-413 $(document).ready(function () { Link Here
407
    </div>
431
    </div>
408
</div>
432
</div>
409
	<div class="yui-g">
433
	<div class="yui-g">
410
    <form method="post" action="/cgi-bin/koha/circ/returns.pl" autocomplete="off" >
434
    <form id="checkin-form" method="post" action="/cgi-bin/koha/circ/returns.pl" autocomplete="off" >
411
    <div class="yui-u first">
435
    <div class="yui-u first">
412
            <fieldset>
436
            <fieldset>
413
	<legend>Check in</legend>
437
	<legend>Check in</legend>
414
- 

Return to bug 10694