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

(-)a/C4/Circulation.pm (+19 lines)
Lines 1756-1761 sub AddReturn { Link Here
1756
1756
1757
    my $borrowernumber = $borrower->{'borrowernumber'} || undef;    # we don't know if we had a borrower or not
1757
    my $borrowernumber = $borrower->{'borrowernumber'} || undef;    # we don't know if we had a borrower or not
1758
1758
1759
    my $yaml = C4::Context->preference('UpdateNotForLoanStatusOnCheckin');
1760
    if ($yaml) {
1761
        $yaml = "$yaml\n\n";  # YAML is anal on ending \n. Surplus does not hurt
1762
        my $rules;
1763
        eval { $rules = YAML::Load($yaml); };
1764
        if ($@) {
1765
            warn "Unable to parse UpdateNotForLoanStatusOnCheckin syspref : $@";
1766
        }
1767
        else {
1768
            foreach my $key ( keys %$rules ) {
1769
                if ( $item->{notforloan} eq $key ) {
1770
                    ModItem( { notforloan => $rules->{$key} }, undef, $itemnumber );
1771
                    last;
1772
                }
1773
            }
1774
        }
1775
    }
1776
1777
1759
    # check if the book is in a permanent collection....
1778
    # check if the book is in a permanent collection....
1760
    # FIXME -- This 'PE' attribute is largely undocumented.  afaict, there's no user interface that reflects this functionality.
1779
    # FIXME -- This 'PE' attribute is largely undocumented.  afaict, there's no user interface that reflects this functionality.
1761
    if ( $hbr ) {
1780
    if ( $hbr ) {
(-)a/installer/data/mysql/sysprefs.sql (+2 lines)
Lines 408-414 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
408
('TrackClicks','0',NULL,'Track links clicked','Integer'),
408
('TrackClicks','0',NULL,'Track links clicked','Integer'),
409
('TransfersMaxDaysWarning','3',NULL,'Define the days before a transfer is suspected of having a problem','Integer'),
409
('TransfersMaxDaysWarning','3',NULL,'Define the days before a transfer is suspected of having a problem','Integer'),
410
('TransferWhenCancelAllWaitingHolds','0',NULL,'Transfer items when cancelling all waiting holds','YesNo'),
410
('TransferWhenCancelAllWaitingHolds','0',NULL,'Transfer items when cancelling all waiting holds','YesNo'),
411
('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'),
411
('UNIMARCAuthorityField100','afrey50      ba0',NULL,'Define the contents of UNIMARC authority control field 100 position 08-35','Textarea'),
412
('UNIMARCAuthorityField100','afrey50      ba0',NULL,'Define the contents of UNIMARC authority control field 100 position 08-35','Textarea'),
413
('UNIMARCAuthorityField100','afrey50      ba0',NULL,NULL,'Textarea'),
412
('UNIMARCAuthorsFacetsSeparator',', ',NULL,'UNIMARC authors facets separator','short'),
414
('UNIMARCAuthorsFacetsSeparator',', ',NULL,'UNIMARC authors facets separator','short'),
413
('UNIMARCField100Language','fre',NULL,'UNIMARC field 100 default language','short'),
415
('UNIMARCField100Language','fre',NULL,'UNIMARC field 100 default language','short'),
414
('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'),
416
('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 8465-8470 if ( CheckVersion($DBversion) ) { Link Here
8465
    SetVersion($DBversion);
8465
    SetVersion($DBversion);
8466
}
8466
}
8467
8467
8468
$DBversion = "3.15.00.XXX";
8469
if (CheckVersion($DBversion)) {
8470
    $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');");
8471
    print "Upgrade to $DBversion done (Bug 11629 - Add ability to update not for loan status on checkin)\n";
8472
    SetVersion($DBversion);
8473
}
8474
8468
=head1 FUNCTIONS
8475
=head1 FUNCTIONS
8469
8476
8470
=head2 TableExists($table)
8477
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-1 / +7 lines)
Lines 363-368 Circulation: Link Here
363
                  no: "Don't"
363
                  no: "Don't"
364
            - calculate and update overdue charges when an item is returned.
364
            - calculate and update overdue charges when an item is returned.
365
            - <br /><b>NOTE If you are doing hourly loans then you should have this on.</b>
365
            - <br /><b>NOTE If you are doing hourly loans then you should have this on.</b>
366
        -
367
            - pref: UpdateNotForLoanStatusOnCheckin
368
              type: textarea
369
              class: code
370
            - 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
371
            - "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."
372
            - Each pair of values should be on a separate line.
366
    Holds Policy:
373
    Holds Policy:
367
        -
374
        -
368
            - pref: AllowHoldPolicyOverride
375
            - pref: AllowHoldPolicyOverride
369
- 

Return to bug 11629