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

(-)a/C4/Circulation.pm (+19 lines)
Lines 1727-1732 sub AddReturn { Link Here
1727
1727
1728
    my $borrowernumber = $borrower->{'borrowernumber'} || undef;    # we don't know if we had a borrower or not
1728
    my $borrowernumber = $borrower->{'borrowernumber'} || undef;    # we don't know if we had a borrower or not
1729
1729
1730
    my $yaml = C4::Context->preference('UpdateNotForLoanStatusOnCheckin');
1731
    if ($yaml) {
1732
        $yaml = "$yaml\n\n";  # YAML is anal on ending \n. Surplus does not hurt
1733
        my $rules;
1734
        eval { $rules = YAML::Load($yaml); };
1735
        if ($@) {
1736
            warn "Unable to parse UpdateNotForLoanStatusOnCheckin syspref : $@";
1737
        }
1738
        else {
1739
            foreach my $key ( keys %$rules ) {
1740
                if ( $item->{notforloan} eq $key ) {
1741
                    ModItem( { notforloan => $rules->{$key} }, undef, $itemnumber );
1742
                    last;
1743
                }
1744
            }
1745
        }
1746
    }
1747
1748
1730
    # check if the book is in a permanent collection....
1749
    # check if the book is in a permanent collection....
1731
    # FIXME -- This 'PE' attribute is largely undocumented.  afaict, there's no user interface that reflects this functionality.
1750
    # FIXME -- This 'PE' attribute is largely undocumented.  afaict, there's no user interface that reflects this functionality.
1732
    if ( $hbr ) {
1751
    if ( $hbr ) {
(-)a/installer/data/mysql/sysprefs.sql (+2 lines)
Lines 397-403 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
397
('TrackClicks','0',NULL,'Track links clicked','Integer'),
397
('TrackClicks','0',NULL,'Track links clicked','Integer'),
398
('TransfersMaxDaysWarning','3',NULL,'Define the days before a transfer is suspected of having a problem','Integer'),
398
('TransfersMaxDaysWarning','3',NULL,'Define the days before a transfer is suspected of having a problem','Integer'),
399
('TransferWhenCancelAllWaitingHolds','0',NULL,'Transfer items when cancelling all waiting holds','YesNo'),
399
('TransferWhenCancelAllWaitingHolds','0',NULL,'Transfer items when cancelling all waiting holds','YesNo'),
400
('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'),
400
('UNIMARCAuthorityField100','afrey50      ba0',NULL,'Define the contents of UNIMARC authority control field 100 position 08-35','Textarea'),
401
('UNIMARCAuthorityField100','afrey50      ba0',NULL,'Define the contents of UNIMARC authority control field 100 position 08-35','Textarea'),
402
('UNIMARCAuthorityField100','afrey50      ba0',NULL,NULL,'Textarea'),
401
('UNIMARCAuthorsFacetsSeparator',', ',NULL,'UNIMARC authors facets separator','short'),
403
('UNIMARCAuthorsFacetsSeparator',', ',NULL,'UNIMARC authors facets separator','short'),
402
('UNIMARCField100Language','fre',NULL,'UNIMARC field 100 default language','short'),
404
('UNIMARCField100Language','fre',NULL,'UNIMARC field 100 default language','short'),
403
('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'),
405
('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 8129-8134 if(CheckVersion($DBversion)) { Link Here
8129
    SetVersion($DBversion);
8129
    SetVersion($DBversion);
8130
}
8130
}
8131
8131
8132
$DBversion = "3.15.00.XXX";
8133
if (CheckVersion($DBversion)) {
8134
    $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');");
8135
    print "Upgrade to $DBversion done (Bug 11629 - Add ability to update not for loan status on checkin)\n";
8136
    SetVersion($DBversion);
8137
}
8138
8132
=head1 FUNCTIONS
8139
=head1 FUNCTIONS
8133
8140
8134
=head2 TableExists($table)
8141
=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