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

(-)a/C4/Circulation.pm (-5 / +5 lines)
Lines 1429-1435 sub AddIssue { Link Here
1429
1429
1430
        if ( $item->{'location'} eq 'CART' && $item->{'permanent_location'} ne 'CART'  ) {
1430
        if ( $item->{'location'} eq 'CART' && $item->{'permanent_location'} ne 'CART'  ) {
1431
        ## Item was moved to cart via UpdateItemLocationOnCheckin, anything issued should be taken off the cart.
1431
        ## Item was moved to cart via UpdateItemLocationOnCheckin, anything issued should be taken off the cart.
1432
          CartToShelf( $item->{'itemnumber'} );
1432
            CartToShelf( $item->{'itemnumber'} );
1433
        }
1433
        }
1434
        $item->{'issues'}++;
1434
        $item->{'issues'}++;
1435
        if ( C4::Context->preference('UpdateTotalIssuesOnCirc') ) {
1435
        if ( C4::Context->preference('UpdateTotalIssuesOnCirc') ) {
Lines 1934-1944 sub AddReturn { Link Here
1934
1934
1935
    my $borrowernumber = $borrower->{'borrowernumber'} || undef;    # we don't know if we had a borrower or not
1935
    my $borrowernumber = $borrower->{'borrowernumber'} || undef;    # we don't know if we had a borrower or not
1936
1936
1937
    my $yaml = C4::Context->preference('UpdateItemLocationOnCheckin');
1937
    my $yaml_loc = C4::Context->preference('UpdateItemLocationOnCheckin');
1938
    if ($yaml) {
1938
    if ($yaml_loc) {
1939
        $yaml = "$yaml\n\n";  # YAML is strict on ending \n. Surplus does not hurt
1939
        $yaml_loc = "$yaml_loc\n\n";  # YAML is strict on ending \n. Surplus does not hurt
1940
        my $rules;
1940
        my $rules;
1941
        eval { $rules = YAML::Load($yaml); };
1941
        eval { $rules = YAML::Load($yaml_loc); };
1942
        if ($@) {
1942
        if ($@) {
1943
            warn "Unable to parse UpdateItemLocationOnCheckin syspref : $@";
1943
            warn "Unable to parse UpdateItemLocationOnCheckin syspref : $@";
1944
        }
1944
        }
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-2 / +2 lines)
Lines 484-490 $(document).ready(function () { Link Here
484
                            from
484
                            from
485
                            [% IF errmsgloo.ItemLocationUpdated.from %]
485
                            [% IF errmsgloo.ItemLocationUpdated.from %]
486
                                [% IF errmsgloo.ItemLocationUpdated.from == '' %]
486
                                [% IF errmsgloo.ItemLocationUpdated.from == '' %]
487
                                 empty
487
                                    empty
488
                                [% ELSIF AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.from ) == '' %]
488
                                [% ELSIF AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.from ) == '' %]
489
                                    [% errmsgloo.ItemLocationUpdated.from %] (No description available)
489
                                    [% errmsgloo.ItemLocationUpdated.from %] (No description available)
490
                                [% ELSE %]
490
                                [% ELSE %]
Lines 496-502 $(document).ready(function () { Link Here
496
                            to
496
                            to
497
                            [% IF errmsgloo.ItemLocationUpdated.to %]
497
                            [% IF errmsgloo.ItemLocationUpdated.to %]
498
                                [% IF errmsgloo.ItemLocationUpdated.to == '' %]
498
                                [% IF errmsgloo.ItemLocationUpdated.to == '' %]
499
                                   empty
499
                                    empty
500
                                [% ELSIF AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.to ) == '' %]
500
                                [% ELSIF AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.to ) == '' %]
501
                                    [% errmsgloo.ItemLocationUpdated.to %] (No description available)
501
                                    [% errmsgloo.ItemLocationUpdated.to %] (No description available)
502
                                [% ELSE %]
502
                                [% ELSE %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js (-2 / +2 lines)
Lines 148-155 $( document ).ready( function () { Link Here
148
        var reg_check = /.*:\s.*/;
148
        var reg_check = /.*:\s.*/;
149
        for (var i=0; i < split_text.length; i++){
149
        for (var i=0; i < split_text.length; i++){
150
            if ( !split_text[i].match(reg_check) && split_text[i].length ) {
150
            if ( !split_text[i].match(reg_check) && split_text[i].length ) {
151
            alert_issues+=split_text[i]+"\n";
151
                alert_issues+=split_text[i]+"\n";
152
            issue_count++;
152
                issue_count++;
153
            }
153
            }
154
        }
154
        }
155
        if (issue_count) alert_text += "\n"+_("The following values are not formatted correctly:")+"\n"+alert_issues;
155
        if (issue_count) alert_text += "\n"+_("The following values are not formatted correctly:")+"\n"+alert_issues;
(-)a/t/db_dependent/Circulation/issue.t (-5 / +4 lines)
Lines 400-411 my $itemnumber2; Link Here
400
    $biblionumber
400
    $biblionumber
401
);
401
);
402
402
403
C4::Context->set_preference( 'UpdateItemLocationOnCheckin', q{} );
403
t::lib::Mocks::mock_preference( 'UpdateItemLocationOnCheckin', q{} );
404
AddReturn( 'barcode_4', $samplebranch1->{branchcode} );
404
AddReturn( 'barcode_4', $samplebranch1->{branchcode} );
405
my $item2 = GetItem( $itemnumber2 );
405
my $item2 = GetItem( $itemnumber2 );
406
ok( $item2->{location} eq 'FIC', 'UpdateItemLocationOnCheckin does not modify value when not enabled' );
406
ok( $item2->{location} eq 'FIC', 'UpdateItemLocationOnCheckin does not modify value when not enabled' );
407
407
408
C4::Context->set_preference( 'UpdateItemLocationOnCheckin', 'FIC: GEN' );
408
t::lib::Mocks::mock_preference( 'UpdateItemLocationOnCheckin', 'FIC: GEN' );
409
AddReturn( 'barcode_4', $samplebranch1->{branchcode} );
409
AddReturn( 'barcode_4', $samplebranch1->{branchcode} );
410
$item2 = GetItem( $itemnumber2 );
410
$item2 = GetItem( $itemnumber2 );
411
ok( $item2->{location} eq 'GEN', q{UpdateItemLocationOnCheckin updates location value from 'FIC' to 'GEN' with setting "FIC: GEN"} );
411
ok( $item2->{location} eq 'GEN', q{UpdateItemLocationOnCheckin updates location value from 'FIC' to 'GEN' with setting "FIC: GEN"} );
Lines 414-420 AddReturn( 'barcode_4', $samplebranch1->{branchcode} ); Link Here
414
$item2 = GetItem( $itemnumber2 );
414
$item2 = GetItem( $itemnumber2 );
415
ok( $item2->{location} eq 'GEN', q{UpdateItemLocationOnCheckin does not update location value from 'GEN' with setting "FIC: GEN"} );
415
ok( $item2->{location} eq 'GEN', q{UpdateItemLocationOnCheckin does not update location value from 'GEN' with setting "FIC: GEN"} );
416
416
417
C4::Context->set_preference( 'UpdateItemLocationOnCheckin', '_ALL_: CART' );
417
t::lib::Mocks::mock_preference( 'UpdateItemLocationOnCheckin', '_ALL_: CART' );
418
AddReturn( 'barcode_4', $samplebranch1->{branchcode} );
418
AddReturn( 'barcode_4', $samplebranch1->{branchcode} );
419
$item2 = GetItem( $itemnumber2 );
419
$item2 = GetItem( $itemnumber2 );
420
ok( $item2->{location} eq 'CART', q{UpdateItemLocationOnCheckin updates location value from 'GEN' with setting "_ALL_: CART"} );
420
ok( $item2->{location} eq 'CART', q{UpdateItemLocationOnCheckin updates location value from 'GEN' with setting "_ALL_: CART"} );
Lines 423-429 AddIssue( $borrower_1, 'barcode_4', $daysago10,0, $today, '' ); Link Here
423
$item2 = GetItem( $itemnumber2 );
423
$item2 = GetItem( $itemnumber2 );
424
ok( $item2->{location} eq 'GEN', q{Location updates from 'CART' to permanent location on issue} );
424
ok( $item2->{location} eq 'GEN', q{Location updates from 'CART' to permanent location on issue} );
425
425
426
C4::Context->set_preference( 'UpdateItemLocationOnCheckin', "GEN: _BLANK_\n_BLANK_: PROC\nPROC: _PERM_" );
426
t::lib::Mocks::mock_preference( 'UpdateItemLocationOnCheckin', "GEN: _BLANK_\n_BLANK_: PROC\nPROC: _PERM_" );
427
AddReturn( 'barcode_4', $samplebranch1->{branchcode} );
427
AddReturn( 'barcode_4', $samplebranch1->{branchcode} );
428
$item2 = GetItem( $itemnumber2 );
428
$item2 = GetItem( $itemnumber2 );
429
ok( $item2->{location} eq '', q{UpdateItemLocationOnCheckin updates location value from 'GEN' to '' with setting "GEN: _BLANK_"} );
429
ok( $item2->{location} eq '', q{UpdateItemLocationOnCheckin updates location value from 'GEN' to '' with setting "GEN: _BLANK_"} );
430
- 

Return to bug 14576