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

(-)a/Koha/Illrequest/Config.pm (-2 / +7 lines)
Lines 104-119 sub backend_dir { Link Here
104
104
105
=head3 available_backends
105
=head3 available_backends
106
106
107
Return a list of available backends.
107
  $backends = $config->available_backends;
108
  $backends = $config->abailable_backends($reduced);
109
110
Return a list of available backends, if passed a | delimited list it
111
will filter those backends down to only those present in the list.
108
112
109
=cut
113
=cut
110
114
111
sub available_backends {
115
sub available_backends {
112
    my ( $self ) = @_;
116
    my ( $self, $reduce ) = @_;
113
    my $backend_dir = $self->backend_dir;
117
    my $backend_dir = $self->backend_dir;
114
    my @backends = ();
118
    my @backends = ();
115
    @backends = glob "$backend_dir/*" if ( $backend_dir );
119
    @backends = glob "$backend_dir/*" if ( $backend_dir );
116
    @backends = map { basename($_) } @backends;
120
    @backends = map { basename($_) } @backends;
121
    @backends = grep { $_ =~ /$reduce/ } @backends if $reduce;
117
    return \@backends;
122
    return \@backends;
118
}
123
}
119
124
(-)a/installer/data/mysql/atomicupdate/bug_20639-add_ILLOpacbackends_syspref.perl (+11 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,explanation,options,type)
5
      VALUES ('ILLOpacbackends',NULL,NULL,'ILL backends to enabled for OPAC initiated requests','multiple');
6
    |);
7
8
    # Always end with this (adjust the bug info)
9
    SetVersion( $DBversion );
10
    print "Upgrade to $DBversion done (Bug 20639 - Add ILLOpacbackends syspref)\n";
11
}
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 218-223 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
218
('IdRef','0','','Disable/enable the IdRef webservice from the OPAC detail page.','YesNo'),
218
('IdRef','0','','Disable/enable the IdRef webservice from the OPAC detail page.','YesNo'),
219
('ILLModule','0','If ON, enables the interlibrary loans module.','','YesNo'),
219
('ILLModule','0','If ON, enables the interlibrary loans module.','','YesNo'),
220
('ILLModuleCopyrightClearance','','70|10','Enter text to enable the copyright clearance stage of request creation. Text will be displayed','Textarea'),
220
('ILLModuleCopyrightClearance','','70|10','Enter text to enable the copyright clearance stage of request creation. Text will be displayed','Textarea'),
221
('ILLOpacbackends',NULL,NULL,'ILL backends to enabled for OPAC initiated requests','multiple'),
221
('ILS-DI','0','','Enables ILS-DI services at OPAC.','YesNo'),
222
('ILS-DI','0','','Enables ILS-DI services at OPAC.','YesNo'),
222
('ILS-DI:AuthorizedIPs','','Restricts usage of ILS-DI to some IPs','.','Free'),
223
('ILS-DI:AuthorizedIPs','','Restricts usage of ILS-DI to some IPs','.','Free'),
223
('ImageLimit','5','','Limit images stored in the database by the Patron Card image manager to this number.','Integer'),
224
('ImageLimit','5','','Limit images stored in the database by the Patron Card image manager to this number.','Integer'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (+5 lines)
Lines 796-801 Circulation: Link Here
796
            - pref: ILLModuleCopyrightClearance
796
            - pref: ILLModuleCopyrightClearance
797
              type: textarea
797
              type: textarea
798
              class: long
798
              class: long
799
        -
800
            - "ILL backends to enabled for OPAC initiated requests:"
801
            - pref: ILLOpacbackends
802
              class: multi
803
            - (separated with |).
799
    Fines Policy:
804
    Fines Policy:
800
        -
805
        -
801
            - Calculate fines based on days overdue
806
            - Calculate fines based on days overdue
(-)a/opac/opac-illrequests.pl (-2 / +2 lines)
Lines 50-56 my ( $template, $loggedinuser, $cookie ) = get_template_and_user({ Link Here
50
});
50
});
51
51
52
# Are we able to actually work?
52
# Are we able to actually work?
53
my $backends = Koha::Illrequest::Config->new->available_backends;
53
my $reduced  = C4::Context->preference('ILLOpacbackends');
54
my $backends = Koha::Illrequest::Config->new->available_backends($reduced);
54
my $backends_available = ( scalar @{$backends} > 0 );
55
my $backends_available = ( scalar @{$backends} > 0 );
55
$template->param( backends_available => $backends_available );
56
$template->param( backends_available => $backends_available );
56
57
57
- 

Return to bug 20639