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

(-)a/C4/Circulation.pm (+19 lines)
Lines 1755-1760 sub AddReturn { Link Here
1755
1755
1756
    my $borrowernumber = $borrower->{'borrowernumber'} || undef;    # we don't know if we had a borrower or not
1756
    my $borrowernumber = $borrower->{'borrowernumber'} || undef;    # we don't know if we had a borrower or not
1757
1757
1758
    my $yaml = C4::Context->preference('UpdateNotForLoanStatusOnCheckin');
1759
    if ($yaml) {
1760
        $yaml = "$yaml\n\n";  # YAML is anal on ending \n. Surplus does not hurt
1761
        my $rules;
1762
        eval { $rules = YAML::Load($yaml); };
1763
        if ($@) {
1764
            warn "Unable to parse UpdateNotForLoanStatusOnCheckin syspref : $@";
1765
        }
1766
        else {
1767
            foreach my $key ( keys %$rules ) {
1768
                if ( $item->{notforloan} eq $key ) {
1769
                    ModItem( { notforloan => $rules->{$key} }, undef, $itemnumber );
1770
                    last;
1771
                }
1772
            }
1773
        }
1774
    }
1775
1776
1758
    # check if the book is in a permanent collection....
1777
    # check if the book is in a permanent collection....
1759
    # FIXME -- This 'PE' attribute is largely undocumented.  afaict, there's no user interface that reflects this functionality.
1778
    # FIXME -- This 'PE' attribute is largely undocumented.  afaict, there's no user interface that reflects this functionality.
1760
    if ( $hbr ) {
1779
    if ( $hbr ) {
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 395-400 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
395
('TrackClicks','0',NULL,'Track links clicked','Integer'),
395
('TrackClicks','0',NULL,'Track links clicked','Integer'),
396
('TransfersMaxDaysWarning','3',NULL,'Define the days before a transfer is suspected of having a problem','Integer'),
396
('TransfersMaxDaysWarning','3',NULL,'Define the days before a transfer is suspected of having a problem','Integer'),
397
('TransferWhenCancelAllWaitingHolds','0',NULL,'Transfer items when cancelling all waiting holds','YesNo'),
397
('TransferWhenCancelAllWaitingHolds','0',NULL,'Transfer items when cancelling all waiting holds','YesNo'),
398
('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'),
398
('UNIMARCAuthorityField100','afrey50      ba0',NULL,NULL,'Textarea'),
399
('UNIMARCAuthorityField100','afrey50      ba0',NULL,NULL,'Textarea'),
399
('UNIMARCAuthorsFacetsSeparator',', ',NULL,'UNIMARC authors facets separator','short'),
400
('UNIMARCAuthorsFacetsSeparator',', ',NULL,'UNIMARC authors facets separator','short'),
400
('UNIMARCField100Language','fre',NULL,'UNIMARC field 100 default language','short'),
401
('UNIMARCField100Language','fre',NULL,'UNIMARC field 100 default language','short'),
(-)a/installer/data/mysql/updatedatabase.pl (+7 lines)
Lines 7945-7950 if (CheckVersion($DBversion)) { Link Here
7945
    SetVersion($DBversion);
7945
    SetVersion($DBversion);
7946
}
7946
}
7947
7947
7948
$DBversion = "3.15.00.XXX";
7949
if (CheckVersion($DBversion)) {
7950
    $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('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');");
7951
    print "Upgrade to $DBversion done (Bug 11629 - Add ability to update not for loan status on checkin)\n";
7952
    SetVersion($DBversion);
7953
}
7954
7948
=head1 FUNCTIONS
7955
=head1 FUNCTIONS
7949
7956
7950
=head2 TableExists($table)
7957
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-1 / +7 lines)
Lines 351-356 Circulation: Link Here
351
                  no: "Don't"
351
                  no: "Don't"
352
            - calculate and update overdue charges when an item is returned.
352
            - calculate and update overdue charges when an item is returned.
353
            - <br /><b>NOTE If you are doing hourly loans then you should have this on.</b>
353
            - <br /><b>NOTE If you are doing hourly loans then you should have this on.</b>
354
        -
355
            - pref: UpdateNotForLoanStatusOnCheckin 
356
              type: textarea
357
              class: code
358
            - 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
359
            - "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."
360
            - Each pair of values should be on a separate line.
354
    Holds Policy:
361
    Holds Policy:
355
        -
362
        -
356
            - pref: AllowHoldPolicyOverride
363
            - pref: AllowHoldPolicyOverride
357
- 

Return to bug 11629