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 205-210 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
205
('IdRef','0','','Disable/enable the IdRef webservice from the OPAC detail page.','YesNo'),
205
('IdRef','0','','Disable/enable the IdRef webservice from the OPAC detail page.','YesNo'),
206
('ILLModule','0','If ON, enables the interlibrary loans module.','','YesNo'),
206
('ILLModule','0','If ON, enables the interlibrary loans module.','','YesNo'),
207
('ILLModuleCopyrightClearance','','70|10','Enter text to enable the copyright clearance stage of request creation. Text will be displayed','Textarea'),
207
('ILLModuleCopyrightClearance','','70|10','Enter text to enable the copyright clearance stage of request creation. Text will be displayed','Textarea'),
208
('ILLOpacbackends',NULL,NULL,'ILL backends to enabled for OPAC initiated requests','multiple'),
208
('ILS-DI','0','','Enables ILS-DI services at OPAC.','YesNo'),
209
('ILS-DI','0','','Enables ILS-DI services at OPAC.','YesNo'),
209
('ILS-DI:AuthorizedIPs','','Restricts usage of ILS-DI to some IPs','.','Free'),
210
('ILS-DI:AuthorizedIPs','','Restricts usage of ILS-DI to some IPs','.','Free'),
210
('ImageLimit','5','','Limit images stored in the database by the Patron Card image manager to this number.','Integer'),
211
('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 745-750 Circulation: Link Here
745
            - pref: ILLModuleCopyrightClearance
745
            - pref: ILLModuleCopyrightClearance
746
              type: textarea
746
              type: textarea
747
              class: long
747
              class: long
748
        -
749
            - "ILL backends to enabled for OPAC initiated requests:"
750
            - pref: ILLOpacbackends
751
              class: multi
752
            - (separated with |).
748
    Fines Policy:
753
    Fines Policy:
749
        -
754
        -
750
            - Calculate fines based on days overdue
755
            - 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