@@ -, +, @@ --- C4/Circulation.pm | 10 +++++----- koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt | 4 ++-- koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js | 4 ++-- t/db_dependent/Circulation/issue.t | 8 ++++---- 4 files changed, 13 insertions(+), 13 deletions(-) --- a/C4/Circulation.pm +++ a/C4/Circulation.pm @@ -1453,7 +1453,7 @@ sub AddIssue { if ( $item->{'location'} eq 'CART' && $item->{'permanent_location'} ne 'CART' ) { ## Item was moved to cart via UpdateItemLocationOnCheckin, anything issued should be taken off the cart. - CartToShelf( $item->{'itemnumber'} ); + CartToShelf( $item->{'itemnumber'} ); } $item->{'issues'}++; if ( C4::Context->preference('UpdateTotalIssuesOnCirc') ) { @@ -1983,11 +1983,11 @@ sub AddReturn { my $borrowernumber = $borrower->{'borrowernumber'} || undef; # we don't know if we had a borrower or not - my $yaml = C4::Context->preference('UpdateItemLocationOnCheckin'); - if ($yaml) { - $yaml = "$yaml\n\n"; # YAML is strict on ending \n. Surplus does not hurt + my $yaml_loc = C4::Context->preference('UpdateItemLocationOnCheckin'); + if ($yaml_loc) { + $yaml_loc = "$yaml_loc\n\n"; # YAML is strict on ending \n. Surplus does not hurt my $rules; - eval { $rules = YAML::Load($yaml); }; + eval { $rules = YAML::Load($yaml_loc); }; if ($@) { warn "Unable to parse UpdateItemLocationOnCheckin syspref : $@"; } --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt @@ -489,7 +489,7 @@ $(document).ready(function () { from [% IF errmsgloo.ItemLocationUpdated.from %] [% IF errmsgloo.ItemLocationUpdated.from == '' %] - empty + empty [% ELSIF AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.from ) == '' %] [% errmsgloo.ItemLocationUpdated.from %] (No description available) [% ELSE %] @@ -501,7 +501,7 @@ $(document).ready(function () { to [% IF errmsgloo.ItemLocationUpdated.to %] [% IF errmsgloo.ItemLocationUpdated.to == '' %] - empty + empty [% ELSIF AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.to ) == '' %] [% errmsgloo.ItemLocationUpdated.to %] (No description available) [% ELSE %] --- a/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js +++ a/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js @@ -148,8 +148,8 @@ $( document ).ready( function () { var reg_check = /.*:\s.*/; for (var i=0; i < split_text.length; i++){ if ( !split_text[i].match(reg_check) && split_text[i].length ) { - alert_issues+=split_text[i]+"\n"; - issue_count++; + alert_issues+=split_text[i]+"\n"; + issue_count++; } } if (issue_count) alert_text += "\n"+_("The following values are not formatted correctly:")+"\n"+alert_issues; --- a/t/db_dependent/Circulation/issue.t +++ a/t/db_dependent/Circulation/issue.t @@ -400,12 +400,12 @@ my $itemnumber2; $biblionumber ); -C4::Context->set_preference( 'UpdateItemLocationOnCheckin', q{} ); +t::lib::Mocks::mock_preference( 'UpdateItemLocationOnCheckin', q{} ); AddReturn( 'barcode_4', $samplebranch1->{branchcode} ); my $item2 = GetItem( $itemnumber2 ); ok( $item2->{location} eq 'FIC', 'UpdateItemLocationOnCheckin does not modify value when not enabled' ); -C4::Context->set_preference( 'UpdateItemLocationOnCheckin', 'FIC: GEN' ); +t::lib::Mocks::mock_preference( 'UpdateItemLocationOnCheckin', 'FIC: GEN' ); AddReturn( 'barcode_4', $samplebranch1->{branchcode} ); $item2 = GetItem( $itemnumber2 ); ok( $item2->{location} eq 'GEN', q{UpdateItemLocationOnCheckin updates location value from 'FIC' to 'GEN' with setting "FIC: GEN"} ); @@ -414,7 +414,7 @@ AddReturn( 'barcode_4', $samplebranch1->{branchcode} ); $item2 = GetItem( $itemnumber2 ); ok( $item2->{location} eq 'GEN', q{UpdateItemLocationOnCheckin does not update location value from 'GEN' with setting "FIC: GEN"} ); -C4::Context->set_preference( 'UpdateItemLocationOnCheckin', '_ALL_: CART' ); +t::lib::Mocks::mock_preference( 'UpdateItemLocationOnCheckin', '_ALL_: CART' ); AddReturn( 'barcode_4', $samplebranch1->{branchcode} ); $item2 = GetItem( $itemnumber2 ); ok( $item2->{location} eq 'CART', q{UpdateItemLocationOnCheckin updates location value from 'GEN' with setting "_ALL_: CART"} ); @@ -423,7 +423,7 @@ AddIssue( $borrower_1, 'barcode_4', $daysago10,0, $today, '' ); $item2 = GetItem( $itemnumber2 ); ok( $item2->{location} eq 'GEN', q{Location updates from 'CART' to permanent location on issue} ); -C4::Context->set_preference( 'UpdateItemLocationOnCheckin', "GEN: _BLANK_\n_BLANK_: PROC\nPROC: _PERM_" ); +t::lib::Mocks::mock_preference( 'UpdateItemLocationOnCheckin', "GEN: _BLANK_\n_BLANK_: PROC\nPROC: _PERM_" ); AddReturn( 'barcode_4', $samplebranch1->{branchcode} ); $item2 = GetItem( $itemnumber2 ); ok( $item2->{location} eq '', q{UpdateItemLocationOnCheckin updates location value from 'GEN' to '' with setting "GEN: _BLANK_"} ); --