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

(-)a/C4/Circulation.pm (-5 / +5 lines)
Lines 1385-1391 sub AddIssue { Link Here
1385
1385
1386
        if ( $item->{'location'} eq 'CART' && $item->{'permanent_location'} ne 'CART'  ) {
1386
        if ( $item->{'location'} eq 'CART' && $item->{'permanent_location'} ne 'CART'  ) {
1387
        ## Item was moved to cart via UpdateItemLocationOnCheckin, anything issued should be taken off the cart.
1387
        ## Item was moved to cart via UpdateItemLocationOnCheckin, anything issued should be taken off the cart.
1388
          CartToShelf( $item->{'itemnumber'} );
1388
            CartToShelf( $item->{'itemnumber'} );
1389
        }
1389
        }
1390
        $item->{'issues'}++;
1390
        $item->{'issues'}++;
1391
        if ( C4::Context->preference('UpdateTotalIssuesOnCirc') ) {
1391
        if ( C4::Context->preference('UpdateTotalIssuesOnCirc') ) {
Lines 1872-1882 sub AddReturn { Link Here
1872
1872
1873
    my $borrowernumber = $borrower->{'borrowernumber'} || undef;    # we don't know if we had a borrower or not
1873
    my $borrowernumber = $borrower->{'borrowernumber'} || undef;    # we don't know if we had a borrower or not
1874
1874
1875
    my $yaml = C4::Context->preference('UpdateItemLocationOnCheckin');
1875
    my $yaml_loc = C4::Context->preference('UpdateItemLocationOnCheckin');
1876
    if ($yaml) {
1876
    if ($yaml_loc) {
1877
        $yaml = "$yaml\n\n";  # YAML is strict on ending \n. Surplus does not hurt
1877
        $yaml_loc = "$yaml_loc\n\n";  # YAML is strict on ending \n. Surplus does not hurt
1878
        my $rules;
1878
        my $rules;
1879
        eval { $rules = YAML::Load($yaml); };
1879
        eval { $rules = YAML::Load($yaml_loc); };
1880
        if ($@) {
1880
        if ($@) {
1881
            warn "Unable to parse UpdateItemLocationOnCheckin syspref : $@";
1881
            warn "Unable to parse UpdateItemLocationOnCheckin syspref : $@";
1882
        }
1882
        }
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-1 lines)
Lines 583-589 $(document).ready(function () { Link Here
583
            <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% itembarcode |html %]: [% title |html %]</a></p>
583
            <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% itembarcode |html %]: [% title |html %]</a></p>
584
        [% END %]
584
        [% END %]
585
        [% FOREACH errmsgloo IN errmsgloop %]
585
        [% FOREACH errmsgloo IN errmsgloop %]
586
<<<<<<< HEAD
587
            [% IF ( errmsgloo.NotForLoanStatusUpdated ) %]
586
            [% IF ( errmsgloo.NotForLoanStatusUpdated ) %]
588
                <p class="problem">
587
                <p class="problem">
589
                    Not for loan status updated.
588
                    Not for loan status updated.
(-)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