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 (+2 lines)
Lines 396-402 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
396
('TrackClicks','0',NULL,'Track links clicked','Integer'),
396
('TrackClicks','0',NULL,'Track links clicked','Integer'),
397
('TransfersMaxDaysWarning','3',NULL,'Define the days before a transfer is suspected of having a problem','Integer'),
397
('TransfersMaxDaysWarning','3',NULL,'Define the days before a transfer is suspected of having a problem','Integer'),
398
('TransferWhenCancelAllWaitingHolds','0',NULL,'Transfer items when cancelling all waiting holds','YesNo'),
398
('TransferWhenCancelAllWaitingHolds','0',NULL,'Transfer items when cancelling all waiting holds','YesNo'),
399
('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'),
399
('UNIMARCAuthorityField100','afrey50      ba0',NULL,'Define the contents of UNIMARC authority control field 100 position 08-35','Textarea'),
400
('UNIMARCAuthorityField100','afrey50      ba0',NULL,'Define the contents of UNIMARC authority control field 100 position 08-35','Textarea'),
401
('UNIMARCAuthorityField100','afrey50      ba0',NULL,NULL,'Textarea'),
400
('UNIMARCAuthorsFacetsSeparator',', ',NULL,'UNIMARC authors facets separator','short'),
402
('UNIMARCAuthorsFacetsSeparator',', ',NULL,'UNIMARC authors facets separator','short'),
401
('UNIMARCField100Language','fre',NULL,'UNIMARC field 100 default language','short'),
403
('UNIMARCField100Language','fre',NULL,'UNIMARC field 100 default language','short'),
402
('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'),
404
('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'),
(-)a/installer/data/mysql/updatedatabase.pl (+7 lines)
Lines 8012-8017 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
8012
    SetVersion($DBversion);
8012
    SetVersion($DBversion);
8013
}
8013
}
8014
8014
8015
$DBversion = "3.15.00.XXX";
8016
if (CheckVersion($DBversion)) {
8017
    $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');");
8018
    print "Upgrade to $DBversion done (Bug 11629 - Add ability to update not for loan status on checkin)\n";
8019
    SetVersion($DBversion);
8020
}
8021
8015
=head1 FUNCTIONS
8022
=head1 FUNCTIONS
8016
8023
8017
=head2 TableExists($table)
8024
=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