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

(-)a/C4/Circulation.pm (+23 lines)
Lines 996-1001 sub CanBookBeIssued { Link Here
996
                    $needsconfirmation{'resborrowernumber'} = $patron->borrowernumber;
996
                    $needsconfirmation{'resborrowernumber'} = $patron->borrowernumber;
997
                    $needsconfirmation{'resbranchcode'} = $res->{branchcode};
997
                    $needsconfirmation{'resbranchcode'} = $res->{branchcode};
998
                    $needsconfirmation{'reswaitingdate'} = $res->{'waitingdate'};
998
                    $needsconfirmation{'reswaitingdate'} = $res->{'waitingdate'};
999
                    $needsconfirmation{resreserveid} = $res->{reserve_id};
999
                }
1000
                }
1000
                elsif ( $restype eq "Reserved" ) {
1001
                elsif ( $restype eq "Reserved" ) {
1001
                    # The item is on reserve for someone else.
1002
                    # The item is on reserve for someone else.
Lines 1006-1014 sub CanBookBeIssued { Link Here
1006
                    $needsconfirmation{'resborrowernumber'} = $patron->borrowernumber;
1007
                    $needsconfirmation{'resborrowernumber'} = $patron->borrowernumber;
1007
                    $needsconfirmation{'resbranchcode'} = $patron->branchcode;
1008
                    $needsconfirmation{'resbranchcode'} = $patron->branchcode;
1008
                    $needsconfirmation{'resreservedate'} = $res->{reservedate};
1009
                    $needsconfirmation{'resreservedate'} = $res->{reservedate};
1010
                    $needsconfirmation{resreserveid} = $res->{reserve_id};
1009
                }
1011
                }
1010
            }
1012
            }
1011
        }
1013
        }
1014
1015
        my $now = dt_from_string();
1016
        my $preventCheckoutOnSameReservePeriod =
1017
            C4::Context->preference("PreventCheckoutOnSameReservePeriod");
1018
        my $reserves_on_same_period =
1019
            ReservesOnSamePeriod($item->{biblionumber}, $item->{itemnumber}, $now->ymd, $duedate->ymd);
1020
        if ($preventCheckoutOnSameReservePeriod && $reserves_on_same_period) {
1021
            my $reserve = $reserves_on_same_period->[0];
1022
            my $patron = Koha::Patrons->find( $reserve->{borrowernumber} );
1023
            my $branchname = Koha::Libraries->find($reserve->{branchcode})->branchname;
1024
1025
            $needsconfirmation{RESERVED} = 1;
1026
            $needsconfirmation{resfirstname} = $patron->firstname;
1027
            $needsconfirmation{ressurname} = $patron->surname;
1028
            $needsconfirmation{rescardnumber} = $patron->cardnumber;
1029
            $needsconfirmation{resborrowernumber} = $patron->borrowernumber;
1030
            $needsconfirmation{resbranchname} = $branchname;
1031
            $needsconfirmation{resreservedate} = $reserve->{reservedate};
1032
            $needsconfirmation{resreserveid} = $reserve->{reserve_id};
1033
        }
1034
1012
    }
1035
    }
1013
1036
1014
    ## CHECK AGE RESTRICTION
1037
    ## CHECK AGE RESTRICTION
(-)a/C4/Reserves.pm (+48 lines)
Lines 134-139 BEGIN { Link Here
134
        &SuspendAll
134
        &SuspendAll
135
135
136
        &GetReservesControlBranch
136
        &GetReservesControlBranch
137
		&ReservesOnSamePeriod
137
138
138
        IsItemOnHoldAndFound
139
        IsItemOnHoldAndFound
139
140
Lines 2064-2069 sub GetHoldRule { Link Here
2064
    return $sth->fetchrow_hashref();
2065
    return $sth->fetchrow_hashref();
2065
}
2066
}
2066
2067
2068
=head2 ReservesOnSamePeriod
2069
2070
    my $reserve = ReservesOnSamePeriod( $biblionumber, $itemnumber, $resdate, $expdate);
2071
2072
    Return the reserve that match the period ($resdate => $expdate),
2073
    undef if no reserve match.
2074
2075
=cut
2076
2077
sub ReservesOnSamePeriod {
2078
    my ($biblionumber, $itemnumber, $resdate, $expdate) = @_;
2079
2080
    unless ($resdate && $expdate) {
2081
        return;
2082
    }
2083
2084
    my @reserves = Koha::Holds->search({ biblionumber => $biblionumber });
2085
2086
    $resdate = output_pref({ str => $resdate, dateonly => 1, dateformat => 'iso' });
2087
    $expdate = output_pref({ str => $expdate, dateonly => 1, dateformat => 'iso' });
2088
2089
    my @reserves_overlaps;
2090
    foreach my $reserve ( @reserves ) {
2091
2092
        unless ($reserve->reservedate && $reserve->expirationdate) {
2093
            next;
2094
        }
2095
2096
        if (date_ranges_overlap($resdate, $expdate,
2097
                                $reserve->reservedate,
2098
                                $reserve->expirationdate)) {
2099
2100
            # If reserve is item level and the requested periods overlap.
2101
            if ($itemnumber && $reserve->itemnumber == $itemnumber ) {
2102
                return [$reserve->unblessed];
2103
            }
2104
            push @reserves_overlaps, $reserve->unblessed;
2105
        }
2106
    }
2107
2108
    if ( @reserves_overlaps >= Koha::Items->search({ biblionumber => $biblionumber })->count() ) {
2109
        return \@reserves_overlaps;
2110
    }
2111
2112
    return;
2113
}
2114
2067
=head1 AUTHOR
2115
=head1 AUTHOR
2068
2116
2069
Koha Development Team <http://koha-community.org/>
2117
Koha Development Team <http://koha-community.org/>
(-)a/Koha/DateUtils.pm (-1 / +43 lines)
Lines 24-30 use Koha::Exceptions; Link Here
24
use base 'Exporter';
24
use base 'Exporter';
25
25
26
our @EXPORT = (
26
our @EXPORT = (
27
    qw( dt_from_string output_pref format_sqldatetime )
27
    qw( dt_from_string output_pref format_sqldatetime date_ranges_overlap )
28
);
28
);
29
29
30
=head1 DateUtils
30
=head1 DateUtils
Lines 317-320 sub format_sqldatetime { Link Here
317
    return q{};
317
    return q{};
318
}
318
}
319
319
320
=head2 date_ranges_overlap
321
322
    $bool = date_ranges_overlap($start1, $end1, $start2, $end2);
323
324
    Tells if first range ($start1 => $end1) overlaps
325
    the second one ($start2 => $end2)
326
327
=cut
328
329
sub date_ranges_overlap {
330
    my ($start1, $end1, $start2, $end2) = @_;
331
332
    $start1 = dt_from_string( $start1, 'iso' );
333
    $end1 = dt_from_string( $end1, 'iso' );
334
    $start2 = dt_from_string( $start2, 'iso' );
335
    $end2 = dt_from_string( $end2, 'iso' );
336
337
    if (
338
        # Start of range 2 is in the range 1.
339
        (
340
            DateTime->compare($start2, $start1) >= 0
341
            && DateTime->compare($start2, $end1) <= 0
342
        )
343
        ||
344
        # End of range 2 is in the range 1.
345
        (
346
            DateTime->compare($end2, $start1) >= 0
347
            && DateTime->compare($end2, $end1) <= 0
348
        )
349
        ||
350
        # Range 2 start before and end after range 1.
351
        (
352
            DateTime->compare($start2, $start1) < 0
353
            && DateTime->compare($end2, $end1) > 0
354
        )
355
    ) {
356
        return 1;
357
    }
358
359
    return;
360
}
361
320
1;
362
1;
(-)a/circ/circulation.pl (+4 lines)
Lines 419-424 if (@$barcodes) { Link Here
419
        }
419
        }
420
        unless($confirm_required) {
420
        unless($confirm_required) {
421
            my $switch_onsite_checkout = exists $messages->{ONSITE_CHECKOUT_WILL_BE_SWITCHED};
421
            my $switch_onsite_checkout = exists $messages->{ONSITE_CHECKOUT_WILL_BE_SWITCHED};
422
            if ( $cancelreserve eq 'cancel' ) {
423
                CancelReserve({ reserve_id => $query->param('reserveid') });
424
            }
425
            $cancelreserve = $cancelreserve eq 'revert' ? 'revert' : undef;
422
            my $issue = AddIssue( $patron->unblessed, $barcode, $datedue, $cancelreserve, undef, undef, { onsite_checkout => $onsite_checkout, auto_renew => $session->param('auto_renew'), switch_onsite_checkout => $switch_onsite_checkout, } );
426
            my $issue = AddIssue( $patron->unblessed, $barcode, $datedue, $cancelreserve, undef, undef, { onsite_checkout => $onsite_checkout, auto_renew => $session->param('auto_renew'), switch_onsite_checkout => $switch_onsite_checkout, } );
423
            $template_params->{issue} = $issue;
427
            $template_params->{issue} = $issue;
424
            $session->clear('auto_renew');
428
            $session->clear('auto_renew');
(-)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 ('PreventCheckoutOnSameReservePeriod', '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 603-607 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
603
('XSLTListsDisplay','default','','Enable XSLT stylesheet control over lists pages display on intranet','Free'),
603
('XSLTListsDisplay','default','','Enable XSLT stylesheet control over lists pages display on intranet','Free'),
604
('XSLTResultsDisplay','default','','Enable XSL stylesheet control over results page display on intranet','Free'),
604
('XSLTResultsDisplay','default','','Enable XSL stylesheet control over results page display on intranet','Free'),
605
('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'),
605
('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'),
606
('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo')
606
('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo'),
607
('PreventCheckoutOnSameReservePeriod','0','','Prevent to checkout a document if a reserve on same period exists','YesNo'),
608
('PreventReservesOnSamePeriod','0','','Prevent to hold a document if a reserve on same period exists','YesNo')
607
;
609
;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-708 / +720 lines)
Lines 1-714 Link Here
1
Circulation:
1
Circulation:
2
# FIXME: printcirculationslips is also omitted. It _technically_ could work, but C4::Print is HLT specific and needs a little bit of refactoring.
2
# FIXME: printcirculationslips is also omitted. It _technically_ could work, but C4::Print is HLT specific and needs a little bit of refactoring.
3
    Interface:
3
Interface:
4
        -
4
	-
5
            - pref: CircSidebar
5
		- pref: CircSidebar
6
              choices:
6
		  choices:
7
                  yes: Activate
7
			  yes: Activate
8
                  no: Deactivate
8
			  no: Deactivate
9
            - the navigation sidebar on all Circulation pages.
9
		- the navigation sidebar on all Circulation pages.
10
        -
10
	-
11
            - pref: AutoSwitchPatron
11
		- pref: AutoSwitchPatron
12
              choices:
12
		  choices:
13
                  yes: "Enable"
13
			  yes: "Enable"
14
                  no: "Don't enable"
14
			  no: "Don't enable"
15
            - the automatic redirection to another patron when a patron barcode is scanned instead of a book.
15
		- the automatic redirection to another patron when a patron barcode is scanned instead of a book.
16
            - This should not be enabled if you have overlapping patron and book barcodes.
16
		- This should not be enabled if you have overlapping patron and book barcodes.
17
        -
17
	-
18
            - pref: CircAutocompl
18
		- pref: CircAutocompl
19
              choices:
19
		  choices:
20
                  yes: Try
20
			  yes: Try
21
                  no: "Don't try"
21
			  no: "Don't try"
22
            - to guess the patron being entered while typing a patron search on the circulation screen.
22
		- to guess the patron being entered while typing a patron search on the circulation screen.
23
            - Only returns the first 10 results at a time.
23
		- Only returns the first 10 results at a time.
24
        -
24
	-
25
            - pref: itemBarcodeInputFilter
25
		- pref: itemBarcodeInputFilter
26
              choices:
26
		  choices:
27
                  OFF: "Don't filter"
27
			  OFF: "Don't filter"
28
                  whitespace: Remove spaces from
28
			  whitespace: Remove spaces from
29
                  cuecat: Convert from CueCat form
29
			  cuecat: Convert from CueCat form
30
                  T-prefix: Remove the first number from T-prefix style
30
			  T-prefix: Remove the first number from T-prefix style
31
                  libsuite8: Convert from Libsuite8 form
31
			  libsuite8: Convert from Libsuite8 form
32
                  EAN13: EAN-13 or zero-padded UPC-A from
32
			  EAN13: EAN-13 or zero-padded UPC-A from
33
            - scanned item barcodes.
33
		- scanned item barcodes.
34
        -
34
	-
35
            - pref: itemBarcodeFallbackSearch
35
		- pref: itemBarcodeFallbackSearch
36
              choices:
36
		  choices:
37
                  yes: "Enable"
37
			  yes: "Enable"
38
                  no: "Don't enable"
38
			  no: "Don't enable"
39
            - the automatic use of a keyword catalog search if the phrase entered as a barcode on the checkout page does not turn up any results during an item barcode search.
39
		- the automatic use of a keyword catalog search if the phrase entered as a barcode on the checkout page does not turn up any results during an item barcode search.
40
        -
40
	-
41
            - Sort previous checkouts on the circulation page from
41
		- Sort previous checkouts on the circulation page from
42
            - pref: previousIssuesDefaultSortOrder
42
		- pref: previousIssuesDefaultSortOrder
43
              choices:
43
		  choices:
44
                  asc: earliest to latest
44
			  asc: earliest to latest
45
                  desc: latest to earliest
45
			  desc: latest to earliest
46
            - due date.
46
		- due date.
47
        -
47
	-
48
            - "Sort today's checkouts on the circulation page from"
48
		- "Sort today's checkouts on the circulation page from"
49
            - pref: todaysIssuesDefaultSortOrder
49
		- pref: todaysIssuesDefaultSortOrder
50
              type: choice
50
		  type: choice
51
              choices:
51
		  choices:
52
                  asc: earliest to latest
52
			  asc: earliest to latest
53
                  desc: latest to earliest
53
			  desc: latest to earliest
54
            - due date.
54
		- due date.
55
        -
55
	-
56
            - pref: SpecifyDueDate
56
		- pref: SpecifyDueDate
57
              choices:
57
		  choices:
58
                  yes: Allow
58
			  yes: Allow
59
                  no: "Don't allow"
59
			  no: "Don't allow"
60
            - staff to specify a due date for a checkout.
60
		- staff to specify a due date for a checkout.
61
        -
61
	-
62
            - pref: SpecifyReturnDate
62
		- pref: SpecifyReturnDate
63
              choices:
63
		  choices:
64
                  yes: Allow
64
			  yes: Allow
65
                  no: "Don't allow"
65
			  no: "Don't allow"
66
            - staff to specify a return date for a check in.
66
		- staff to specify a return date for a check in.
67
        -
67
	-
68
            - Set the default start date for the Holds to pull list to
68
		- Set the default start date for the Holds to pull list to
69
            - pref: HoldsToPullStartDate
69
		- pref: HoldsToPullStartDate
70
              class: integer
70
		  class: integer
71
            - day(s) ago. Note that the default end date is controlled by preference ConfirmFutureHolds.
71
		- day(s) ago. Note that the default end date is controlled by preference ConfirmFutureHolds.
72
        -
72
	-
73
            - pref: AllowAllMessageDeletion
73
		- pref: AllowAllMessageDeletion
74
              choices:
74
		  choices:
75
                  yes: Allow
75
			  yes: Allow
76
                  no: "Don't allow"
76
			  no: "Don't allow"
77
            - staff to delete messages added from other libraries.
77
		- staff to delete messages added from other libraries.
78
        -
78
	-
79
            - Show the
79
		- Show the
80
            - pref: numReturnedItemsToShow
80
		- pref: numReturnedItemsToShow
81
              class: integer
81
		  class: integer
82
            - last returned items on the checkin screen.
82
		- last returned items on the checkin screen.
83
        -
83
	-
84
            - pref: FineNotifyAtCheckin
84
		- pref: FineNotifyAtCheckin
85
              choices:
85
		  choices:
86
                  yes: Notify
86
			  yes: Notify
87
                  no: "Don't notify"
87
			  no: "Don't notify"
88
            - librarians of overdue fines on the items they are checking in.
88
		- librarians of overdue fines on the items they are checking in.
89
        -
89
	-
90
            - pref: WaitingNotifyAtCheckin
90
		- pref: WaitingNotifyAtCheckin
91
              choices:
91
		  choices:
92
                  yes: Notify
92
			  yes: Notify
93
                  no: "Don't notify"
93
			  no: "Don't notify"
94
            - librarians of waiting holds for the patron whose items they are checking in.
94
		- librarians of waiting holds for the patron whose items they are checking in.
95
        -
95
	-
96
            - pref: FilterBeforeOverdueReport
96
		- pref: FilterBeforeOverdueReport
97
              choices:
97
		  choices:
98
                  yes: Require
98
			  yes: Require
99
                  no: "Don't require"
99
			  no: "Don't require"
100
            - staff to choose which checkouts to show before running the overdues report.
100
		- staff to choose which checkouts to show before running the overdues report.
101
        -
101
	-
102
            - pref: DisplayClearScreenButton
102
		- pref: DisplayClearScreenButton
103
              choices:
103
		  choices:
104
                  yes: Show
104
			  yes: Show
105
                  no: "Don't show"
105
			  no: "Don't show"
106
            - a button to clear the current patron from the screen on the circulation screen.
106
		- a button to clear the current patron from the screen on the circulation screen.
107
        -
107
	-
108
            - pref: RecordLocalUseOnReturn
108
		- pref: RecordLocalUseOnReturn
109
              choices:
109
		  choices:
110
                  yes: Record
110
			  yes: Record
111
                  no: "Don't record"
111
			  no: "Don't record"
112
            - local use when an unissued item is checked in.
112
		- local use when an unissued item is checked in.
113
        -
113
	-
114
            - When an empty barcode field is submitted in circulation
114
		- When an empty barcode field is submitted in circulation
115
            - pref: CircAutoPrintQuickSlip
115
		- pref: CircAutoPrintQuickSlip
116
              choices:
116
		  choices:
117
                  clear: "clear the screen"
117
			  clear: "clear the screen"
118
                  qslip: "open a print quick slip window"
118
			  qslip: "open a print quick slip window"
119
                  slip: "open a print slip window"
119
			  slip: "open a print slip window"
120
            - .
120
		- .
121
        -
121
	-
122
            - Include the stylesheet at
122
		- Include the stylesheet at
123
            - pref: NoticeCSS
123
		- pref: NoticeCSS
124
              class: url
124
		  class: url
125
            - on Notices. (This should be a complete URL, starting with <code>http://</code>)
125
		- on Notices. (This should be a complete URL, starting with <code>http://</code>)
126
        -
126
	-
127
            - pref: UpdateTotalIssuesOnCirc
127
		- pref: UpdateTotalIssuesOnCirc
128
              choices:
128
		  choices:
129
                  yes: Do
129
			  yes: Do
130
                  no: "Do not"
130
			  no: "Do not"
131
            - update a bibliographic record's total issues count whenever an item is issued (WARNING! This increases server load significantly; if performance is a concern, use the update_totalissues.pl cron job to update the total issues count).
131
		- update a bibliographic record's total issues count whenever an item is issued (WARNING! This increases server load significantly; if performance is a concern, use the update_totalissues.pl cron job to update the total issues count).
132
        -
132
	-
133
            - pref: ExportCircHistory
133
		- pref: ExportCircHistory
134
              choices:
134
		  choices:
135
                  yes: Show
135
			  yes: Show
136
                  no: "Don't show"
136
			  no: "Don't show"
137
            - the export patron checkout history options.
137
		- the export patron checkout history options.
138
        -
138
	-
139
            - The following fields should be excluded from the patron checkout history CSV or iso2709 export
139
		- The following fields should be excluded from the patron checkout history CSV or iso2709 export
140
            - pref: ExportRemoveFields
140
		- pref: ExportRemoveFields
141
            - (separate fields with space, e.g. 100a 200b 300c)
141
		- (separate fields with space, e.g. 100a 200b 300c)
142
        -
142
	-
143
            - pref: AllowOfflineCirculation
143
		- pref: AllowOfflineCirculation
144
              choices:
144
		  choices:
145
                  yes: Enable
145
			  yes: Enable
146
                  no: "Do not enable"
146
			  no: "Do not enable"
147
            - "offline circulation on regular circulation computers. (NOTE: This system preference does not affect the Firefox plugin or the desktop application)"
147
		- "offline circulation on regular circulation computers. (NOTE: This system preference does not affect the Firefox plugin or the desktop application)"
148
        -
148
	-
149
            - pref: ShowAllCheckins
149
		- pref: ShowAllCheckins
150
              choices:
150
		  choices:
151
                  yes: Show
151
			  yes: Show
152
                  no: "Do not show"
152
			  no: "Do not show"
153
            - all items in the "Checked-in items" list, even items that were not checked out.
153
		- all items in the "Checked-in items" list, even items that were not checked out.
154
        -
154
	-
155
            - pref: AllowCheckoutNotes
155
		- pref: AllowCheckoutNotes
156
              choices:
156
		  choices:
157
                  yes: Allow
157
			  yes: Allow
158
                  no: "Don't allow"
158
			  no: "Don't allow"
159
            - patrons to submit notes about checked out items.
159
		- patrons to submit notes about checked out items.
160
160
161
    Checkout Policy:
161
Checkout Policy:
162
        -
162
	-
163
            - pref: AllowTooManyOverride
163
		- pref: AllowTooManyOverride
164
              choices:
164
		  choices:
165
                  yes: Allow
165
			  yes: Allow
166
                  no: "Don't allow"
166
			  no: "Don't allow"
167
            - staff to override and check out items when the patron has reached the maximum number of allowed checkouts.
167
		- staff to override and check out items when the patron has reached the maximum number of allowed checkouts.
168
        -
168
	-
169
            - pref: AutoRemoveOverduesRestrictions
169
		- pref: AutoRemoveOverduesRestrictions
170
              choices:
170
		  choices:
171
                  yes: "Do"
171
			  yes: "Do"
172
                  no: "Do not"
172
			  no: "Do not"
173
            - allow OVERDUES restrictions triggered by sent notices to be cleared automatically when all overdue items are returned by a patron.
173
		- allow OVERDUES restrictions triggered by sent notices to be cleared automatically when all overdue items are returned by a patron.
174
        -
174
	-
175
            - pref: AllowNotForLoanOverride
175
		- pref: AllowNotForLoanOverride
176
              choices:
176
		  choices:
177
                  yes: Allow
177
			  yes: Allow
178
                  no: "Don't allow"
178
			  no: "Don't allow"
179
            - staff to override and check out items that are marked as not for loan.
179
		- staff to override and check out items that are marked as not for loan.
180
        -
180
	-
181
            - pref: AllowRenewalLimitOverride
181
		- pref: AllowRenewalLimitOverride
182
              choices:
182
		  choices:
183
                  yes: Allow
183
			  yes: Allow
184
                  no: "Don't allow"
184
			  no: "Don't allow"
185
            - staff to manually override renewal blocks and renew a checkout when it would go over the renewal limit or be premature with respect to the "No renewal before" setting in the circulation policy or has been scheduled for automatic renewal.
185
		- staff to manually override renewal blocks and renew a checkout when it would go over the renewal limit or be premature with respect to the "No renewal before" setting in the circulation policy or has been scheduled for automatic renewal.
186
        -
186
	-
187
            - pref: AllowItemsOnHoldCheckout
187
		- pref: AllowItemsOnHoldCheckout
188
              choices:
188
		  choices:
189
                  yes: Allow
189
			  yes: Allow
190
                  no: "Don't allow"
190
			  no: "Don't allow"
191
            - checkouts of items reserved to someone else. If allowed do not generate RESERVE_WAITING and RESERVED warning. This allows self checkouts for those items.
191
		- checkouts of items reserved to someone else. If allowed do not generate RESERVE_WAITING and RESERVED warning. This allows self checkouts for those items.
192
        -
192
	-
193
            - pref: AllowItemsOnHoldCheckoutSCO
193
		- pref: AllowItemsOnHoldCheckoutSCO
194
              choices:
194
		  choices:
195
                  yes: Allow
195
			  yes: Allow
196
                  no: "Don't allow"
196
			  no: "Don't allow"
197
            - checkouts of items reserved to someone else in the SCO module. If allowed do not generate RESERVE_WAITING and RESERVED warning. This allows self checkouts for those items.
197
		- checkouts of items reserved to someone else in the SCO module. If allowed do not generate RESERVE_WAITING and RESERVED warning. This allows self checkouts for those items.
198
        -
198
	-
199
            - pref: AllFinesNeedOverride
199
		- pref: AllFinesNeedOverride
200
              choices:
200
		  choices:
201
                  yes: Require
201
			  yes: Require
202
                  no: "Don't require"
202
			  no: "Don't require"
203
            - staff to manually override all fines, even fines less than noissuescharge.
203
		- staff to manually override all fines, even fines less than noissuescharge.
204
        -
204
	-
205
            - pref: AllowFineOverride
205
		- pref: AllowFineOverride
206
              choices:
206
		  choices:
207
                  yes: Allow
207
			  yes: Allow
208
                  no: "Don't allow"
208
			  no: "Don't allow"
209
            - staff to manually override and check out items to patrons who have more than noissuescharge in fines.
209
		- staff to manually override and check out items to patrons who have more than noissuescharge in fines.
210
        -
210
	-
211
            - pref: InProcessingToShelvingCart
211
		- pref: InProcessingToShelvingCart
212
              choices:
212
		  choices:
213
                  yes: Move
213
			  yes: Move
214
                  no: "Don't move"
214
			  no: "Don't move"
215
            - items that have the location PROC to the location CART when they are checked in.
215
		- items that have the location PROC to the location CART when they are checked in.
216
        -
216
	-
217
            - pref: ReturnToShelvingCart
217
		- pref: ReturnToShelvingCart
218
              choices:
218
		  choices:
219
                  yes: Move
219
			  yes: Move
220
                  no: "Don't move"
220
			  no: "Don't move"
221
            - all items to the location CART when they are checked in.
221
		- all items to the location CART when they are checked in.
222
        -
222
	-
223
            - pref: AutomaticItemReturn
223
		- pref: AutomaticItemReturn
224
              choices:
224
		  choices:
225
                  yes: Do
225
			  yes: Do
226
                  no: "Don't"
226
			  no: "Don't"
227
            - automatically transfer items to their home library when they are returned.
227
		- automatically transfer items to their home library when they are returned.
228
        -
228
	-
229
            - pref: UseBranchTransferLimits
229
		- pref: UseBranchTransferLimits
230
              choices:
230
		  choices:
231
                  yes: Enforce
231
			  yes: Enforce
232
                  no: "Don't enforce"
232
			  no: "Don't enforce"
233
            - library transfer limits based on
233
		- library transfer limits based on
234
            - pref: BranchTransferLimitsType
234
		- pref: BranchTransferLimitsType
235
              choices:
235
		  choices:
236
                  ccode: collection code
236
			  ccode: collection code
237
                  itemtype: item type
237
			  itemtype: item type
238
            - .
238
		- .
239
        -
239
	-
240
            - pref: UseTransportCostMatrix
240
		- pref: UseTransportCostMatrix
241
              choices:
241
		  choices:
242
                  yes: Use
242
			  yes: Use
243
                  no: "Don't use"
243
			  no: "Don't use"
244
            - Transport Cost Matrix for calculating optimal holds filling between branches.
244
		- Transport Cost Matrix for calculating optimal holds filling between branches.
245
        -
245
	-
246
            - Use the checkout and fines rules of
246
		- Use the checkout and fines rules of
247
            - pref: CircControl
247
		- pref: CircControl
248
              type: choice
248
		  type: choice
249
              choices:
249
		  choices:
250
                  PickupLibrary: the library you are logged in at.
250
			  PickupLibrary: the library you are logged in at.
251
                  PatronLibrary: the library the patron is from.
251
			  PatronLibrary: the library the patron is from.
252
                  ItemHomeLibrary: the library the item is from.
252
			  ItemHomeLibrary: the library the item is from.
253
        -
253
	-
254
            - Use the checkout and fines rules of
254
		- Use the checkout and fines rules of
255
            - pref: HomeOrHoldingBranch
255
		- pref: HomeOrHoldingBranch
256
              type: choice
256
		  type: choice
257
              choices:
257
		  choices:
258
                  homebranch: the library the item is from.
258
			  homebranch: the library the item is from.
259
                  holdingbranch: the library the item was checked out from.
259
			  holdingbranch: the library the item was checked out from.
260
        -
260
	-
261
            - Allow materials to be returned to
261
		- Allow materials to be returned to
262
            - pref: AllowReturnToBranch
262
		- pref: AllowReturnToBranch
263
              type: choice
263
		  type: choice
264
              choices:
264
		  choices:
265
                  anywhere: to any library.
265
			  anywhere: to any library.
266
                  homebranch: only the library the item is from.
266
			  homebranch: only the library the item is from.
267
                  holdingbranch: only the library the item was checked out from.
267
			  holdingbranch: only the library the item was checked out from.
268
                  homeorholdingbranch: either the library the item is from or the library it was checked out from.
268
			  homeorholdingbranch: either the library the item is from or the library it was checked out from.
269
        -
269
	-
270
            - For search results in the staff client, display the branch of
270
		- For search results in the staff client, display the branch of
271
            - pref: StaffSearchResultsDisplayBranch
271
		- pref: StaffSearchResultsDisplayBranch
272
              type: choice
272
		  type: choice
273
              choices:
273
		  choices:
274
                  homebranch: the library the item is from.
274
			  homebranch: the library the item is from.
275
                  holdingbranch: the library the item is held by.
275
			  holdingbranch: the library the item is held by.
276
        -
276
	-
277
            - Calculate the due date using 
277
		- Calculate the due date using 
278
            - pref: useDaysMode
278
		- pref: useDaysMode
279
              choices:
279
		  choices:
280
                  Days: circulation rules only.
280
			  Days: circulation rules only.
281
                  Calendar: the calendar to skip all days the library is closed.
281
			  Calendar: the calendar to skip all days the library is closed.
282
                  Datedue: the calendar to push the due date to the next open day
282
			  Datedue: the calendar to push the due date to the next open day
283
        -
283
	-
284
            - Calculate "No renewal before" based on
284
		- Calculate "No renewal before" based on
285
            - pref: NoRenewalBeforePrecision
285
		- pref: NoRenewalBeforePrecision
286
              choices:
286
		  choices:
287
                  date: date.
287
			  date: date.
288
                  exact_time: exact time.
288
			  exact_time: exact time.
289
            - Only relevant for loans calculated in days, hourly loans are not affected.
289
		- Only relevant for loans calculated in days, hourly loans are not affected.
290
        -
290
	-
291
            - When renewing checkouts, base the new due date on
291
		- When renewing checkouts, base the new due date on
292
            - pref: RenewalPeriodBase
292
		- pref: RenewalPeriodBase
293
              choices:
293
		  choices:
294
                  date_due: the old due date of the checkout.
294
			  date_due: the old due date of the checkout.
295
                  now: the current date.
295
			  now: the current date.
296
        -
296
	-
297
            - pref: RenewalSendNotice
297
		- pref: RenewalSendNotice
298
              choices:
298
		  choices:
299
                  yes: Send
299
			  yes: Send
300
                  no: "Don't send"
300
			  no: "Don't send"
301
            - a renewal notice according to patron checkout alert preferences.
301
		- a renewal notice according to patron checkout alert preferences.
302
        -
302
	-
303
            - Prevent patrons from making holds on the OPAC if they owe more than
303
		- Prevent patrons from making holds on the OPAC if they owe more than
304
            - pref: maxoutstanding
304
		- pref: maxoutstanding
305
              class: currency
305
		  class: currency
306
            - '[% local_currency %] in fines.'
306
		- '[% local_currency %] in fines.'
307
        -
307
	-
308
            - Show a warning on the "Transfers to Receive" screen if the transfer has not been received
308
		- Show a warning on the "Transfers to Receive" screen if the transfer has not been received
309
            - pref: TransfersMaxDaysWarning
309
		- pref: TransfersMaxDaysWarning
310
              class: integer
310
		  class: integer
311
            - days after it was sent.
311
		- days after it was sent.
312
        -
312
	-
313
            - pref: IssuingInProcess
313
		- pref: IssuingInProcess
314
              choices:
314
		  choices:
315
                  yes: "Don't prevent"
315
			  yes: "Don't prevent"
316
                  no: "Prevent"
316
			  no: "Prevent"
317
            - patrons from checking out an item whose rental charge would take them over the limit.
317
		- patrons from checking out an item whose rental charge would take them over the limit.
318
        -
318
	-
319
            - "Restrict patrons with the following target audience values from checking out inappropriate materials:"
319
		- "Restrict patrons with the following target audience values from checking out inappropriate materials:"
320
            - pref: AgeRestrictionMarker
320
		- pref: AgeRestrictionMarker
321
            - "E.g. enter target audience keyword(s) split by | (bar) FSK|PEGI|Age| (No white space near |). Be sure to map agerestriction in Koha to MARC mapping (e.g. 521$a). A MARC field value of FSK 12 or PEGI 12 would mean: Borrower must be 12 years old. Leave empty to not apply an age restriction."
321
		- "E.g. enter target audience keyword(s) split by | (bar) FSK|PEGI|Age| (No white space near |). Be sure to map agerestriction in Koha to MARC mapping (e.g. 521$a). A MARC field value of FSK 12 or PEGI 12 would mean: Borrower must be 12 years old. Leave empty to not apply an age restriction."
322
        -
322
	-
323
            - pref: AgeRestrictionOverride
323
		- pref: AgeRestrictionOverride
324
              choices:
324
		  choices:
325
                  yes: Allow
325
			  yes: Allow
326
                  no: "Don't allow"
326
			  no: "Don't allow"
327
            - staff to check out an item with age restriction.
327
		- staff to check out an item with age restriction.
328
        -
328
	-
329
            - Prevent patrons from checking out books if they have more than
329
		- Prevent patrons from checking out books if they have more than
330
            - pref: noissuescharge
330
		- pref: noissuescharge
331
              class: integer
331
		  class: integer
332
            - '[% local_currency %] in fines.'
332
		- '[% local_currency %] in fines.'
333
        -
333
	-
334
            - Prevent a patron from checking out if the patron has guarantees owing in total more than
334
		- Prevent a patron from checking out if the patron has guarantees owing in total more than
335
            - pref: NoIssuesChargeGuarantees
335
		- pref: NoIssuesChargeGuarantees
336
              class: integer
336
		  class: integer
337
            - '[% local_currency %] in fines.'
337
		- '[% local_currency %] in fines.'
338
        -
338
	-
339
            - pref: RentalsInNoissuesCharge
339
		- pref: RentalsInNoissuesCharge
340
              choices:
340
		  choices:
341
                  yes: Include
341
			  yes: Include
342
                  no: "Don't include"
342
			  no: "Don't include"
343
            - rental charges when summing up charges for noissuescharge.
343
		- rental charges when summing up charges for noissuescharge.
344
        -
344
	-
345
            - pref: ManInvInNoissuesCharge
345
		- pref: ManInvInNoissuesCharge
346
              choices:
346
		  choices:
347
                  yes: Include
347
			  yes: Include
348
                  no: "Don't include"
348
			  no: "Don't include"
349
            - MANUAL_INV charges when summing up charges for noissuescharge.
349
		- MANUAL_INV charges when summing up charges for noissuescharge.
350
        -
350
	-
351
            - pref: HoldsInNoissuesCharge
351
		- pref: HoldsInNoissuesCharge
352
              choices:
352
		  choices:
353
                  yes: Include
353
			  yes: Include
354
                  no: "Don't include"
354
			  no: "Don't include"
355
            - hold charges when summing up charges for noissuescharge.
355
		- hold charges when summing up charges for noissuescharge.
356
        -
356
	-
357
            - pref: ReturnBeforeExpiry
357
		- pref: ReturnBeforeExpiry
358
              choices:
358
		  choices:
359
                  yes: Require
359
			  yes: Require
360
                  no: "Don't require"
360
			  no: "Don't require"
361
            - "patrons to return books before their accounts expire (by restricting due dates to before the patron's expiration date)."
361
		- "patrons to return books before their accounts expire (by restricting due dates to before the patron's expiration date)."
362
        -
362
	-
363
            - Send all notices as a BCC to this email address
363
		- Send all notices as a BCC to this email address
364
            - pref: NoticeBcc
364
		- pref: NoticeBcc
365
        -
365
	-
366
            - pref: OverdueNoticeCalendar
366
		- pref: OverdueNoticeCalendar
367
              choices:
367
		  choices:
368
                  yes: "Use Calendar"
368
			  yes: "Use Calendar"
369
                  no: "Ignore Calendar"
369
			  no: "Ignore Calendar"
370
            - when working out the period for overdue notices
370
		- when working out the period for overdue notices
371
        -
371
	-
372
            - Include up to
372
		- Include up to
373
            - pref: PrintNoticesMaxLines
373
		- pref: PrintNoticesMaxLines
374
              class: integer
374
		  class: integer
375
            - "item lines in a printed overdue notice. If the number of items is greater than this number, the notice will end with a warning asking the borrower to check their online account for a full list of overdue items.  Set to 0 to include all overdue items in the notice, no matter how many there are."
375
		- "item lines in a printed overdue notice. If the number of items is greater than this number, the notice will end with a warning asking the borrower to check their online account for a full list of overdue items.  Set to 0 to include all overdue items in the notice, no matter how many there are."
376
        -
376
	-
377
            - pref: OverduesBlockCirc
377
		- pref: OverduesBlockCirc
378
              choices:
378
		  choices:
379
                  block: Block
379
			  block: Block
380
                  noblock: "Don't block"
380
			  noblock: "Don't block"
381
                  confirmation: Ask for confirmation
381
			  confirmation: Ask for confirmation
382
            - when checking out to a borrower that has overdues outstanding
382
		- when checking out to a borrower that has overdues outstanding
383
        -
383
	-
384
            - "When checking out an item with rental fees, "
384
		- "When checking out an item with rental fees, "
385
            - pref: RentalFeesCheckoutConfirmation
385
		- pref: RentalFeesCheckoutConfirmation
386
              choices:
386
		  choices:
387
                  yes: ask
387
			  yes: ask
388
                  no: "do not ask"
388
			  no: "do not ask"
389
            - "for confirmation."
389
		- "for confirmation."
390
        -
390
	-
391
            - By default, set the LOST value of an item to
391
		- By default, set the LOST value of an item to
392
            - pref: DefaultLongOverdueLostValue
392
		- pref: DefaultLongOverdueLostValue
393
              class: integer
393
		  class: integer
394
            - when the item has been overdue for more than
394
		- when the item has been overdue for more than
395
            - pref: DefaultLongOverdueDays
395
		- pref: DefaultLongOverdueDays
396
              class: integer
396
		  class: integer
397
            - days.
397
		- days.
398
            - <br>WARNING — These preferences will activate the automatic item loss process. Leave these fields empty if you don't want to activate this feature.
398
		- <br>WARNING — These preferences will activate the automatic item loss process. Leave these fields empty if you don't want to activate this feature.
399
            - "<br>Example: [1] [30] Sets an item to the LOST value 1 when it has been overdue for more than 30 days."
399
		- "<br>Example: [1] [30] Sets an item to the LOST value 1 when it has been overdue for more than 30 days."
400
            - <br>(Used when the longoverdue.pl script is called without the --lost parameter)
400
		- <br>(Used when the longoverdue.pl script is called without the --lost parameter)
401
        -
401
	-
402
            - "Charge a lost item to the borrower's account when the LOST value of the item changes to :"
402
		- "Charge a lost item to the borrower's account when the LOST value of the item changes to :"
403
            - pref: DefaultLongOverdueChargeValue
403
		- pref: DefaultLongOverdueChargeValue
404
              class: integer
404
		  class: integer
405
            - <br>Leave this field empty if you don't want to charge the user for lost items.
405
		- <br>Leave this field empty if you don't want to charge the user for lost items.
406
            - <br>(Used when the longoverdue.pl script is called without the --charge parameter)
406
		- <br>(Used when the longoverdue.pl script is called without the --charge parameter)
407
        -
407
	-
408
            - "When issuing an item that has been marked as lost, "
408
		- "When issuing an item that has been marked as lost, "
409
            - pref: IssueLostItem
409
		- pref: IssueLostItem
410
              choices:
410
		  choices:
411
                  confirm: "require confirmation"
411
			  confirm: "require confirmation"
412
                  alert: "display a message"
412
			  alert: "display a message"
413
                  nothing : "do nothing"
413
			  nothing : "do nothing"
414
            - .
414
		- .
415
        -
415
	-
416
            - pref: MarkLostItemsAsReturned
416
		- pref: MarkLostItemsAsReturned
417
              choices:
417
		  choices:
418
                  yes: "Mark"
418
			  yes: "Mark"
419
                  no: "Do not mark"
419
			  no: "Do not mark"
420
            - "items as returned when flagged as lost"
420
		- "items as returned when flagged as lost"
421
        -
421
	-
422
            - pref: AllowMultipleIssuesOnABiblio
422
		- pref: AllowMultipleIssuesOnABiblio
423
              choices:
423
		  choices:
424
                  yes: Allow
424
			  yes: Allow
425
                  no: "Don't allow"
425
			  no: "Don't allow"
426
            - "patrons to check out multiple items from the same record.  (NOTE: This will only affect records without a subscription attached.)"
426
		- "patrons to check out multiple items from the same record.  (NOTE: This will only affect records without a subscription attached.)"
427
        -
427
	-
428
            - pref: OnSiteCheckouts
428
		- pref: OnSiteCheckouts
429
              choices:
429
		  choices:
430
                  yes: Enable
430
			  yes: Enable
431
                  no: Disable
431
			  no: Disable
432
            - the on-site checkouts feature.
432
		- the on-site checkouts feature.
433
        -
433
	-
434
            - pref: OnSiteCheckoutsForce
434
		- pref: OnSiteCheckoutsForce
435
              choices:
435
		  choices:
436
                  yes: Enable
436
			  yes: Enable
437
                  no: Disable
437
			  no: Disable
438
            - the on-site for all cases (Even if a user is debarred, etc.).
438
		- the on-site for all cases (Even if a user is debarred, etc.).
439
        -
439
	-
440
            - pref: ConsiderOnSiteCheckoutsAsNormalCheckouts
440
		- pref: ConsiderOnSiteCheckoutsAsNormalCheckouts
441
              choices:
441
		  choices:
442
                  yes: Consider
442
			  yes: Consider
443
                  no: "Don't consider"
443
			  no: "Don't consider"
444
            - on-site checkouts as normal checkouts.
444
		- on-site checkouts as normal checkouts.
445
            - If enabled, the number of checkouts allowed will be normal checkouts + on-site checkouts.
445
		- If enabled, the number of checkouts allowed will be normal checkouts + on-site checkouts.
446
            - If disabled, both values will be checked separately.
446
		- If disabled, both values will be checked separately.
447
        -
447
	-
448
            - pref: SwitchOnSiteCheckouts
448
		- pref: SwitchOnSiteCheckouts
449
              choices:
449
		  choices:
450
                  yes: Switch
450
			  yes: Switch
451
                  no: "Don't switch"
451
			  no: "Don't switch"
452
            - on-site checkouts to normal checkouts when checked out.
452
		- on-site checkouts to normal checkouts when checked out.
453
        -
453
	-
454
            - When a patron's checked out item is overdue,
454
		- When a patron's checked out item is overdue,
455
            - pref: OverduesBlockRenewing
455
		- pref: OverduesBlockRenewing
456
              type: choice
456
		  type: choice
457
              choices:
457
		  choices:
458
                  allow: allow renewing.
458
			  allow: allow renewing.
459
                  blockitem: block renewing only for this item.
459
			  blockitem: block renewing only for this item.
460
                  block: block renewing for all the patron's items.
460
			  block: block renewing for all the patron's items.
461
        -
461
	-
462
            - If patron is restricted,
462
		- If patron is restricted,
463
            - pref: RestrictionBlockRenewing
463
		- pref: RestrictionBlockRenewing
464
              choices:
464
		  choices:
465
                  yes: Block
465
			  yes: Block
466
                  no: Allow
466
			  no: Allow
467
            - renewing of items.
467
		- renewing of items.
468
        -
468
	-
469
            - If a patron owes more than the value of OPACFineNoRenewals,
469
		- If a patron owes more than the value of OPACFineNoRenewals,
470
            - pref: OPACFineNoRenewalsBlockAutoRenew
470
		- pref: OPACFineNoRenewalsBlockAutoRenew
471
              choices:
471
		  choices:
472
                  yes: Block
472
			  yes: Block
473
                  no: Allow
473
			  no: Allow
474
            - his/her auto renewals.
474
		- his/her auto renewals.
475
    Checkin Policy:
475
	-
476
        -
476
		- pref: PreventCheckoutOnSameReservePeriod
477
            - pref: BlockReturnOfWithdrawnItems
477
		  choices:
478
              choices:
478
			  yes: Do
479
                  yes: Block
479
			  no: "Don't"
480
                  no: "Don't block"
480
		- If yes, checkouts periods can't overlap with a reserve period.
481
            - returning of items that have been withdrawn.
481
Checkin Policy:
482
        -
482
	-
483
            - pref: BlockReturnOfLostItems
483
		- pref: BlockReturnOfWithdrawnItems
484
              choices:
484
		  choices:
485
                  yes: Block
485
			  yes: Block
486
                  no: "Don't block"
486
			  no: "Don't block"
487
            - returning of items that have been lost.
487
		- returning of items that have been withdrawn.
488
        -
488
	-
489
            - pref: CalculateFinesOnReturn
489
		- pref: BlockReturnOfLostItems
490
              choices:
490
		  choices:
491
                  yes: Do
491
			  yes: Block
492
                  no: "Don't"
492
			  no: "Don't block"
493
            - calculate and update overdue charges when an item is returned.
493
		- returning of items that have been lost.
494
            - <br /><b>NOTE If you are doing hourly loans then you should have this on.</b>
494
	-
495
        -
495
		- pref: CalculateFinesOnReturn
496
            - pref: UpdateNotForLoanStatusOnCheckin
496
		  choices:
497
              type: textarea
497
			  yes: Do
498
              class: code
498
			  no: "Don't"
499
            - This is a list of value pairs. When an item is checked in, if the not for loan value on the left matches the items not for loan value
499
		- calculate and update overdue charges when an item is returned.
500
            - "it will be updated to the right-hand value. E.g. '-1: 0' will cause an item that was set to 'Ordered' to now be available for loan."
500
		- <br /><b>NOTE If you are doing hourly loans then you should have this on.</b>
501
            - Each pair of values should be on a separate line.
501
	-
502
        -
502
		- pref: UpdateNotForLoanStatusOnCheckin
503
            - pref: CumulativeRestrictionPeriods
503
		  type: textarea
504
              choices:
504
		  class: code
505
                  yes: Cumulate
505
		- This is a list of value pairs. When an item is checked in, if the not for loan value on the left matches the items not for loan value
506
                  no: "Don't cumulate"
506
		- "it will be updated to the right-hand value. E.g. '-1: 0' will cause an item that was set to 'Ordered' to now be available for loan."
507
            - the restriction periods.
507
		- Each pair of values should be on a separate line.
508
    Holds Policy:
508
	-
509
        -
509
		- pref: CumulativeRestrictionPeriods
510
            - pref: AllowHoldItemTypeSelection
510
		  choices:
511
              choices:
511
			  yes: Cumulate
512
                  yes: Allow
512
			  no: "Don't cumulate"
513
                  no: "Don't allow"
513
		- the restriction periods.
514
            - hold fulfillment to be limited by itemtype.
514
Holds Policy:
515
        -
515
	-
516
            - pref: AllowRenewalIfOtherItemsAvailable
516
		- pref: AllowHoldItemTypeSelection
517
              choices:
517
		  choices:
518
                  yes: Allow
518
			  yes: Allow
519
                  no: "Don't allow"
519
			  no: "Don't allow"
520
            - a patron to renew an item with unfilled holds if other available items can fill that hold.
520
		- hold fulfillment to be limited by itemtype.
521
        -
521
	-
522
            - pref: AllowHoldPolicyOverride
522
		- pref: AllowRenewalIfOtherItemsAvailable
523
              choices:
523
		  choices:
524
                  yes: Allow
524
			  yes: Allow
525
                  no: "Don't allow"
525
			  no: "Don't allow"
526
            - staff to override hold policies when placing holds.
526
		- a patron to renew an item with unfilled holds if other available items can fill that hold.
527
        -
527
	-
528
            - pref: AllowHoldsOnDamagedItems
528
		- pref: AllowHoldPolicyOverride
529
              choices:
529
		  choices:
530
                  yes: Allow
530
			  yes: Allow
531
                  no: "Don't allow"
531
			  no: "Don't allow"
532
            - hold requests to be placed on and filled by damaged items.
532
		- staff to override hold policies when placing holds.
533
        -
533
	-
534
            - pref: AllowHoldDateInFuture
534
		- pref: AllowHoldsOnDamagedItems
535
              choices:
535
		  choices:
536
                  yes: Allow
536
			  yes: Allow
537
                  no: "Don't allow"
537
			  no: "Don't allow"
538
            - hold requests to be placed that do not enter the waiting list until a certain future date.
538
		- hold requests to be placed on and filled by damaged items.
539
        -
539
	-
540
            - pref: OPACAllowHoldDateInFuture
540
		- pref: AllowHoldDateInFuture
541
              choices:
541
		  choices:
542
                  yes: Allow
542
			  yes: Allow
543
                  no: "Don't allow"
543
			  no: "Don't allow"
544
            - "patrons to place holds that don't enter the waiting list until a certain future date. (AllowHoldDateInFuture must also be enabled)."
544
		- hold requests to be placed that do not enter the waiting list until a certain future date.
545
        -
545
	-
546
            - Confirm future hold requests (starting no later than
546
		- pref: OPACAllowHoldDateInFuture
547
            - pref: ConfirmFutureHolds
547
		  choices:
548
              class: integer
548
			  yes: Allow
549
            - days from now) at checkin time. Note that this number of days will be used too in calculating the default end date for the Holds to pull-report. But it does not interfere with issuing, renewing or transferring books.
549
			  no: "Don't allow"
550
        -
550
		- "patrons to place holds that don't enter the waiting list until a certain future date. (AllowHoldDateInFuture must also be enabled)."
551
            - Check the
551
	-
552
            - pref: ReservesControlBranch
552
		- Confirm future hold requests (starting no later than
553
              choices:
553
		- pref: ConfirmFutureHolds
554
                  ItemHomeLibrary: "item's home library"
554
		  class: integer
555
                  PatronLibrary: "patron's home library"
555
		- days from now) at checkin time. Note that this number of days will be used too in calculating the default end date for the Holds to pull-report. But it does not interfere with issuing, renewing or transferring books.
556
            - to see if the patron can place a hold on the item.    
556
	-
557
        -
557
		- Check the
558
            - Mark a hold as problematic if it has been waiting for more than
558
		- pref: ReservesControlBranch
559
            - pref: ReservesMaxPickUpDelay
559
		  choices:
560
              class: integer
560
			  ItemHomeLibrary: "item's home library"
561
            - days.
561
			  PatronLibrary: "patron's home library"
562
        -
562
		- to see if the patron can place a hold on the item.    
563
            - pref: ExpireReservesMaxPickUpDelay
563
	-
564
              choices:
564
		- Mark a hold as problematic if it has been waiting for more than
565
                  yes: Allow
565
		- pref: ReservesMaxPickUpDelay
566
                  no: "Don't allow"
566
		  class: integer
567
            - "holds to expire automatically if they have not been picked by within the time period specified in ReservesMaxPickUpDelay"
567
		- days.
568
        -
568
	-
569
            - If using ExpireReservesMaxPickUpDelay, charge a borrower who allows his or her waiting hold to expire a fee of
569
		- pref: ExpireReservesMaxPickUpDelay
570
            - pref: ExpireReservesMaxPickUpDelayCharge
570
		  choices:
571
              class: currency
571
			  yes: Allow
572
        -
572
			  no: "Don't allow"
573
            - Satisfy holds using items from the libraries
573
		- "holds to expire automatically if they have not been picked by within the time period specified in ReservesMaxPickUpDelay"
574
            - pref: StaticHoldsQueueWeight
574
	-
575
              class: multi
575
		- If using ExpireReservesMaxPickUpDelay, charge a borrower who allows his or her waiting hold to expire a fee of
576
            - (as branchcodes, separated by commas; if empty, uses all libraries)
576
		- pref: ExpireReservesMaxPickUpDelayCharge
577
            - when they are
577
		  class: currency
578
            - pref: HoldsQueueSkipClosed
578
	-
579
              choices:
579
		- Satisfy holds using items from the libraries
580
                  yes: open
580
		- pref: StaticHoldsQueueWeight
581
                  no: open or closed
581
		  class: multi
582
            - pref: RandomizeHoldsQueueWeight
582
		- (as branchcodes, separated by commas; if empty, uses all libraries)
583
              choices:
583
		- when they are
584
                  yes: in random order.
584
		- pref: HoldsQueueSkipClosed
585
                  no: in that order.
585
		  choices:
586
            -
586
			  yes: open
587
        -
587
			  no: open or closed
588
            - pref: canreservefromotherbranches
588
		- pref: RandomizeHoldsQueueWeight
589
              choices:
589
		  choices:
590
                  yes: Allow
590
			  yes: in random order.
591
                  no: "Don't allow (with independent branches)"
591
			  no: in that order.
592
            - a user from one library to place a hold on an item from another library
592
		-
593
        -
593
	-
594
            - pref: OPACAllowUserToChooseBranch
594
		- pref: canreservefromotherbranches
595
              choices:
595
		  choices:
596
                  yes: Allow
596
			  yes: Allow
597
                  no: "Don't allow"
597
			  no: "Don't allow (with independent branches)"
598
            - a user to choose the library to pick up a hold from.
598
		- a user from one library to place a hold on an item from another library
599
        -
599
	-
600
            - pref: ReservesNeedReturns
600
		- pref: OPACAllowUserToChooseBranch
601
              choices:
601
		  choices:
602
                  yes: "Don't automatically"
602
			  yes: Allow
603
                  no: Automatically
603
			  no: "Don't allow"
604
            - mark a hold as found and waiting when a hold is placed on a specific item and that item is already checked in.
604
		- a user to choose the library to pick up a hold from.
605
        -
605
	-
606
            - Patrons can only have
606
		- pref: ReservesNeedReturns
607
            - pref: maxreserves
607
		  choices:
608
              class: integer
608
			  yes: "Don't automatically"
609
            - holds at once.
609
			  no: Automatically
610
        -
610
		- mark a hold as found and waiting when a hold is placed on a specific item and that item is already checked in.
611
            - pref: emailLibrarianWhenHoldIsPlaced
611
	-
612
              choices:
612
		- Patrons can only have
613
                  yes: Enable
613
		- pref: maxreserves
614
                  no:  "Don't enable"
614
		  class: integer
615
            - "sending an email to the Koha administrator email address whenever a hold request is placed."
615
		- holds at once.
616
        -
616
	-
617
            - pref: DisplayMultiPlaceHold
617
		- pref: emailLibrarianWhenHoldIsPlaced
618
              choices:
618
		  choices:
619
                  yes: Enable
619
			  yes: Enable
620
                  no:  "Don't enable"
620
			  no:  "Don't enable"
621
            - "the ability to place holds on multiple biblio from the search results"	    
621
		- "sending an email to the Koha administrator email address whenever a hold request is placed."
622
        -
622
	-
623
            - pref: TransferWhenCancelAllWaitingHolds
623
		- pref: DisplayMultiPlaceHold
624
              choices:
624
		  choices:
625
                  yes: Transfer
625
			  yes: Enable
626
                  no: "Don't transfer"
626
			  no:  "Don't enable"
627
            - items when cancelling all waiting holds.
627
		- "the ability to place holds on multiple biblio from the search results"	    
628
        -
628
	-
629
            - pref: AutoResumeSuspendedHolds
629
		- pref: TransferWhenCancelAllWaitingHolds
630
              choices:
630
		  choices:
631
                  yes: Allow
631
			  yes: Transfer
632
                  no: "Don't allow"
632
			  no: "Don't transfer"
633
            - suspended holds to be automatically resumed by a set date.
633
		- items when cancelling all waiting holds.
634
        -
634
	-
635
            - pref: SuspendHoldsIntranet
635
		- pref: AutoResumeSuspendedHolds
636
              choices:
636
		  choices:
637
                  yes: Allow
637
			  yes: Allow
638
                  no: "Don't allow"
638
			  no: "Don't allow"
639
            - holds to be suspended from the intranet.
639
		- suspended holds to be automatically resumed by a set date.
640
        -
640
	-
641
            - pref: SuspendHoldsOpac
641
		- pref: SuspendHoldsIntranet
642
              choices:
642
		  choices:
643
                  yes: Allow
643
			  yes: Allow
644
                  no: "Don't allow"
644
			  no: "Don't allow"
645
            - holds to be suspended from the OPAC.
645
		- holds to be suspended from the intranet.
646
        -
646
	-
647
            - pref: ExpireReservesOnHolidays
647
		- pref: SuspendHoldsOpac
648
              choices:
648
		  choices:
649
                  yes: Allow
649
			  yes: Allow
650
                  no: "Don't allow"
650
			  no: "Don't allow"
651
            - expired holds to be canceled on days the library is closed.
651
		- holds to be suspended from the OPAC.
652
        -
652
	-
653
            - pref: ExcludeHolidaysFromMaxPickUpDelay
653
		- pref: ExpireReservesOnHolidays
654
              choices:
654
		  choices:
655
                  yes: Allow
655
			  yes: Allow
656
                  no: "Don't allow"
656
			  no: "Don't allow"
657
            - Closed days to be taken into account in reserves max pickup delay.
657
		- expired holds to be canceled on days the library is closed.
658
        -
658
	-
659
            - pref: decreaseLoanHighHolds
659
		- pref: ExcludeHolidaysFromMaxPickUpDelay
660
              choices:
660
		  choices:
661
                  yes: Enable
661
			  yes: Allow
662
                  no:  "Don't enable"
662
			  no: "Don't allow"
663
            - the reduction of loan period to
663
		- Closed days to be taken into account in reserves max pickup delay.
664
            - pref: decreaseLoanHighHoldsDuration
664
	-
665
              class: integer
665
		- pref: decreaseLoanHighHolds
666
            - days for items with more than
666
		  choices:
667
            - pref: decreaseLoanHighHoldsValue
667
			  yes: Enable
668
              class: integer
668
			  no:  "Don't enable"
669
            - holds
669
		- the reduction of loan period to
670
            - pref: decreaseLoanHighHoldsControl
670
		- pref: decreaseLoanHighHoldsDuration
671
              choices:
671
		  class: integer
672
                  static: "on the record"
672
		- days for items with more than
673
                  dynamic: "over the number of holdable items on the record"
673
		- pref: decreaseLoanHighHoldsValue
674
            - . Ignore items with the following statuses when counting items
674
		  class: integer
675
            - pref: decreaseLoanHighHoldsIgnoreStatuses
675
		- holds
676
              multiple:
676
		- pref: decreaseLoanHighHoldsControl
677
                damaged: Damaged
677
		  choices:
678
                itemlost: Lost
678
			  static: "on the record"
679
                withdrawn: Withdrawn
679
			  dynamic: "over the number of holdable items on the record"
680
                notforloan: Not for loan
680
		- . Ignore items with the following statuses when counting items
681
        -
681
		- pref: decreaseLoanHighHoldsIgnoreStatuses
682
            - pref: AllowHoldsOnPatronsPossessions
682
		  multiple:
683
              choices:
683
			damaged: Damaged
684
                  yes: Allow
684
			itemlost: Lost
685
                  no: "Don't allow"
685
			withdrawn: Withdrawn
686
            - a patron to place a hold on a record where the patron already has one or more items attached to that record checked out.
686
			notforloan: Not for loan
687
        -
687
	-
688
            - pref: LocalHoldsPriority
688
		- pref: AllowHoldsOnPatronsPossessions
689
              choices:
689
		  choices:
690
                  yes: Give
690
			  yes: Allow
691
                  no: "Don't give"
691
			  no: "Don't allow"
692
            - priority for filling holds to patrons whose
692
		- a patron to place a hold on a record where the patron already has one or more items attached to that record checked out.
693
            - pref: LocalHoldsPriorityPatronControl
693
	-
694
              choices:
694
		- pref: LocalHoldsPriority
695
                  PickupLibrary: "pickup library"
695
		  choices:
696
                  HomeLibrary: "home library"
696
			  yes: Give
697
            - matches the item's
697
			  no: "Don't give"
698
            - pref: LocalHoldsPriorityItemControl
698
		- priority for filling holds to patrons whose
699
              choices:
699
		- pref: LocalHoldsPriorityPatronControl
700
                  homebranch: "home library"
700
		  choices:
701
                  holdingbranch: "holding library"
701
			  PickupLibrary: "pickup library"
702
        -
702
			  HomeLibrary: "home library"
703
            - pref: OPACHoldsIfAvailableAtPickup
703
		- matches the item's
704
              choices:
704
		- pref: LocalHoldsPriorityItemControl
705
                  yes: Allow
705
		  choices:
706
                  no: "Don't allow"
706
			  homebranch: "home library"
707
            - to pickup up holds at libraries where the item is available.
707
			  holdingbranch: "holding library"
708
        -
708
	-
709
            - "Patron categories not affected by OPACHoldsIfAvailableAtPickup"
709
		- pref: OPACHoldsIfAvailableAtPickup
710
            - pref: OPACHoldsIfAvailableAtPickupExceptions
710
		  choices:
711
            - "(list of patron categories separated with a pipe '|')"
711
			  yes: Allow
712
			  no: "Don't allow"
713
		- to pickup up holds at libraries where the item is available.
714
	-
715
		- "Patron categories not affected by OPACHoldsIfAvailableAtPickup"
716
		- pref: OPACHoldsIfAvailableAtPickupExceptions
717
		- "(list of patron categories separated with a pipe '|')"
718
    -
719
        - pref: PreventReservesOnSamePeriod
720
          choices:
721
              yes: Do
722
              no: "Don't"
723
        - If yes, Reserves periods for the same document can't overlap.
712
    Interlibrary Loans:
724
    Interlibrary Loans:
713
        -
725
        -
714
            - pref: ILLModule
726
            - pref: ILLModule
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (+2 lines)
Lines 212-217 Link Here
212
[% IF ( RESERVED ) %]
212
[% IF ( RESERVED ) %]
213
    <p>
213
    <p>
214
    <input type="checkbox" id="cancelreserve" name="cancelreserve" value="cancel" />
214
    <input type="checkbox" id="cancelreserve" name="cancelreserve" value="cancel" />
215
    <input type="hidden" name="reserveid" value="[% resreserveid %]" />
215
    <label for="cancelreserve">Cancel hold</label>
216
    <label for="cancelreserve">Cancel hold</label>
216
    </p>
217
    </p>
217
[% END %]
218
[% END %]
Lines 220-225 Link Here
220
<p>
221
<p>
221
    <label for="cancelreserve">Cancel hold</label>
222
    <label for="cancelreserve">Cancel hold</label>
222
    <input type="radio" value="cancel" name="cancelreserve" id="cancelreserve" /><br />
223
    <input type="radio" value="cancel" name="cancelreserve" id="cancelreserve" /><br />
224
    <input type="hidden" name="reserveid" value="[% resreserveid %]" />
223
    <label for="revertreserve">Revert waiting status</label>
225
    <label for="revertreserve">Revert waiting status</label>
224
    <input type="radio" value="revert" name="cancelreserve" id="revertreserve" checked="checked"/>
226
    <input type="radio" value="revert" name="cancelreserve" id="revertreserve" checked="checked"/>
225
</p>
227
</p>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/placerequest.tt (+66 lines)
Line 0 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
2
    <title>Koha &rsaquo; Circulation &rsaquo; Holds &rsaquo; Confirm holds</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
</head>
5
<body id="circ_placerequest" class="catalog">
6
[% INCLUDE 'header.inc' %]
7
[% INCLUDE 'circ-search.inc' %]
8
9
<div id="breadcrumbs">
10
  <a href="/cgi-bin/koha/mainpage.pl">Home</a>
11
  &rsaquo;
12
  <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>
13
  &rsaquo;
14
  Confirm holds
15
</div>
16
17
<div id="doc3" class="yui-t2">
18
19
  <div id="bd">
20
    <div id="yui-main">
21
      <div class="yui-b">
22
23
        <h1>Confirm holds</h1>
24
25
        <div class="alert">
26
          <p>
27
            Some of the reserves you are trying to do overlaps with existing reserves.
28
            Please confirm you want to proceed.
29
          </p>
30
        </div>
31
32
        <form method="post">
33
          <input type="hidden" name="borrowernumber" value="[% borrowernumber %]">
34
          [% IF multi_hold %]
35
            <input type="hidden" name="biblionumbers" value="[% biblionumbers%]">
36
            <input type="hidden" name="multi_hold" value="1">
37
          [% ELSE %]
38
            <input type="hidden" name="biblionumber" value="[% biblionumber%]">
39
          [% END %]
40
          <input type="hidden" name="reserve_date" value="[% reserve_date %]">
41
          <input type="hidden" name="expiration_date" value="[% expiration_date %]">
42
          <input type="hidden" name="pickup" value="[% pickup%]">
43
          <input type="hidden" name="notes" value="[% notes %]">
44
          <input type="hidden" name="confirm" value="1">
45
46
          [% FOREACH biblionumber IN overlap_reserves.keys %]
47
            [% input_id = "confirm_$biblionumber" %]
48
            <div>
49
              <input type="hidden" name="rank_[% biblionumber %]" value="[% overlap_reserves.$biblionumber.rank %]">
50
              [% IF (overlap_reserves.$biblionumber.checkitem) %]
51
                <input type="hidden" name="checkitem" value="[% overlap_reserves.$biblionumber.checkitem%]">
52
              [% END %]
53
              <input type="checkbox" name="confirm_biblionumbers" id="[% input_id %]"
54
                     value="[% biblionumber %]">
55
              <label for="[% input_id %]">Confirm hold for [% overlap_reserves.$biblionumber.title %]</label>
56
            </div>
57
          [% END %]
58
59
          <input type="submit" value="Continue">
60
        </form>
61
62
      </div>
63
    </div>
64
65
  </div>
66
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/opac/opac-reserve.pl (+9 lines)
Lines 285-290 if ( $query->param('place_reserve') ) { Link Here
285
            # Inserts a null into the 'itemnumber' field of 'reserves' table.
285
            # Inserts a null into the 'itemnumber' field of 'reserves' table.
286
            $itemNum = undef;
286
            $itemNum = undef;
287
        }
287
        }
288
289
        if ($canreserve) {
290
            if (C4::Context->preference("PreventReservesOnSamePeriod") &&
291
                ReservesOnSamePeriod($biblioNum, $itemNum, $startdate, $expiration_date)) {
292
                $canreserve = 0;
293
                $failed_holds++;
294
            }
295
        }
296
288
        my $notes = $query->param('notes_'.$biblioNum)||'';
297
        my $notes = $query->param('notes_'.$biblioNum)||'';
289
298
290
        if (   $maxreserves
299
        if (   $maxreserves
(-)a/reserve/placerequest.pl (-60 / +82 lines)
Lines 30-77 use C4::Output; Link Here
30
use C4::Reserves;
30
use C4::Reserves;
31
use C4::Circulation;
31
use C4::Circulation;
32
use C4::Members;
32
use C4::Members;
33
use C4::Auth qw/checkauth/;
33
use C4::Auth;
34
use Koha::Patrons;
34
use Koha::Patrons;
35
35
36
my $input = CGI->new();
36
my $input = CGI->new();
37
37
38
checkauth($input, 0, { reserveforothers => 'place_holds' }, 'intranet');
38
my ( $template, $borrowernumber, $cookie, $flags ) = get_template_and_user(
39
39
    {
40
my @bibitems       = $input->multi_param('biblioitem');
40
        template_name   => "reserve/placerequest.tt",
41
my @reqbib         = $input->multi_param('reqbib');
41
        query           => $input,
42
my $biblionumber   = $input->param('biblionumber');
42
        type            => "intranet",
43
my $borrowernumber = $input->param('borrowernumber');
43
        authnotrequired => 0,
44
my $notes          = $input->param('notes');
44
        flagsrequired   => { reserveforothers => 'place_holds' },
45
my $branch         = $input->param('pickup');
45
    }
46
my $startdate      = $input->param('reserve_date') || '';
46
);
47
my @rank           = $input->multi_param('rank-request');
47
48
my $type           = $input->param('type');
48
my $biblionumber=$input->param('biblionumber');
49
my $title          = $input->param('title');
49
my $borrowernumber=$input->param('borrowernumber');
50
my $checkitem      = $input->param('checkitem');
50
my $notes=$input->param('notes');
51
my $branch=$input->param('pickup');
52
my $startdate=$input->param('reserve_date') || '';
53
my @rank=$input->param('rank-request');
54
my $title=$input->param('title');
55
my $checkitem=$input->param('checkitem');
51
my $expirationdate = $input->param('expiration_date');
56
my $expirationdate = $input->param('expiration_date');
52
my $itemtype       = $input->param('itemtype') || undef;
57
my $itemtype       = $input->param('itemtype') || undef;
53
58
my $confirm = $input->param('confirm');
54
my $borrower = Koha::Patrons->find( $borrowernumber );
59
my @confirm_biblionumbers = $input->param('confirm_biblionumbers');
55
$borrower = $borrower->unblessed if $borrower;
56
60
57
my $multi_hold = $input->param('multi_hold');
61
my $multi_hold = $input->param('multi_hold');
58
my $biblionumbers = $multi_hold ? $input->param('biblionumbers') : ($biblionumber . '/');
62
my $biblionumbers = $multi_hold ? $input->param('biblionumbers') : ($biblionumber . '/');
59
my $bad_bibs = $input->param('bad_bibs');
63
my $bad_bibs = $input->param('bad_bibs');
60
my $holds_to_place_count = $input->param('holds_to_place_count') || 1;
64
my $holds_to_place_count = $input->param('holds_to_place_count') || 1;
61
65
66
my $borrower = Koha::Patrons->find( $borrowernumber );
67
$borrower = $borrower->unblessed if $borrower;
68
unless ($borrower) {
69
    print $input->header();
70
    print "Invalid borrower number please try again";
71
    exit;
72
}
73
62
my %bibinfos = ();
74
my %bibinfos = ();
63
my @biblionumbers = split '/', $biblionumbers;
75
my @biblionumbers = split '/', $biblionumbers;
64
foreach my $bibnum (@biblionumbers) {
76
foreach my $bibnum (@biblionumbers) {
65
    my %bibinfo = ();
77
    my %bibinfo;
66
    $bibinfo{title} = $input->param("title_$bibnum");
78
    $bibinfo{title} = $input->param("title_$bibnum");
79
67
    $bibinfo{rank} = $input->param("rank_$bibnum");
80
    $bibinfo{rank} = $input->param("rank_$bibnum");
68
    $bibinfos{$bibnum} = \%bibinfo;
81
    $bibinfos{$bibnum} = \%bibinfo;
69
}
82
}
70
83
71
my $found;
84
my $found;
72
85
73
# if we have an item selectionned, and the pickup branch is the same as the holdingbranch
86
# if we have an item selectionned, and the pickup branch is the same as the
74
# of the document, we force the value $rank and $found .
87
# holdingbranch of the document, we force the value $rank and $found .
75
if (defined $checkitem && $checkitem ne ''){
88
if (defined $checkitem && $checkitem ne ''){
76
    $holds_to_place_count = 1;
89
    $holds_to_place_count = 1;
77
    $rank[0] = '0' unless C4::Context->preference('ReservesNeedReturns');
90
    $rank[0] = '0' unless C4::Context->preference('ReservesNeedReturns');
Lines 82-124 if (defined $checkitem && $checkitem ne ''){ Link Here
82
    }
95
    }
83
}
96
}
84
97
85
if ( $type eq 'str8' && $borrower ) {
98
my $overlap_reserves = {};
86
99
foreach my $biblionumber (keys %bibinfos) {
87
    foreach my $biblionumber ( keys %bibinfos ) {
100
    next if ($confirm && !grep { $_ eq $biblionumber } @confirm_biblionumbers);
88
        my $count = @bibitems;
89
        @bibitems = sort @bibitems;
90
        my $i2 = 1;
91
        my @realbi;
92
        $realbi[0] = $bibitems[0];
93
        for ( my $i = 1 ; $i < $count ; $i++ ) {
94
            my $i3 = $i2 - 1;
95
            if ( $realbi[$i3] ne $bibitems[$i] ) {
96
                $realbi[$i2] = $bibitems[$i];
97
                $i2++;
98
            }
99
        }
100
101
101
        if ( defined $checkitem && $checkitem ne '' ) {
102
    my ($reserve_title, $reserve_rank);
102
            my $item = GetItem($checkitem);
103
    if ($multi_hold) {
103
            if ( $item->{'biblionumber'} ne $biblionumber ) {
104
        my $bibinfo = $bibinfos{$biblionumber};
104
                $biblionumber = $item->{'biblionumber'};
105
        $reserve_rank = $bibinfo->{rank};
105
            }
106
        $reserve_title = $bibinfo->{title};
106
        }
107
    } else {
108
        $reserve_rank = $rank[0];
109
        $reserve_title = $title;
110
    }
107
111
108
        if ($multi_hold) {
112
    if (defined $checkitem && $checkitem ne '') {
109
            my $bibinfo = $bibinfos{$biblionumber};
113
        my $item = GetItem($checkitem);
110
            AddReserve($branch,$borrower->{'borrowernumber'},$biblionumber,[$biblionumber],
114
        if ($item->{'biblionumber'} ne $biblionumber) {
111
                       $bibinfo->{rank},$startdate,$expirationdate,$notes,$bibinfo->{title},$checkitem,$found);
115
            $biblionumber = $item->{'biblionumber'};
112
        } else {
113
            # place a request on 1st available
114
            for ( my $i = 0 ; $i < $holds_to_place_count ; $i++ ) {
115
                AddReserve( $branch, $borrower->{'borrowernumber'},
116
                    $biblionumber, \@realbi, $rank[0], $startdate, $expirationdate, $notes, $title,
117
                    $checkitem, $found, $itemtype );
118
            }
119
        }
116
        }
120
    }
117
    }
121
118
119
    if (!$confirm &&
120
        ReservesOnSamePeriod($biblionumber, $checkitem, $startdate, $expirationdate) &&
121
        C4::Context->preference("PreventReservesOnSamePeriod")) {
122
        $overlap_reserves->{$biblionumber} = {
123
            title => $reserve_title ,
124
            checkitem => $checkitem,
125
            rank => $reserve_rank
126
        };
127
        next;
128
    }
129
130
    AddReserve($branch, $borrower->{'borrowernumber'}, $biblionumber, undef,
131
        $reserve_rank, $startdate, $expirationdate, $notes, $reserve_title,
132
        $checkitem, $found);
133
}
134
135
if (scalar keys %$overlap_reserves) {
136
    $template->param(
137
        borrowernumber => $borrowernumber,
138
        biblionumbers => $biblionumbers,
139
        biblionumber => $biblionumber,
140
        overlap_reserves => $overlap_reserves,
141
        reserve_date => $startdate,
142
        expiration_date => $expirationdate,
143
        notes => $notes,
144
        rank_request => \@rank,
145
        pickup => $branch,
146
        multi_hold => $multi_hold,
147
    );
148
149
    output_html_with_http_headers $input, $cookie, $template->output;
150
} else {
122
    if ($multi_hold) {
151
    if ($multi_hold) {
123
        if ($bad_bibs) {
152
        if ($bad_bibs) {
124
            $biblionumbers .= $bad_bibs;
153
            $biblionumbers .= $bad_bibs;
Lines 128-139 if ( $type eq 'str8' && $borrower ) { Link Here
128
    else {
157
    else {
129
        print $input->redirect("request.pl?biblionumber=$biblionumber");
158
        print $input->redirect("request.pl?biblionumber=$biblionumber");
130
    }
159
    }
131
}
160
    exit;
132
elsif ( $borrowernumber eq '' ) {
133
    print $input->header();
134
    print "Invalid borrower number please try again";
135
136
    # Not sure that Dump() does HTML escaping. Use firebug or something to trace
137
    # instead.
138
    #print $input->Dump;
139
}
161
}
(-)a/t/db_dependent/Circulation/CanBookBeIssued.t (+107 lines)
Line 0 Link Here
1
#!/usr/bin/env perl
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 3 of the License, or
8
# (at your option) any later version.
9
#
10
# Koha is distributed in the hope that it will be useful, but
11
# WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
17
18
use Modern::Perl;
19
20
use Test::More tests => 1;
21
use C4::Members;
22
use C4::Reserves;
23
use C4::Circulation;
24
use C4::Branch;
25
use Koha::DateUtils;
26
27
use t::lib::TestBuilder;
28
29
my $schema  = Koha::Database->new->schema;
30
$schema->storage->txn_begin;
31
32
my $builder = t::lib::TestBuilder->new();
33
34
subtest 'Tests for CanBookBeIssued with overlap reserves' => sub {
35
    plan tests => 6;
36
37
    my $categorycode = $builder->build({ source => 'Category' })->{ categorycode };
38
    my $branchcode = $builder->build({ source => 'Branch' })->{ branchcode };
39
40
    my $borrower = $builder->build({
41
        source => 'Borrower',
42
        value => {
43
            branchcode   => $branchcode,
44
            categorycode => $categorycode,
45
        }
46
    });
47
    my $borrowernumber = $borrower->{borrowernumber};
48
    $borrower = GetMemberDetails($borrowernumber);
49
50
    my $biblio = $builder->build({source => 'Biblio'});
51
    my $biblioitem = $builder->build({
52
        source => 'Biblioitem',
53
        value => {
54
            biblionumber => $biblio->{biblionumber},
55
        },
56
    });
57
    my $item = $builder->build({
58
        source => 'Item',
59
        value => {
60
            biblionumber => $biblio->{biblionumber},
61
            biblioitemnumber => $biblioitem->{biblioitemnumber},
62
            withdrawn => 0,
63
            itemlost => 0,
64
            notforloan => 0,
65
        },
66
    });
67
68
69
    my $startdate = dt_from_string();
70
    $startdate->add_duration(DateTime::Duration->new(days => 4));
71
    my $expdate = $startdate->clone();
72
    $expdate->add_duration(DateTime::Duration->new(days => 10));
73
74
    my $reserveid = AddReserve($branchcode, $borrowernumber,
75
        $item->{biblionumber}, undef,  1, $startdate->ymd(), $expdate->ymd,
76
        undef, undef, undef, undef);
77
78
    my $non_overlap_duedate = dt_from_string();
79
    $non_overlap_duedate->add_duration(DateTime::Duration->new(days => 2));
80
    my ($error, $question, $alerts ) =
81
        CanBookBeIssued($borrower, $item->{barcode}, $non_overlap_duedate, 1, 0);
82
83
    is_deeply($error, {}, "");
84
    is_deeply($question, {}, "");
85
    is_deeply($alerts, {}, "");
86
87
    my $overlap_duedate = dt_from_string();
88
    $overlap_duedate->add_duration(DateTime::Duration->new(days => 5));
89
    ($error, $question, $alerts ) =
90
        CanBookBeIssued($borrower, $item->{barcode}, $overlap_duedate, 1, 0);
91
92
    is_deeply($error, {}, "");
93
    my $expected = {
94
        RESERVED => 1,
95
        resfirstname => $borrower->{firstname},
96
        ressurname => $borrower->{surname},
97
        rescardnumber => $borrower->{cardnumber},
98
        resborrowernumber => $borrower->{borrowernumber},
99
        resbranchname => GetBranchName($branchcode),
100
        resreservedate => $startdate->ymd,
101
        resreserveid => $reserveid,
102
    };
103
    is_deeply($question, $expected, "");
104
    is_deeply($alerts, {}, "");
105
};
106
107
$schema->storage->txn_rollback;
(-)a/t/db_dependent/Reserves/ReserveDate.t (-1 / +108 lines)
Line 0 Link Here
0
- 
1
#!/usr/bin/perl
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 3 of the License, or
8
# (at your option) any later version.
9
#
10
# Koha is distributed in the hope that it will be useful, but
11
# WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
17
18
use Modern::Perl;
19
20
use Test::More tests => 6;
21
use Test::Warn;
22
23
use MARC::Record;
24
use DateTime::Duration;
25
26
use C4::Biblio;
27
use C4::Items;
28
use C4::Members;
29
use C4::Circulation;
30
use Koha::Holds;
31
use t::lib::TestBuilder;
32
33
use Koha::DateUtils;
34
35
36
use_ok('C4::Reserves');
37
38
my $dbh = C4::Context->dbh;
39
40
# Start transaction
41
$dbh->{AutoCommit} = 0;
42
$dbh->{RaiseError} = 1;
43
44
my $builder = t::lib::TestBuilder->new();
45
my $categorycode = $builder->build({ source => 'Category' })->{ categorycode };
46
my $branchcode = $builder->build({ source => 'Branch' })->{ branchcode };
47
48
my $borrower = $builder->build({
49
    source => 'Borrower',
50
    value => {
51
        branchcode   => $branchcode,
52
        categorycode => $categorycode,
53
    }
54
});
55
56
my $borrower2 = $builder->build({
57
    source => 'Borrower',
58
    value => {
59
        branchcode   => $branchcode,
60
        categorycode => $categorycode,
61
    }
62
});
63
64
my $borrowernumber = $borrower->{borrowernumber};
65
my $borrowernumber2 = $borrower2->{borrowernumber};
66
67
# Create a helper biblio
68
my $biblio = MARC::Record->new();
69
my $title = 'Alone in the Dark';
70
my $author = 'Karen Rose';
71
if( C4::Context->preference('marcflavour') eq 'UNIMARC' ) {
72
    $biblio->append_fields(
73
        MARC::Field->new('600', '', '1', a => $author),
74
        MARC::Field->new('200', '', '', a => $title),
75
    );
76
}
77
else {
78
    $biblio->append_fields(
79
        MARC::Field->new('100', '', '', a => $author),
80
        MARC::Field->new('245', '', '', a => $title),
81
    );
82
}
83
my ($bibnum, $bibitemnum);
84
($bibnum, $title, $bibitemnum) = AddBiblio($biblio, '');
85
86
my ($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem({ homebranch => $branchcode, holdingbranch => $branchcode, barcode => '333' } , $bibnum);
87
88
C4::Context->set_preference('AllowHoldDateInFuture', 1);
89
90
AddReserve($branchcode, $borrowernumber, $bibnum,
91
           $bibitemnum,  1, '2015-11-01', '2015-11-20', undef,
92
           undef, undef, undef);
93
94
is(ReservesOnSamePeriod($bibnum, undef, '2015-11-25', '2015-11-30'), undef, "Period doesn't overlaps");
95
96
ok(ReservesOnSamePeriod($bibnum, undef, '2015-11-02', '2015-11-10'), "Period overlaps");
97
98
my ($item_bibnum2, $item_bibitemnum2, $itemnumber2) = AddItem({ homebranch => $branchcode, holdingbranch => $branchcode, barcode => '444' } , $bibnum);
99
is(ReservesOnSamePeriod($bibnum, undef, '2015-11-02', '2015-11-10'), undef, "Period overlaps but there is 2 items");
100
101
AddReserve($branchcode, $borrowernumber2, $bibnum,
102
           $bibitemnum,  1, '2016-02-01', '2016-02-10', undef,
103
           undef, $itemnumber, undef);
104
is(ReservesOnSamePeriod($bibnum, $itemnumber, '02/12/2015', '10/12/2015'), undef, "Period on item does not overlap (with metric date format)");
105
106
my $reserve = ReservesOnSamePeriod($bibnum, $itemnumber, '2016-01-31', '2016-02-05');
107
is($reserve->[0]->{itemnumber}, $itemnumber, 'Period on item overlaps');
108
$dbh->rollback;

Return to bug 15261