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

(-)a/C4/SIP/Sip/MsgType.pm (+3 lines)
Lines 17-22 use C4::SIP::Sip::Checksum qw(verify_cksum); Link Here
17
use Data::Dumper;
17
use Data::Dumper;
18
use CGI qw ( -utf8 );
18
use CGI qw ( -utf8 );
19
use C4::Auth qw(&check_api_auth);
19
use C4::Auth qw(&check_api_auth);
20
use C4::Items qw(ModDateLastSeen);
20
21
21
use Koha::Patrons;
22
use Koha::Patrons;
22
use Koha::Patron::Attributes;
23
use Koha::Patron::Attributes;
Lines 1232-1237 sub handle_item_information { Link Here
1232
        # title id is required, but we don't have one
1233
        # title id is required, but we don't have one
1233
        $resp .= add_field( FID_TITLE_ID, '', $server );
1234
        $resp .= add_field( FID_TITLE_ID, '', $server );
1234
    } else {
1235
    } else {
1236
        my $seen = $account->{seen_on_item_information};
1237
        ModDateLastSeen( $item->itemnumber, $seen eq 'keep_lost' ) if $seen;
1235
1238
1236
        # Valid Item ID, send the good stuff
1239
        # Valid Item ID, send the good stuff
1237
        my $circulation_status = $item->sip_circulation_status;
1240
        my $circulation_status = $item->sip_circulation_status;
(-)a/debian/templates/SIPconfig.xml (-1 / +2 lines)
Lines 57-63 Link Here
57
             overdues_block_checkout="1"
57
             overdues_block_checkout="1"
58
             format_due_date="0"
58
             format_due_date="0"
59
             inhouse_item_types=""
59
             inhouse_item_types=""
60
             inhouse_patron_categories="">
60
             inhouse_patron_categories=""
61
             seen_on_item_information="mark_found"> <!-- could be "keep_lost", empty to disable -->
61
          <screen_msg_regex find="Greetings from Koha." replace="Welcome to your library!" />
62
          <screen_msg_regex find="Greetings from Koha." replace="Welcome to your library!" />
62
          <screen_msg_regex find="Invalid patron barcode." replace="Barcode not found, are you sure this is your library card?" />
63
          <screen_msg_regex find="Invalid patron barcode." replace="Barcode not found, are you sure this is your library card?" />
63
      </login>
64
      </login>
(-)a/etc/SIPconfig.xml (-1 / +2 lines)
Lines 77-83 Link Here
77
             show_outstanding_amount="1"
77
             show_outstanding_amount="1"
78
             format_due_date="0"
78
             format_due_date="0"
79
             inhouse_item_types=""
79
             inhouse_item_types=""
80
             inhouse_patron_categories="">
80
             inhouse_patron_categories=""
81
             seen_on_item_information="mark_found"> <!-- could be "keep_lost", empty to disable -->
81
             <!-- lost_block_checkout sets flag if patron has more than the given current checkouts that are lost ( itemlost > 0 by default ) -->
82
             <!-- lost_block_checkout sets flag if patron has more than the given current checkouts that are lost ( itemlost > 0 by default ) -->
82
             <!-- lost_block_checkout_value determines the minimum lost item value to count ( that is, the value in items.itemlost ) -->
83
             <!-- lost_block_checkout_value determines the minimum lost item value to count ( that is, the value in items.itemlost ) -->
83
          <!-- Refer to syspref SIP2SortBinMapping for full explanation of sort bin mapping -->
84
          <!-- Refer to syspref SIP2SortBinMapping for full explanation of sort bin mapping -->
(-)a/t/db_dependent/SIP/Message.t (-2 / +19 lines)
Lines 380-386 subtest "Test build_custom_field_string" => sub { Link Here
380
};
380
};
381
381
382
subtest "Test cr_item_field" => sub {
382
subtest "Test cr_item_field" => sub {
383
    plan tests => 3;
383
    plan tests => 8;
384
384
385
    my $builder = t::lib::TestBuilder->new();
385
    my $builder = t::lib::TestBuilder->new();
386
    my $branchcode  = $builder->build({ source => 'Branch' })->{branchcode};
386
    my $branchcode  = $builder->build({ source => 'Branch' })->{branchcode};
Lines 405-410 subtest "Test cr_item_field" => sub { Link Here
405
        restricted => 0,
405
        restricted => 0,
406
        homebranch => $branchcode,
406
        homebranch => $branchcode,
407
        holdingbranch => $branchcode,
407
        holdingbranch => $branchcode,
408
        datelastseen => '1900-01-01',
408
    });
409
    });
409
410
410
    my $mockILS = $mocks->{ils};
411
    my $mockILS = $mocks->{ils};
Lines 448-454 subtest "Test cr_item_field" => sub { Link Here
448
449
449
    $server->{account}->{cr_item_field} = 'itype';
450
    $server->{account}->{cr_item_field} = 'itype';
450
451
452
    $server->{account}->{seen_on_item_information} = '';
453
    $msg->handle_item_information( $server );
454
    $item_object->get_from_storage;
455
    is( $item_object->datelastseen, "1900-01-01", "datelastseen remains unchanged" );
456
457
    $item_object->update({ itemlost => 1, datelastseen => '1900-01-01' });
458
    $server->{account}->{seen_on_item_information} = 'keep_lost';
459
    $msg->handle_item_information( $server );
460
    $item_object = Koha::Items->find( $item_object->id );
461
    isnt( $item_object->datelastseen, "1900-01-01", "datelastseen updated" );
462
    is( $item_object->itemlost, 1, "item remains lost" );
463
464
    $item_object->update({ itemlost => 1, datelastseen => '1900-01-01' });
465
    $server->{account}->{seen_on_item_information} = 'mark_found';
451
    $msg->handle_item_information( $server );
466
    $msg->handle_item_information( $server );
467
    $item_object = Koha::Items->find( $item_object->id );
468
    isnt( $item_object->datelastseen, "1900-01-01", "datelastseen updated" );
469
    is( $item_object->itemlost, 0, "item is no longer lost" );
452
470
453
    my $itype = $item_object->itype;
471
    my $itype = $item_object->itype;
454
    ok( $response =~ m/CR$itype/, "Found correct CR field in response");
472
    ok( $response =~ m/CR$itype/, "Found correct CR field in response");
455
- 

Return to bug 33580