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

(-)a/installer/data/mysql/atomicupdate/bug_34643.pl (+20 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number  => "34643",
5
    description => "Split CircConfirmItemParts for self-checkout and self-checkin",
6
    up          => sub {
7
        my ($args) = @_;
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
10
        my $val = C4::Context->preference('CircConfirmItemParts');
11
        $dbh->do(q{
12
            INSERT IGNORE INTO systempreferences VALUES
13
            ("CircConfirmItemPartsSCO", ?, NULL, "Deny checkout of multipart items for self-checkout", "Yes/No" ),
14
            ("CircConfirmItemPartsSCI", ?, NULL, "Deny checkout of multipart items for self-checkin", "Yes/No");
15
        }, undef, $val, $val);
16
17
        say $out "Added new system preference 'CircConfirmItemPartsSCO'";
18
        say $out "Added new system preference 'CircConfirmItemPartsSCI'";
19
    },
20
};
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (+12 lines)
Lines 12-17 Circulation: Link Here
12
                  1: "Require"
12
                  1: "Require"
13
                  0: "Don't require"
13
                  0: "Don't require"
14
            - staff to confirm that all parts of an item are present at checkin/checkout.
14
            - staff to confirm that all parts of an item are present at checkin/checkout.
15
        -
16
            - pref: CircConfirmItemPartsSCO
17
              choices:
18
                  1: "Don't allow"
19
                  0: "Allow"
20
            - multi-part items to be checked out via self-check.
21
        -
22
            - pref: CircConfirmItemPartsSCI
23
              choices:
24
                  1: "Don't allow"
25
                  0: "Allow"
26
            - multi-part items to be checked in via self-check.
15
        -
27
        -
16
            - pref: AutoSwitchPatron
28
            - pref: AutoSwitchPatron
17
              choices:
29
              choices:
(-)a/opac/sci/sci-main.pl (-1 / +1 lines)
Lines 68-74 if ( $op eq 'check_in' ) { Link Here
68
            my ( $success, $messages, $checkout, $patron );
68
            my ( $success, $messages, $checkout, $patron );
69
            my $item = Koha::Items->find( { barcode => $barcode } );
69
            my $item = Koha::Items->find( { barcode => $barcode } );
70
            my $human_required = 0;
70
            my $human_required = 0;
71
            if (   C4::Context->preference("CircConfirmItemParts")
71
            if (   C4::Context->preference("CircConfirmItemPartsSCI")
72
                && defined($item)
72
                && defined($item)
73
                && $item->materials )
73
                && $item->materials )
74
            {
74
            {
(-)a/opac/sco/sco-main.pl (-2 / +4 lines)
Lines 144-150 if ( $patron && $op eq "returnbook" && $allowselfcheckreturns ) { Link Here
144
144
145
145
146
    my $item = Koha::Items->find( { barcode => $barcode } );
146
    my $item = Koha::Items->find( { barcode => $barcode } );
147
    if ( $success && C4::Context->preference("CircConfirmItemParts") ) {
147
    if ( $success && C4::Context->preference("CircConfirmItemPartsSCI") ) {
148
        if ( defined($item)
148
        if ( defined($item)
149
            && $item->materials )
149
            && $item->materials )
150
        {
150
        {
Lines 176-181 elsif ( $patron && ( $op eq 'checkout' ) ) { Link Here
176
        0,
176
        0,
177
        C4::Context->preference("AllowItemsOnHoldCheckoutSCO")
177
        C4::Context->preference("AllowItemsOnHoldCheckoutSCO")
178
    );
178
    );
179
180
    delete $needconfirm->{ADDITIONAL_MATERIALS} unless C4::Context->preference("CircConfirmItemPartsSCO");
181
179
    my $issue_error;
182
    my $issue_error;
180
    if ( $confirm_required = scalar keys %$needconfirm ) {
183
    if ( $confirm_required = scalar keys %$needconfirm ) {
181
        for my $error ( qw( UNKNOWN_BARCODE max_loans_allowed ISSUED_TO_ANOTHER NO_MORE_RENEWALS NOT_FOR_LOAN DEBT WTHDRAWN RESTRICTED RESERVED ITEMNOTSAMEBRANCH EXPIRED DEBARRED CARD_LOST GNA INVALID_DATE UNKNOWN_BARCODE TOO_MANY DEBT_GUARANTEES DEBT_GUARANTORS USERBLOCKEDOVERDUE PATRON_CANT PREVISSUE NOT_FOR_LOAN_FORCING ITEM_LOST ADDITIONAL_MATERIALS ) ) {
184
        for my $error ( qw( UNKNOWN_BARCODE max_loans_allowed ISSUED_TO_ANOTHER NO_MORE_RENEWALS NOT_FOR_LOAN DEBT WTHDRAWN RESTRICTED RESERVED ITEMNOTSAMEBRANCH EXPIRED DEBARRED CARD_LOST GNA INVALID_DATE UNKNOWN_BARCODE TOO_MANY DEBT_GUARANTEES DEBT_GUARANTORS USERBLOCKEDOVERDUE PATRON_CANT PREVISSUE NOT_FOR_LOAN_FORCING ITEM_LOST ADDITIONAL_MATERIALS ) ) {
182
- 

Return to bug 34643