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

(-)a/C4/SIP/ILS.pm (-9 / +7 lines)
Lines 6-26 package C4::SIP::ILS; Link Here
6
6
7
use warnings;
7
use warnings;
8
use strict;
8
use strict;
9
use C4::SIP::Sip qw( siplog );
10
use Koha::DateUtils qw( dt_from_string output_pref );
11
use Data::Dumper;
12
9
10
use C4::Context;
13
use C4::SIP::ILS::Item;
11
use C4::SIP::ILS::Item;
14
use C4::SIP::ILS::Patron;
12
use C4::SIP::ILS::Patron;
15
use C4::SIP::ILS::Transaction;
16
use C4::SIP::ILS::Transaction::Checkout;
17
use C4::SIP::ILS::Transaction::Checkin;
13
use C4::SIP::ILS::Transaction::Checkin;
14
use C4::SIP::ILS::Transaction::Checkout;
18
use C4::SIP::ILS::Transaction::FeePayment;
15
use C4::SIP::ILS::Transaction::FeePayment;
19
use C4::SIP::ILS::Transaction::Hold;
16
use C4::SIP::ILS::Transaction::Hold;
20
use C4::SIP::ILS::Transaction::Renew;
17
use C4::SIP::ILS::Transaction::Renew;
21
use C4::SIP::ILS::Transaction::RenewAll;
18
use C4::SIP::ILS::Transaction::RenewAll;
22
19
use C4::SIP::ILS::Transaction;
23
use C4::Context;    #BZ 18317
20
use C4::SIP::Sip qw( siplog );
21
use Koha::DateUtils qw( dt_from_string output_pref );
24
22
25
my %supports = (
23
my %supports = (
26
    'magnetic media'        => 1,
24
    'magnetic media'        => 1,
Lines 164-171 sub checkout { Link Here
164
    }
162
    }
165
    elsif (
163
    elsif (
166
        $item->{borrowernumber}
164
        $item->{borrowernumber}
167
        && !C4::Context->preference('AllowItemsOnLoanCheckoutSIP')    #BZ 18317
165
            && !C4::Context->preference('AllowItemsOnLoanCheckoutSIP')
168
        && !_ci_cardnumber_cmp( $item->{borrowernumber}, $patron->borrowernumber )
166
            && !_ci_cardnumber_cmp( $item->{borrowernumber}, $patron->borrowernumber )
169
        )
167
        )
170
    {
168
    {
171
        $circ->screen_msg("Item checked out to another patron");
169
        $circ->screen_msg("Item checked out to another patron");
(-)a/installer/data/mysql/mandatory/sysprefs.sql (-1 / +1 lines)
Lines 33-41 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
33
('AllowHoldPolicyOverride','0',NULL,'Allow staff to override hold policies when placing holds','YesNo'),
33
('AllowHoldPolicyOverride','0',NULL,'Allow staff to override hold policies when placing holds','YesNo'),
34
('AllowHoldsOnDamagedItems','1','','Allow hold requests to be placed on damaged items','YesNo'),
34
('AllowHoldsOnDamagedItems','1','','Allow hold requests to be placed on damaged items','YesNo'),
35
('AllowHoldsOnPatronsPossessions','1',NULL,'Allow holds on records that patron have items of it','YesNo'),
35
('AllowHoldsOnPatronsPossessions','1',NULL,'Allow holds on records that patron have items of it','YesNo'),
36
('AllowItemsOnLoanCheckoutSIP','0','','Do not generate ISSUED_TO_ANOTHER warning when checking out items already checked out to someone else via SIP. This allows self checkouts for those items.','YesNo'),
37
('AllowItemsOnHoldCheckoutSCO','0','','Do not generate RESERVE_WAITING and RESERVED warning in the SCO module when checking out items reserved to someone else. This allows self checkouts for those items.','YesNo'),
36
('AllowItemsOnHoldCheckoutSCO','0','','Do not generate RESERVE_WAITING and RESERVED warning in the SCO module when checking out items reserved to someone else. This allows self checkouts for those items.','YesNo'),
38
('AllowItemsOnHoldCheckoutSIP','0','','Do not generate RESERVED warning when checking out items reserved to someone else via SIP. This allows self checkouts for those items.','YesNo'),
37
('AllowItemsOnHoldCheckoutSIP','0','','Do not generate RESERVED warning when checking out items reserved to someone else via SIP. This allows self checkouts for those items.','YesNo'),
38
('AllowItemsOnLoanCheckoutSIP','0','','Do not generate ISSUED_TO_ANOTHER warning when checking out items already checked out to someone else via SIP. This allows self checkouts for those items.','YesNo'),
39
('AllowMultipleCovers','0','1','Allow multiple cover images to be attached to each bibliographic record.','YesNo'),
39
('AllowMultipleCovers','0','1','Allow multiple cover images to be attached to each bibliographic record.','YesNo'),
40
('AllowMultipleIssuesOnABiblio',1,'Allow/Don\'t allow patrons to check out multiple items from one biblio','','YesNo'),
40
('AllowMultipleIssuesOnABiblio',1,'Allow/Don\'t allow patrons to check out multiple items from one biblio','','YesNo'),
41
('AllowNotForLoanOverride','0','','If ON, Koha will allow the librarian to loan a not for loan item.','YesNo'),
41
('AllowNotForLoanOverride','0','','If ON, Koha will allow the librarian to loan a not for loan item.','YesNo'),
(-)a/t/db_dependent/SIP/Transaction.t (-2 / +46 lines)
Lines 4-10 Link Here
4
# Current state is very rudimentary. Please help to extend it!
4
# Current state is very rudimentary. Please help to extend it!
5
5
6
use Modern::Perl;
6
use Modern::Perl;
7
use Test::More tests => 18;
7
use Test::More tests => 19;
8
use Test::Warn;
8
use Test::Warn;
9
9
10
use Koha::Database;
10
use Koha::Database;
Lines 1314-1317 subtest do_checkout_with_recalls => sub { Link Here
1314
    is( $recall2->status, 'fulfilled', 'Recall is fulfilled by checked out item' );
1314
    is( $recall2->status, 'fulfilled', 'Recall is fulfilled by checked out item' );
1315
};
1315
};
1316
1316
1317
subtest 'Checkin message' => sub {
1318
    plan tests => 2;
1319
1320
    my $mockILS = Test::MockObject->new;
1321
    my $server  = { ils => $mockILS };
1322
    my $library = $builder->build_object( { class => 'Koha::Libraries' } );
1323
    my $patron1 = $builder->build_object( { class => 'Koha::Patrons' } );
1324
    my $patron2 = $builder->build_object( { class => 'Koha::Patrons' } );
1325
1326
    my $institution = {
1327
        id             => $library->id,
1328
        implementation => "ILS",
1329
        policy         => {
1330
            checkin  => "true",
1331
            renewal  => "true",
1332
            checkout => "true",
1333
            timeout  => 100,
1334
            retries  => 5,
1335
        }
1336
    };
1337
    my $ils  = C4::SIP::ILS->new($institution);
1338
    my $item = $builder->build_sample_item(
1339
        {
1340
            library            => $library->branchcode,
1341
            location           => 'My Location',
1342
            permanent_location => 'My Permanent Location',
1343
        }
1344
    );
1345
1346
    t::lib::Mocks::mock_preference( 'AllowItemsOnLoanCheckoutSIP', '' );
1347
1348
    my $circ = $ils->checkout( $patron1->cardnumber, $item->barcode, undef, undef, $server->{account} );
1349
1350
    $circ = $ils->checkout( $patron2->cardnumber, $item->barcode, undef, undef, $server->{account} );
1351
    is(
1352
        $circ->{screen_msg}, 'Item checked out to another patron',
1353
        "Checked out item was not checked out to the next patron"
1354
    );
1355
1356
    t::lib::Mocks::mock_preference( 'AllowItemsOnLoanCheckoutSIP', '1' );
1357
1358
    $circ = $ils->checkout( $patron2->cardnumber, $item->barcode, undef, undef, $server->{account} );
1359
    is( $circ->{screen_msg}, '', "Checked out item was checked out to the next patron" );
1360
};
1361
1317
$schema->storage->txn_rollback;
1362
$schema->storage->txn_rollback;
1318
- 

Return to bug 18317