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

(-)a/C4/Reserves.pm (-4 / +19 lines)
Lines 887-903 sub CancelExpiredReserves { Link Here
887
    if ( C4::Context->preference("ExpireReservesMaxPickUpDelay") ) {
887
    if ( C4::Context->preference("ExpireReservesMaxPickUpDelay") ) {
888
        my $max_pickup_delay = C4::Context->preference("ReservesMaxPickUpDelay");
888
        my $max_pickup_delay = C4::Context->preference("ReservesMaxPickUpDelay");
889
        my $charge = C4::Context->preference("ExpireReservesMaxPickUpDelayCharge");
889
        my $charge = C4::Context->preference("ExpireReservesMaxPickUpDelayCharge");
890
        my $cancel_on_holidays = C4::Context->preference('ExpireReservesOnHolidays');
891
892
        my $today = C4::Dates->new();
890
893
891
        my $query = "SELECT * FROM reserves WHERE TO_DAYS( NOW() ) - TO_DAYS( waitingdate ) > ? AND found = 'W' AND priority = 0";
894
        my $query = "SELECT * FROM reserves WHERE TO_DAYS( NOW() ) - TO_DAYS( waitingdate ) > ? AND found = 'W' AND priority = 0";
892
        $sth = $dbh->prepare( $query );
895
        $sth = $dbh->prepare( $query );
893
        $sth->execute( $max_pickup_delay );
896
        $sth->execute( $max_pickup_delay );
894
897
895
        while (my $res = $sth->fetchrow_hashref ) {
898
        while ( my $res = $sth->fetchrow_hashref ) {
896
            if ( $charge ) {
899
            my $do_cancel = 1;
897
                manualinvoice($res->{'borrowernumber'}, $res->{'itemnumber'}, 'Hold waiting too long', 'F', $charge);
900
            unless ( $cancel_on_holidays ) {
901
                my $calendar = C4::Calendar->new( branchcode => $res->{'branchcode'} );
902
                my $is_holiday = $calendar->isHoliday( split( '/', $today->output('metric') ) );
903
904
                if ( $is_holiday ) {
905
                    $do_cancel = 0;
906
                }
898
            }
907
            }
899
908
900
            CancelReserve( $res->{'biblionumber'}, '', $res->{'borrowernumber'} );
909
            if ( $do_cancel ) {
910
                if ( $charge ) {
911
                    manualinvoice($res->{'borrowernumber'}, $res->{'itemnumber'}, 'Hold waiting too long', 'F', $charge);
912
                }
913
914
                CancelReserve( $res->{'biblionumber'}, '', $res->{'borrowernumber'} );
915
            }
901
        }
916
        }
902
    }
917
    }
903
918
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 386-388 INSERT INTO systempreferences (variable,value,explanation,type) VALUES('OPACdidy Link Here
386
INSERT INTO systempreferences (variable,value,explanation,type) VALUES('INTRAdidyoumean',NULL,'Did you mean? configuration for the Intranet. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free');
386
INSERT INTO systempreferences (variable,value,explanation,type) VALUES('INTRAdidyoumean',NULL,'Did you mean? configuration for the Intranet. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free');
387
INSERT INTO systempreferences (variable, value, options, explanation, type) VALUES ('BlockReturnOfWithdrawnItems', '1', '0', 'If enabled, items that are marked as withdrawn cannot be returned.', 'YesNo');
387
INSERT INTO systempreferences (variable, value, options, explanation, type) VALUES ('BlockReturnOfWithdrawnItems', '1', '0', 'If enabled, items that are marked as withdrawn cannot be returned.', 'YesNo');
388
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('HoldsToPullStartDate','2','Set the default start date for the Holds to pull list to this many days ago',NULL,'Integer');
388
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('HoldsToPullStartDate','2','Set the default start date for the Holds to pull list to this many days ago',NULL,'Integer');
389
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('ExpireReservesOnHolidays', '1', NULL, 'If false, reserves at a library will not be canceled on days the library is not open.', 'YesNo');
(-)a/installer/data/mysql/updatedatabase.pl (+8 lines)
Lines 5769-5774 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
5769
    SetVersion($DBversion);
5769
    SetVersion($DBversion);
5770
}
5770
}
5771
5771
5772
<<<<<<< HEAD
5772
$DBversion = '3.09.00.044';
5773
$DBversion = '3.09.00.044';
5773
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
5774
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
5774
    $dbh->do("ALTER TABLE statistics ADD COLUMN ccode VARCHAR ( 10 ) NULL AFTER associatedborrower");
5775
    $dbh->do("ALTER TABLE statistics ADD COLUMN ccode VARCHAR ( 10 ) NULL AFTER associatedborrower");
Lines 6038-6043 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
6038
    $sth->execute( $new_syspref_value );
6039
    $sth->execute( $new_syspref_value );
6039
6040
6040
    print "Upgrade to $DBversion done (Bug 8832, Set the syspref gist with the existing values)\n";
6041
    print "Upgrade to $DBversion done (Bug 8832, Set the syspref gist with the existing values)\n";
6042
   SetVersion ($DBversion);
6043
}
6044
6045
$DBversion ="3.09.00.XXX";
6046
if(C4::Context->preference("Version") < TransformToNum($DBversion) ) {
6047
    $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('ExpireReservesOnHolidays', '1', NULL, 'If false, reserves at a library will not be canceled on days the library is not open.', 'YesNo')");
6048
    print "Upgrade to $DBversion done (Add syspref ExpireReservesOnHolidays\n";
6041
    SetVersion ($DBversion);
6049
    SetVersion ($DBversion);
6042
}
6050
}
6043
6051
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-1 / +6 lines)
Lines 424-429 Circulation: Link Here
424
                  no: "Don't allow"
424
                  no: "Don't allow"
425
            - holds to be suspended from the OPAC.
425
            - holds to be suspended from the OPAC.
426
        -
426
        -
427
            - pref: ExpireReservesOnHolidays
428
              choices:
429
                  yes: Allow
430
                  no: "Don't allow"
431
            - expired holds to be canceled on days the library is closed..
432
        -
427
            - pref: decreaseLoanHighHolds
433
            - pref: decreaseLoanHighHolds
428
              choices:
434
              choices:
429
                  yes: Enable
435
                  yes: Enable
430
- 

Return to bug 8735