@@ -, +, @@ self-checkin fail --- .../data/mysql/atomicupdate/bug_34643.pl | 20 +++++++++++++++++++ .../admin/preferences/circulation.pref | 12 +++++++++++ opac/sci/sci-main.pl | 2 +- opac/sco/sco-main.pl | 5 ++++- 4 files changed, 37 insertions(+), 2 deletions(-) create mode 100755 installer/data/mysql/atomicupdate/bug_34643.pl --- a/installer/data/mysql/atomicupdate/bug_34643.pl +++ a/installer/data/mysql/atomicupdate/bug_34643.pl @@ -0,0 +1,20 @@ +use Modern::Perl; + +return { + bug_number => "34643", + description => "Split CircConfirmItemParts for self-checkout and self-checkin", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + my $val = C4::Context->preference('CircConfirmItemParts'); + $dbh->do(q{ + INSERT IGNORE INTO systempreferences VALUES + ("CircConfirmItemPartsSCO", ?, NULL, "Deny checkout of multipart items for self-checkout", "Yes/No" ), + ("CircConfirmItemPartsSCI", ?, NULL, "Deny checkout of multipart items for self-checkin", "Yes/No"); + }, undef, $val, $val); + + say $out "Added new system preference 'CircConfirmItemPartsSCO'"; + say $out "Added new system preference 'CircConfirmItemPartsSCI'"; + }, +}; --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -12,6 +12,18 @@ Circulation: 1: "Require" 0: "Don't require" - staff to confirm that all parts of an item are present at checkin/checkout. + - + - pref: CircConfirmItemPartsSCO + choices: + 1: "Don't allow" + 0: "Allow" + - multi-part items to be checked out via the web-based self checkout module. + - + - pref: CircConfirmItemPartsSCI + choices: + 1: "Don't allow" + 0: "Allow" + - multi-part items to be checked in via the web-based self check-in or self checkout modules. - - pref: AutoSwitchPatron choices: --- a/opac/sci/sci-main.pl +++ a/opac/sci/sci-main.pl @@ -68,7 +68,7 @@ if ( $op eq 'check_in' ) { my ( $success, $messages, $checkout, $patron ); my $item = Koha::Items->find( { barcode => $barcode } ); my $human_required = 0; - if ( C4::Context->preference("CircConfirmItemParts") + if ( C4::Context->preference("CircConfirmItemPartsSCI") && defined($item) && $item->materials ) { --- a/opac/sco/sco-main.pl +++ a/opac/sco/sco-main.pl @@ -144,7 +144,7 @@ if ( $patron && $op eq "returnbook" && $allowselfcheckreturns ) { my $item = Koha::Items->find( { barcode => $barcode } ); - if ( $success && C4::Context->preference("CircConfirmItemParts") ) { + if ( $success && C4::Context->preference("CircConfirmItemPartsSCI") ) { if ( defined($item) && $item->materials ) { @@ -176,6 +176,9 @@ elsif ( $patron && ( $op eq 'checkout' ) ) { 0, C4::Context->preference("AllowItemsOnHoldCheckoutSCO") ); + + delete $needconfirm->{ADDITIONAL_MATERIALS} unless C4::Context->preference("CircConfirmItemPartsSCO"); + my $issue_error; if ( $confirm_required = scalar keys %$needconfirm ) { 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 ) ) { --