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

(-)a/installer/data/mysql/atomicupdate/bug_34643.pl (+22 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(
12
            q{
13
            INSERT IGNORE INTO systempreferences VALUES
14
            ("CircConfirmItemPartsSCO", ?, NULL, "Deny checkout of multipart items for self-checkout", "Yes/No" ),
15
            ("CircConfirmItemPartsSCI", ?, NULL, "Deny checkout of multipart items for self-checkin", "Yes/No");
16
        }, undef, $val, $val
17
        );
18
19
        say $out "Added new system preference 'CircConfirmItemPartsSCO'";
20
        say $out "Added new system preference 'CircConfirmItemPartsSCI'";
21
    },
22
};
(-)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 the web-based self checkout module.
21
        -
22
            - pref: CircConfirmItemPartsSCI
23
              choices:
24
                  1: "Don't allow"
25
                  0: "Allow"
26
            - multi-part items to be checked in via the web-based self check-in or self checkout modules.
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 'cud-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 147-153 if ( $patron && $op eq "cud-returnbook" && $allowselfcheckreturns ) { Link Here
147
147
148
148
149
    my $item = Koha::Items->find( { barcode => $barcode } );
149
    my $item = Koha::Items->find( { barcode => $barcode } );
150
    if ( $success && C4::Context->preference("CircConfirmItemParts") ) {
150
    if ( $success && C4::Context->preference("CircConfirmItemPartsSCI") ) {
151
        if ( defined($item)
151
        if ( defined($item)
152
            && $item->materials )
152
            && $item->materials )
153
        {
153
        {
Lines 179-184 elsif ( $patron && ( $op eq 'cud-checkout' ) ) { Link Here
179
        0,
179
        0,
180
        C4::Context->preference("AllowItemsOnHoldCheckoutSCO")
180
        C4::Context->preference("AllowItemsOnHoldCheckoutSCO")
181
    );
181
    );
182
183
    delete $needconfirm->{ADDITIONAL_MATERIALS} unless C4::Context->preference("CircConfirmItemPartsSCO");
184
182
    my $issue_error;
185
    my $issue_error;
183
    if ( $confirm_required = scalar keys %$needconfirm ) {
186
    if ( $confirm_required = scalar keys %$needconfirm ) {
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 ) ) {
187
        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 ) ) {
185
- 

Return to bug 34643