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

(-)a/Koha/Biblio.pm (+1 lines)
Lines 835-840 sub host_record { Link Here
835
    my ($self, $params) = @_;
835
    my ($self, $params) = @_;
836
    my $no_items = $params->{no_items};
836
    my $no_items = $params->{no_items};
837
    return if C4::Context->preference('marcflavour') eq 'UNIMARC'; # TODO
837
    return if C4::Context->preference('marcflavour') eq 'UNIMARC'; # TODO
838
    return if !C4::Context->preference('ArticleRequestsHostRedirection');
838
    return if $params->{no_items} && $self->items->count > 0;
839
    return if $params->{no_items} && $self->items->count > 0;
839
840
840
    my $record;
841
    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/sysprefs.sql (+1 lines)
Lines 56-61 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
56
('AnonSuggestions','0',NULL,'Set to enable Anonymous suggestions to AnonymousPatron borrowernumber','YesNo'),
56
('AnonSuggestions','0',NULL,'Set to enable Anonymous suggestions to AnonymousPatron borrowernumber','YesNo'),
57
('AnonymousPatron','0',NULL,'Set the identifier (borrowernumber) of the anonymous patron. Used for Suggestion and reading history privacy',''),
57
('AnonymousPatron','0',NULL,'Set the identifier (borrowernumber) of the anonymous patron. Used for Suggestion and reading history privacy',''),
58
('ArticleRequests', '0', NULL, 'Enables the article request feature', 'YesNo'),
58
('ArticleRequests', '0', NULL, 'Enables the article request feature', 'YesNo'),
59
('ArticleRequestsHostRedirection', '0', NULL, 'Enables redirection from child to host', 'YesNo'),
59
('ArticleRequestsLinkControl', 'calc', 'always|calc', 'Control display of article request link on search results', 'Choice'),
60
('ArticleRequestsLinkControl', 'calc', 'always|calc', 'Control display of article request link on search results', 'Choice'),
60
('ArticleRequestsMandatoryFields', '', NULL, 'Comma delimited list of required fields for bibs where article requests rule = ''yes''', 'multiple'),
61
('ArticleRequestsMandatoryFields', '', NULL, 'Comma delimited list of required fields for bibs where article requests rule = ''yes''', 'multiple'),
61
('ArticleRequestsMandatoryFieldsItemsOnly', '', NULL, 'Comma delimited list of required fields for bibs where article requests rule = ''item_only''', 'multiple'),
62
('ArticleRequestsMandatoryFieldsItemsOnly', '', 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 1131-1136 Circulation: Link Here
1131
                  no: "Don't enable"
1131
                  no: "Don't enable"
1132
            - patrons to place article requests.
1132
            - patrons to place article requests.
1133
        -
1133
        -
1134
            - pref: ArticleRequestsHostRedirection
1135
              choices:
1136
                  yes: Enable
1137
                  no: Disable
1138
            - " redirection from child to host based on MARC21 773$w when the child has no items."
1139
        -
1134
            - pref: ArticleRequestsLinkControl
1140
            - pref: ArticleRequestsLinkControl
1135
              choices:
1141
              choices:
1136
                  always: Always show
1142
                  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