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

(-)a/C4/Circulation.pm (-1 / +3 lines)
Lines 1059-1067 sub CanBookBeIssued { Link Here
1059
        }
1059
        }
1060
1060
1061
        my $now = dt_from_string();
1061
        my $now = dt_from_string();
1062
        my $preventChechoutOnSameReservePeriod =
1063
            C4::Context->preference("PreventChechoutOnSameReservePeriod");
1062
        my $reserves_on_same_period =
1064
        my $reserves_on_same_period =
1063
            ReservesOnSamePeriod($item->{biblionumber}, $item->{itemnumber}, $now->ymd, $duedate);
1065
            ReservesOnSamePeriod($item->{biblionumber}, $item->{itemnumber}, $now->ymd, $duedate);
1064
        if ($reserves_on_same_period) {
1066
        if ($preventChechoutOnSameReservePeriod && $reserves_on_same_period) {
1065
            my $reserve = $reserves_on_same_period->[0];
1067
            my $reserve = $reserves_on_same_period->[0];
1066
            my $borrower = C4::Members::GetMember(borrowernumber => $reserve->{borrowernumber});
1068
            my $borrower = C4::Members::GetMember(borrowernumber => $reserve->{borrowernumber});
1067
            my $branchname = GetBranchName( $reserve->{branchcode} );
1069
            my $branchname = GetBranchName( $reserve->{branchcode} );
(-)a/installer/data/mysql/atomicupdate/bug_15261-add_preventchechoutonsamereserveperiod_syspref.sql (+1 lines)
Line 0 Link Here
1
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES ('PreventChechoutOnSameReservePeriod', '0', 'Prevent to checkout a document if a reserve on same period exists', NULL, 'YesNo');
(-)a/installer/data/mysql/atomicupdate/bug_15261-add_preventreservesonsameperiod_syspref.sql (+1 lines)
Line 0 Link Here
1
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES ('PreventReservesOnSamePeriod', '0', 'Prevent to hold a document if a reserve on same period exists', NULL, 'YesNo');
(-)a/installer/data/mysql/sysprefs.sql (-1 / +3 lines)
Lines 525-529 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
525
('XSLTDetailsDisplay','default','','Enable XSL stylesheet control over details page display on intranet','Free'),
525
('XSLTDetailsDisplay','default','','Enable XSL stylesheet control over details page display on intranet','Free'),
526
('XSLTResultsDisplay','default','','Enable XSL stylesheet control over results page display on intranet','Free'),
526
('XSLTResultsDisplay','default','','Enable XSL stylesheet control over results page display on intranet','Free'),
527
('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'),
527
('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'),
528
('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo')
528
('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo'),
529
('PreventChechoutOnSameReservePeriod','0','','Prevent to checkout a document if a reserve on same period exists','YesNo'),
530
('PreventReservesOnSamePeriod','0','','Prevent to hold a document if a reserve on same period exists','YesNo')
529
;
531
;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (+12 lines)
Lines 421-426 Circulation: Link Here
421
                  yes: Block
421
                  yes: Block
422
                  no: Allow
422
                  no: Allow
423
            - renewing of items.
423
            - renewing of items.
424
        -
425
            - pref: PreventChechoutOnSameReservePeriod
426
              choices:
427
                  yes: Do
428
                  no: "Don't"
429
            - If yes, checkouts periods can't overlap with a reserve period.
424
    Checkin Policy:
430
    Checkin Policy:
425
        -
431
        -
426
            - pref: BlockReturnOfWithdrawnItems
432
            - pref: BlockReturnOfWithdrawnItems
Lines 624-629 Circulation: Link Here
624
              choices:
630
              choices:
625
                  homebranch: "home library"
631
                  homebranch: "home library"
626
                  holdingbranch: "holding library"
632
                  holdingbranch: "holding library"
633
        -
634
            - pref: PreventReservesOnSamePeriod
635
              choices:
636
                  yes: Do
637
                  no: "Don't"
638
            - If yes, Reserves periods for the same document can't overlap.
627
    Fines Policy:
639
    Fines Policy:
628
        -
640
        -
629
            - Calculate fines based on days overdue
641
            - Calculate fines based on days overdue
(-)a/opac/opac-reserve.pl (-1 / +2 lines)
Lines 275-281 if ( $query->param('place_reserve') ) { Link Here
275
        }
275
        }
276
276
277
        if ($canreserve) {
277
        if ($canreserve) {
278
            if (ReservesOnSamePeriod($biblioNum, $itemNum, $startdate, $expiration_date)) {
278
            if (C4::Context->preference("PreventReservesOnSamePeriod") &&
279
                ReservesOnSamePeriod($biblioNum, $itemNum, $startdate, $expiration_date)) {
279
                $canreserve = 0;
280
                $canreserve = 0;
280
                $failed_holds++;
281
                $failed_holds++;
281
            }
282
            }
(-)a/reserve/placerequest.pl (-2 / +3 lines)
Lines 112-118 foreach my $biblionumber (keys %bibinfos) { Link Here
112
        }
112
        }
113
    }
113
    }
114
114
115
    if (!$confirm && ReservesOnSamePeriod($biblionumber, $checkitem, $startdate, $expirationdate)) {
115
    if (!$confirm &&
116
        ReservesOnSamePeriod($biblionumber, $checkitem, $startdate, $expirationdate) &&
117
        C4::Context->preference("PreventReservesOnSamePeriod")) {
116
        $overlap_reserves->{$biblionumber} = {
118
        $overlap_reserves->{$biblionumber} = {
117
            title => $reserve_title ,
119
            title => $reserve_title ,
118
            checkitem => $checkitem,
120
            checkitem => $checkitem,
119
- 

Return to bug 15261