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

(-)a/C4/Circulation.pm (+19 lines)
Lines 1852-1857 sub AddReturn { Link Here
1852
1852
1853
    my $borrowernumber = $borrower->{'borrowernumber'} || undef;    # we don't know if we had a borrower or not
1853
    my $borrowernumber = $borrower->{'borrowernumber'} || undef;    # we don't know if we had a borrower or not
1854
1854
1855
    my $yaml = C4::Context->preference('UpdateItemLocationOnCheckin');
1856
    if ($yaml) {
1857
        $yaml = "$yaml\n\n";  # YAML is anal on ending \n. Surplus does not hurt
1858
        my $rules;
1859
        eval { $rules = YAML::Load($yaml); };
1860
        if ($@) {
1861
            warn "Unable to parse UpdateItemLocationOnCheckin syspref : $@";
1862
        }
1863
        else {
1864
            foreach my $key ( keys %$rules ) {
1865
                if ( $item->{location} eq $key ) {
1866
                    $messages->{'ItemLocationUpdated'} = { from => $item->{location}, to => $rules->{$key} };
1867
                    ModItem( { location => $rules->{$key} }, undef, $itemnumber );
1868
                    last;
1869
                }
1870
            }
1871
        }
1872
    }
1873
1855
    my $yaml = C4::Context->preference('UpdateNotForLoanStatusOnCheckin');
1874
    my $yaml = C4::Context->preference('UpdateNotForLoanStatusOnCheckin');
1856
    if ($yaml) {
1875
    if ($yaml) {
1857
        $yaml = "$yaml\n\n";  # YAML is anal on ending \n. Surplus does not hurt
1876
        $yaml = "$yaml\n\n";  # YAML is anal on ending \n. Surplus does not hurt
(-)a/circ/returns.pl (+3 lines)
Lines 523-528 foreach my $code ( keys %$messages ) { Link Here
523
    elsif ( $code eq 'ForeverDebarred' ) {
523
    elsif ( $code eq 'ForeverDebarred' ) {
524
        $err{foreverdebarred}        = $messages->{'ForeverDebarred'};
524
        $err{foreverdebarred}        = $messages->{'ForeverDebarred'};
525
    }
525
    }
526
    elsif ( $code eq 'ItemLocationUpdated' ) {
527
        $err{ItemLocationUpdated} = $messages->{ItemLocationUpdated};
528
    }
526
    elsif ( $code eq 'NotForLoanStatusUpdated' ) {
529
    elsif ( $code eq 'NotForLoanStatusUpdated' ) {
527
        $err{NotForLoanStatusUpdated} = $messages->{NotForLoanStatusUpdated};
530
        $err{NotForLoanStatusUpdated} = $messages->{NotForLoanStatusUpdated};
528
    }
531
    }
(-)a/installer/data/mysql/atomicupdate/bug_14576-add_UpdateItemLocationOnCheckin_syspref.sql (+1 lines)
Line 0 Link Here
1
INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES('UpdateItemLocationOnCheckin', '', 'NULL', 'This a list of value pairs. When an item is checked in, if the location value on the left matches the items location value it will be updated to the right-hand value. E.g. ''PROC: FIC'' will cause an item that was set to ''Book Cart'' to now be in the ''Fiction'' shelving location. Each pair of values should be on a separate line.', 'Free');
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 482-487 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
482
('UNIMARCAuthorsFacetsSeparator',', ',NULL,'UNIMARC authors facets separator','short'),
482
('UNIMARCAuthorsFacetsSeparator',', ',NULL,'UNIMARC authors facets separator','short'),
483
('UNIMARCField100Language','fre',NULL,'UNIMARC field 100 default language','short'),
483
('UNIMARCField100Language','fre',NULL,'UNIMARC field 100 default language','short'),
484
('UniqueItemFields','barcode','','Space-separated list of fields that should be unique (used in acquisition module for item creation). Fields must be valid SQL column names of items table','Free'),
484
('UniqueItemFields','barcode','','Space-separated list of fields that should be unique (used in acquisition module for item creation). Fields must be valid SQL column names of items table','Free'),
485
('UpdateItemLocationOnCheckin', '', 'NULL', 'This is a list of value pairs. When an item is checked in, if the location value on the left matches the items location value it will be updated to the right-hand value. E.g. ''PROC: FIC'' will cause an item that was set to ''Book Cart'' to now be in the ''Fiction'' shelving location. Each pair of values should be on a separate line.', 'Free'),
485
('UpdateNotForLoanStatusOnCheckin', '', 'NULL', 'This is a list of value pairs. When an item is checked in, if the not for loan value on the left matches the items not for loan value it will be updated to the right-hand value. E.g. ''-1: 0'' will cause an item that was set to ''Ordered'' to now be available for loan. Each pair of values should be on a separate line.', 'Free'),
486
('UpdateNotForLoanStatusOnCheckin', '', 'NULL', 'This is a list of value pairs. When an item is checked in, if the not for loan value on the left matches the items not for loan value it will be updated to the right-hand value. E.g. ''-1: 0'' will cause an item that was set to ''Ordered'' to now be available for loan. Each pair of values should be on a separate line.', 'Free'),
486
('UpdateTotalIssuesOnCirc','0',NULL,'Whether to update the totalissues field in the biblio on each circ.','YesNo'),
487
('UpdateTotalIssuesOnCirc','0',NULL,'Whether to update the totalissues field in the biblio on each circ.','YesNo'),
487
('uppercasesurnames','0',NULL,'If ON, surnames are converted to upper case in patron entry form','YesNo'),
488
('uppercasesurnames','0',NULL,'If ON, surnames are converted to upper case in patron entry form','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (+7 lines)
Lines 423-428 Circulation: Link Here
423
            - calculate and update overdue charges when an item is returned.
423
            - calculate and update overdue charges when an item is returned.
424
            - <br /><b>NOTE If you are doing hourly loans then you should have this on.</b>
424
            - <br /><b>NOTE If you are doing hourly loans then you should have this on.</b>
425
        -
425
        -
426
            - pref: UpdateItemLocationOnCheckin
427
              type: textarea
428
              class: code
429
            - This is is a list of value pairs. When an item is checked in, if the location value on the left matches the items location value
430
            - "it will be updated to the right-hand value. E.g. ''PROC: FIC'' will cause an item that was set to ''Book Cart'' to now be in the ''Fiction'' shelving location. "
431
            - Each pair of values should be on a separate line.
432
        -
426
            - pref: UpdateNotForLoanStatusOnCheckin
433
            - pref: UpdateNotForLoanStatusOnCheckin
427
              type: textarea
434
              type: textarea
428
              class: code
435
              class: code
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-1 / +13 lines)
Lines 426-431 $(document).ready(function () { Link Here
426
                            [% END %]
426
                            [% END %]
427
                        </p>
427
                        </p>
428
                    [% END %]
428
                    [% END %]
429
                    [% IF ( errmsgloo.ItemLocationUpdated ) %]
430
                        <p class="problem">
431
                            Item location updated
432
                            from
433
                            [% IF errmsgloo.ItemLocationUpdated.from %]
434
                                [% AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.from ) %]
435
                            [% END %]
436
                            to
437
                            [% IF errmsgloo.ItemLocationUpdated.to %]
438
                                [% AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.to ) %]
439
                            [% END %]
440
                        </p>
441
                    [% END %]
429
                    [% IF ( errmsgloo.badbarcode ) %]
442
                    [% IF ( errmsgloo.badbarcode ) %]
430
                        <p class="problem">No item with barcode: [% errmsgloo.msg %]</p>
443
                        <p class="problem">No item with barcode: [% errmsgloo.msg %]</p>
431
                    [% END %]
444
                    [% END %]
432
- 

Return to bug 14576