Lines 18-33
package Koha::Illrequest;
Link Here
|
18 |
# Koha; if not, write to the Free Software Foundation, Inc., 51 Franklin |
18 |
# Koha; if not, write to the Free Software Foundation, Inc., 51 Franklin |
19 |
# Street, Fifth Floor, Boston, MA 02110-1301 USA. |
19 |
# Street, Fifth Floor, Boston, MA 02110-1301 USA. |
20 |
|
20 |
|
|
|
21 |
use Modern::Perl; |
22 |
|
21 |
use Clone 'clone'; |
23 |
use Clone 'clone'; |
22 |
use File::Basename qw/basename/; |
24 |
use File::Basename qw/basename/; |
23 |
use Koha::Database; |
25 |
use Koha::Database; |
24 |
use Koha::Email; |
26 |
use Koha::Email; |
|
|
27 |
use Koha::Exceptions::Ill; |
25 |
use Koha::Illrequest; |
28 |
use Koha::Illrequest; |
26 |
use Koha::Illrequestattributes; |
29 |
use Koha::Illrequestattributes; |
27 |
use Koha::Patron; |
30 |
use Koha::Patron; |
28 |
use Mail::Sendmail; |
31 |
use Mail::Sendmail; |
29 |
use Try::Tiny; |
32 |
use Try::Tiny; |
30 |
use Modern::Perl; |
|
|
31 |
|
33 |
|
32 |
use base qw(Koha::Object); |
34 |
use base qw(Koha::Object); |
33 |
|
35 |
|
Lines 139-151
sub load_backend {
Link Here
|
139 |
my @raw = qw/Koha Illbackends/; # Base Path |
141 |
my @raw = qw/Koha Illbackends/; # Base Path |
140 |
|
142 |
|
141 |
my $backend_name = $backend_id || $self->backend; |
143 |
my $backend_name = $backend_id || $self->backend; |
142 |
my $location = join "/", @raw, $backend_name, "Base.pm"; # File to load |
144 |
|
|
|
145 |
unless ( defined $backend_id && $backend_id ne '' ) { |
146 |
Koha::Exceptions::Ill::InvalidBackendId->throw( |
147 |
"An invalid backend ID was requested ('')"); |
148 |
} |
149 |
|
150 |
my $location = join "/", @raw, $backend_name, "Base.pm"; # File to load |
143 |
my $backend_class = join "::", @raw, $backend_name, "Base"; # Package name |
151 |
my $backend_class = join "::", @raw, $backend_name, "Base"; # Package name |
144 |
require $location; |
152 |
require $location; |
145 |
$self->{_my_backend} = $backend_class->new({ config => $self->_config }); |
153 |
$self->{_my_backend} = $backend_class->new({ config => $self->_config }); |
146 |
return $self; |
154 |
return $self; |
147 |
} |
155 |
} |
148 |
|
156 |
|
|
|
157 |
|
149 |
=head3 _backend |
158 |
=head3 _backend |
150 |
|
159 |
|
151 |
my $backend = $abstract->_backend($new_backend); |
160 |
my $backend = $abstract->_backend($new_backend); |
Lines 468-477
Return a list of available backends.
Link Here
|
468 |
|
477 |
|
469 |
sub available_backends { |
478 |
sub available_backends { |
470 |
my ( $self ) = @_; |
479 |
my ( $self ) = @_; |
471 |
my $backend_dir = $self->_config->backend_dir; |
480 |
my @backends = $self->_config->available_backends; |
472 |
my @backends = (); |
|
|
473 |
@backends = glob "$backend_dir/*" if ( $backend_dir ); |
474 |
@backends = map { basename($_) } @backends; |
475 |
return \@backends; |
481 |
return \@backends; |
476 |
} |
482 |
} |
477 |
|
483 |
|