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

(-)a/C4/XSLT.pm (-1 / +1 lines)
Lines 316-322 sub buildKohaItemsNamespace { Link Here
316
    my $itemtypes = { map { $_->{itemtype} => $_ } @{ Koha::ItemTypes->search->unblessed } };
316
    my $itemtypes = { map { $_->{itemtype} => $_ } @{ Koha::ItemTypes->search->unblessed } };
317
    my $xml = '';
317
    my $xml = '';
318
    my %descs = map { $_->{authorised_value} => $_ } Koha::AuthorisedValues->get_descriptions_by_koha_field( { kohafield => 'items.notforloan' } );
318
    my %descs = map { $_->{authorised_value} => $_ } Koha::AuthorisedValues->get_descriptions_by_koha_field( { kohafield => 'items.notforloan' } );
319
    my $ref_status = C4::Context->preference('Available_NFL') || '1|2';
319
    my $ref_status = C4::Context->preference('Reference_NFL_Statuses') || '1|2';
320
320
321
    for my $item (@items) {
321
    for my $item (@items) {
322
        my $status;
322
        my $status;
(-)a/installer/data/mysql/atomicupdate/bug21260.perl (+8 lines)
Line 0 Link Here
1
$DBversion = 'XXX';
2
if( CheckVersion( $DBversion ) ) {
3
    $dbh->do(q{
4
        INSERT IGNORE INTO systempreferences (variable, value, explanation, options, type)
5
        VALUES ('Reference_NFL_Statuses','1|2',NULL,'Contains not for loan statuses considered as available for reference','Free')
6
    });
7
    NewVersion( $DBversion, 21260, "Add preference Reference_NFL_Statuses");
8
}
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+1 lines)
Lines 550-555 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
550
('RandomizeHoldsQueueWeight','0',NULL,'if ON, the holds queue in circulation will be randomized, either based on all location codes, or by the location codes specified in StaticHoldsQueueWeight','YesNo'),
550
('RandomizeHoldsQueueWeight','0',NULL,'if ON, the holds queue in circulation will be randomized, either based on all location codes, or by the location codes specified in StaticHoldsQueueWeight','YesNo'),
551
('RecordStaffUserOnCheckout','0',NULL,'If ON, when an item is checked out, the user who checked out the item is recorded','YesNo'),
551
('RecordStaffUserOnCheckout','0',NULL,'If ON, when an item is checked out, the user who checked out the item is recorded','YesNo'),
552
('RecordLocalUseOnReturn','0',NULL,'If ON, statistically record returns of unissued items as local use, instead of return','YesNo'),
552
('RecordLocalUseOnReturn','0',NULL,'If ON, statistically record returns of unissued items as local use, instead of return','YesNo'),
553
('Reference_NFL_Statuses','1|2',NULL,'Contains not for loan statuses considered as available for reference','Free'),
553
('RefundLostOnReturnControl','CheckinLibrary','CheckinLibrary|ItemHomeBranch|ItemHoldingBranch','If a lost item is returned, choose which branch to pick rules for refunding.','Choice'),
554
('RefundLostOnReturnControl','CheckinLibrary','CheckinLibrary|ItemHomeBranch|ItemHoldingBranch','If a lost item is returned, choose which branch to pick rules for refunding.','Choice'),
554
('RenewAccruingItemWhenPaid','0','','If enabled, when the fines on an item accruing is paid off, attempt to renew that item. If the syspref "RenewalPeriodBase" is set to "due date", renewed items may still be overdue','YesNo'),
555
('RenewAccruingItemWhenPaid','0','','If enabled, when the fines on an item accruing is paid off, attempt to renew that item. If the syspref "RenewalPeriodBase" is set to "due date", renewed items may still be overdue','YesNo'),
555
('RenewAccruingItemInOpac','0','','If enabled, when the fines on an item accruing is paid off in the OPAC via a payment plugin, attempt to renew that item. If the syspref "RenewalPeriodBase" is set to "due date", renewed items may still be overdue','YesNo'),
556
('RenewAccruingItemInOpac','0','','If enabled, when the fines on an item accruing is paid off in the OPAC via a payment plugin, attempt to renew that item. If the syspref "RenewalPeriodBase" is set to "due date", renewed items may still be overdue','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (+4 lines)
Lines 350-355 OPAC: Link Here
350
                  top: "top"
350
                  top: "top"
351
                  footer: "only footer"
351
                  footer: "only footer"
352
            - "."
352
            - "."
353
        -
354
            - "List the following not for loan statuses as available for reference in OPAC search results:"
355
            - pref: Reference_NFL_Statuses
356
            - "(Use | as delimiter.)"
353
    Features:
357
    Features:
354
        -
358
        -
355
            - pref: OPACReportProblem
359
            - pref: OPACReportProblem
(-)a/t/db_dependent/XSLT.t (-5 / +4 lines)
Lines 36-42 $schema->storage->txn_begin; Link Here
36
subtest 'buildKohaItemsNamespace status tests' => sub {
36
subtest 'buildKohaItemsNamespace status tests' => sub {
37
    plan tests => 14;
37
    plan tests => 14;
38
38
39
    t::lib::Mocks::mock_preference('Available_NFL', '1|2');
39
    t::lib::Mocks::mock_preference('Reference_NFL_Statuses', '1|2');
40
40
41
    my $itype = $builder->build_object({ class => 'Koha::ItemTypes' });
41
    my $itype = $builder->build_object({ class => 'Koha::ItemTypes' });
42
    my $itemtype = $builder->build_object({ class => 'Koha::ItemTypes' });
42
    my $itemtype = $builder->build_object({ class => 'Koha::ItemTypes' });
Lines 73-82 subtest 'buildKohaItemsNamespace status tests' => sub { Link Here
73
        like($xml,qr{<status>reference</status>},"reference if positive notforloan value");
73
        like($xml,qr{<status>reference</status>},"reference if positive notforloan value");
74
74
75
        # But now make status notforloan==1 count under Not available
75
        # But now make status notforloan==1 count under Not available
76
        t::lib::Mocks::mock_preference('Available_NFL', '2');
76
        t::lib::Mocks::mock_preference('Reference_NFL_Statuses', '2');
77
        $xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]);
77
        $xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]);
78
        like($xml,qr{<status>reallynotforloan</status>},"reallynotforloan when we change Avaiable_NFL");
78
        like($xml,qr{<status>reallynotforloan</status>},"reallynotforloan when we change Reference_NFL_Statuses");
79
        t::lib::Mocks::mock_preference('Available_NFL', '1|2');
79
        t::lib::Mocks::mock_preference('Reference_NFL_Statuses', '1|2');
80
    }
80
    }
81
81
82
    $item->onloan('2001-01-01')->store;
82
    $item->onloan('2001-01-01')->store;
83
- 

Return to bug 21260