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

(-)a/Koha/Biblio.pm (+1 lines)
Lines 906-911 sub host_record { Link Here
906
    my ($self, $params) = @_;
906
    my ($self, $params) = @_;
907
    my $no_items = $params->{no_items};
907
    my $no_items = $params->{no_items};
908
    return if C4::Context->preference('marcflavour') eq 'UNIMARC'; # TODO
908
    return if C4::Context->preference('marcflavour') eq 'UNIMARC'; # TODO
909
    return if !C4::Context->preference('ArticleRequestsHostRedirection');
909
    return if $params->{no_items} && $self->items->count > 0;
910
    return if $params->{no_items} && $self->items->count > 0;
910
911
911
    my $record;
912
    my $record;
(-)a/installer/data/mysql/atomicupdate/bug_20130.perl (+8 lines)
Line 0 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    $dbh->do(q{
4
        INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
5
            ('ArticleRequestsHostRedirection', '0', NULL, 'Enables redirection from child to host', 'YesNo')
6
    });
7
    NewVersion( $DBversion, 20310, "Add pref ArticleRequestsHostRedirection");
8
}
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+1 lines)
Lines 55-60 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
55
('AnonSuggestions','0',NULL,'Set to enable Anonymous suggestions to AnonymousPatron borrowernumber','YesNo'),
55
('AnonSuggestions','0',NULL,'Set to enable Anonymous suggestions to AnonymousPatron borrowernumber','YesNo'),
56
('AnonymousPatron','0',NULL,'Set the identifier (borrowernumber) of the anonymous patron. Used for suggestion and checkout history privacy',''),
56
('AnonymousPatron','0',NULL,'Set the identifier (borrowernumber) of the anonymous patron. Used for suggestion and checkout history privacy',''),
57
('ArticleRequests', '0', NULL, 'Enables the article request feature', 'YesNo'),
57
('ArticleRequests', '0', NULL, 'Enables the article request feature', 'YesNo'),
58
('ArticleRequestsHostRedirection', '0', NULL, 'Enables redirection from child to host', 'YesNo'),
58
('ArticleRequestsLinkControl', 'calc', 'always|calc', 'Control display of article request link on search results', 'Choice'),
59
('ArticleRequestsLinkControl', 'calc', 'always|calc', 'Control display of article request link on search results', 'Choice'),
59
('ArticleRequestsMandatoryFields', '', NULL, 'Comma delimited list of required fields for bibs where article requests rule = ''yes''', 'multiple'),
60
('ArticleRequestsMandatoryFields', '', NULL, 'Comma delimited list of required fields for bibs where article requests rule = ''yes''', 'multiple'),
60
('ArticleRequestsMandatoryFieldsItemOnly', '', NULL, 'Comma delimited list of required fields for bibs where article requests rule = ''item_only''', 'multiple'),
61
('ArticleRequestsMandatoryFieldsItemOnly', '', NULL, 'Comma delimited list of required fields for bibs where article requests rule = ''item_only''', 'multiple'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (+6 lines)
Lines 1173-1178 Circulation: Link Here
1173
                  0: "Don't enable"
1173
                  0: "Don't enable"
1174
            - patrons to place article requests.
1174
            - patrons to place article requests.
1175
        -
1175
        -
1176
            - pref: ArticleRequestsHostRedirection
1177
              choices:
1178
                  yes: Enable
1179
                  no: Disable
1180
            - " redirection from child to host based on MARC21 773$w when the child has no items."
1181
        -
1176
            - pref: ArticleRequestsLinkControl
1182
            - pref: ArticleRequestsLinkControl
1177
              choices:
1183
              choices:
1178
                  always: Always show
1184
                  always: Always show
(-)a/t/db_dependent/Koha/Biblio/host_record.t (-1 / +1 lines)
Lines 40-45 subtest 'host_record' => sub { Link Here
40
40
41
    t::lib::Mocks::mock_preference( 'marcflavour', 'MARC21' );
41
    t::lib::Mocks::mock_preference( 'marcflavour', 'MARC21' );
42
    t::lib::Mocks::mock_preference( 'MARCOrgCode', 'xyz' );
42
    t::lib::Mocks::mock_preference( 'MARCOrgCode', 'xyz' );
43
    t::lib::Mocks::mock_preference( 'ArticleRequestsHostRedirection', 1 );
43
44
44
    my $bib1 = $builder->build_object({ class => 'Koha::Biblios' });
45
    my $bib1 = $builder->build_object({ class => 'Koha::Biblios' });
45
    my $bib2 = $builder->build_object({ class => 'Koha::Biblios' });
46
    my $bib2 = $builder->build_object({ class => 'Koha::Biblios' });
46
- 

Return to bug 20310