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

(-)a/C4/Circulation.pm (-5 / +5 lines)
Lines 1387-1393 sub AddIssue { Link Here
1387
1387
1388
        if ( $item->{'location'} eq 'CART' && $item->{'permanent_location'} ne 'CART'  ) {
1388
        if ( $item->{'location'} eq 'CART' && $item->{'permanent_location'} ne 'CART'  ) {
1389
        ## Item was moved to cart via UpdateItemLocationOnCheckin, anything issued should be taken off the cart.
1389
        ## Item was moved to cart via UpdateItemLocationOnCheckin, anything issued should be taken off the cart.
1390
          CartToShelf( $item->{'itemnumber'} );
1390
            CartToShelf( $item->{'itemnumber'} );
1391
        }
1391
        }
1392
        $item->{'issues'}++;
1392
        $item->{'issues'}++;
1393
        if ( C4::Context->preference('UpdateTotalIssuesOnCirc') ) {
1393
        if ( C4::Context->preference('UpdateTotalIssuesOnCirc') ) {
Lines 1874-1884 sub AddReturn { Link Here
1874
1874
1875
    my $borrowernumber = $borrower->{'borrowernumber'} || undef;    # we don't know if we had a borrower or not
1875
    my $borrowernumber = $borrower->{'borrowernumber'} || undef;    # we don't know if we had a borrower or not
1876
1876
1877
    my $yaml = C4::Context->preference('UpdateItemLocationOnCheckin');
1877
    my $yaml_loc = C4::Context->preference('UpdateItemLocationOnCheckin');
1878
    if ($yaml) {
1878
    if ($yaml_loc) {
1879
        $yaml = "$yaml\n\n";  # YAML is strict on ending \n. Surplus does not hurt
1879
        $yaml_loc = "$yaml_loc\n\n";  # YAML is strict on ending \n. Surplus does not hurt
1880
        my $rules;
1880
        my $rules;
1881
        eval { $rules = YAML::Load($yaml); };
1881
        eval { $rules = YAML::Load($yaml_loc); };
1882
        if ($@) {
1882
        if ($@) {
1883
            warn "Unable to parse UpdateItemLocationOnCheckin syspref : $@";
1883
            warn "Unable to parse UpdateItemLocationOnCheckin syspref : $@";
1884
        }
1884
        }
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-2 / +2 lines)
Lines 606-612 $(document).ready(function () { Link Here
606
                            from
606
                            from
607
                            [% IF errmsgloo.ItemLocationUpdated.from %]
607
                            [% IF errmsgloo.ItemLocationUpdated.from %]
608
                                [% IF errmsgloo.ItemLocationUpdated.from == '' %]
608
                                [% IF errmsgloo.ItemLocationUpdated.from == '' %]
609
                                 empty
609
                                    empty
610
                                [% ELSIF AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.from ) == '' %]
610
                                [% ELSIF AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.from ) == '' %]
611
                                    [% errmsgloo.ItemLocationUpdated.from %] (No description available)
611
                                    [% errmsgloo.ItemLocationUpdated.from %] (No description available)
612
                                [% ELSE %]
612
                                [% ELSE %]
Lines 618-624 $(document).ready(function () { Link Here
618
                            to
618
                            to
619
                            [% IF errmsgloo.ItemLocationUpdated.to %]
619
                            [% IF errmsgloo.ItemLocationUpdated.to %]
620
                                [% IF errmsgloo.ItemLocationUpdated.to == '' %]
620
                                [% IF errmsgloo.ItemLocationUpdated.to == '' %]
621
                                   empty
621
                                    empty
622
                                [% ELSIF AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.to ) == '' %]
622
                                [% ELSIF AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.to ) == '' %]
623
                                    [% errmsgloo.ItemLocationUpdated.to %] (No description available)
623
                                    [% errmsgloo.ItemLocationUpdated.to %] (No description available)
624
                                [% ELSE %]
624
                                [% 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 377-388 my $itemnumber2; Link Here
377
    $biblionumber
377
    $biblionumber
378
);
378
);
379
379
380
C4::Context->set_preference( 'UpdateItemLocationOnCheckin', q{} );
380
t::lib::Mocks::mock_preference( 'UpdateItemLocationOnCheckin', q{} );
381
AddReturn( 'barcode_4', $samplebranch1->{branchcode} );
381
AddReturn( 'barcode_4', $samplebranch1->{branchcode} );
382
my $item2 = GetItem( $itemnumber2 );
382
my $item2 = GetItem( $itemnumber2 );
383
ok( $item2->{location} eq 'FIC', 'UpdateItemLocationOnCheckin does not modify value when not enabled' );
383
ok( $item2->{location} eq 'FIC', 'UpdateItemLocationOnCheckin does not modify value when not enabled' );
384
384
385
C4::Context->set_preference( 'UpdateItemLocationOnCheckin', 'FIC: GEN' );
385
t::lib::Mocks::mock_preference( 'UpdateItemLocationOnCheckin', 'FIC: GEN' );
386
AddReturn( 'barcode_4', $samplebranch1->{branchcode} );
386
AddReturn( 'barcode_4', $samplebranch1->{branchcode} );
387
$item2 = GetItem( $itemnumber2 );
387
$item2 = GetItem( $itemnumber2 );
388
ok( $item2->{location} eq 'GEN', q{UpdateItemLocationOnCheckin updates location value from 'FIC' to 'GEN' with setting "FIC: GEN"} );
388
ok( $item2->{location} eq 'GEN', q{UpdateItemLocationOnCheckin updates location value from 'FIC' to 'GEN' with setting "FIC: GEN"} );
Lines 391-397 AddReturn( 'barcode_4', $samplebranch1->{branchcode} ); Link Here
391
$item2 = GetItem( $itemnumber2 );
391
$item2 = GetItem( $itemnumber2 );
392
ok( $item2->{location} eq 'GEN', q{UpdateItemLocationOnCheckin does not update location value from 'GEN' with setting "FIC: GEN"} );
392
ok( $item2->{location} eq 'GEN', q{UpdateItemLocationOnCheckin does not update location value from 'GEN' with setting "FIC: GEN"} );
393
393
394
C4::Context->set_preference( 'UpdateItemLocationOnCheckin', '_ALL_: CART' );
394
t::lib::Mocks::mock_preference( 'UpdateItemLocationOnCheckin', '_ALL_: CART' );
395
AddReturn( 'barcode_4', $samplebranch1->{branchcode} );
395
AddReturn( 'barcode_4', $samplebranch1->{branchcode} );
396
$item2 = GetItem( $itemnumber2 );
396
$item2 = GetItem( $itemnumber2 );
397
ok( $item2->{location} eq 'CART', q{UpdateItemLocationOnCheckin updates location value from 'GEN' with setting "_ALL_: CART"} );
397
ok( $item2->{location} eq 'CART', q{UpdateItemLocationOnCheckin updates location value from 'GEN' with setting "_ALL_: CART"} );
Lines 400-406 AddIssue( $borrower_1, 'barcode_4', $daysago10,0, $today, '' ); Link Here
400
$item2 = GetItem( $itemnumber2 );
400
$item2 = GetItem( $itemnumber2 );
401
ok( $item2->{location} eq 'GEN', q{Location updates from 'CART' to permanent location on issue} );
401
ok( $item2->{location} eq 'GEN', q{Location updates from 'CART' to permanent location on issue} );
402
402
403
C4::Context->set_preference( 'UpdateItemLocationOnCheckin', "GEN: _BLANK_\n_BLANK_: PROC\nPROC: _PERM_" );
403
t::lib::Mocks::mock_preference( 'UpdateItemLocationOnCheckin', "GEN: _BLANK_\n_BLANK_: PROC\nPROC: _PERM_" );
404
AddReturn( 'barcode_4', $samplebranch1->{branchcode} );
404
AddReturn( 'barcode_4', $samplebranch1->{branchcode} );
405
$item2 = GetItem( $itemnumber2 );
405
$item2 = GetItem( $itemnumber2 );
406
ok( $item2->{location} eq '', q{UpdateItemLocationOnCheckin updates location value from 'GEN' to '' with setting "GEN: _BLANK_"} );
406
ok( $item2->{location} eq '', q{UpdateItemLocationOnCheckin updates location value from 'GEN' to '' with setting "GEN: _BLANK_"} );
407
- 

Return to bug 14576