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 1124-1129 Circulation: Link Here
1124
                  no: "Don't enable"
1124
                  no: "Don't enable"
1125
            - patrons to place article requests.
1125
            - patrons to place article requests.
1126
        -
1126
        -
1127
            - pref: ArticleRequestsHostRedirection
1128
              choices:
1129
                  yes: Enable
1130
                  no: Disable
1131
            - " redirection from child to host based on MARC21 773$w when the child has no items."
1132
        -
1127
            - pref: ArticleRequestsLinkControl
1133
            - pref: ArticleRequestsLinkControl
1128
              choices:
1134
              choices:
1129
                  always: Always show
1135
                  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