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 138-151
sub load_backend {
Link Here
|
138 |
|
140 |
|
139 |
my @raw = qw/Koha Illbackends/; # Base Path |
141 |
my @raw = qw/Koha Illbackends/; # Base Path |
140 |
|
142 |
|
|
|
143 |
unless ( defined $backend_id && $backend_id ne '' ) { |
144 |
Koha::Exceptions::Ill::InvalidBackendId->throw( |
145 |
"An invalid backend ID was requested ('')"); |
146 |
} |
147 |
|
141 |
my $backend_name = $backend_id || $self->backend; |
148 |
my $backend_name = $backend_id || $self->backend; |
142 |
my $location = join "/", @raw, $backend_name, "Base.pm"; # File to load |
149 |
my $location = join "/", @raw, $backend_name, "Base.pm"; # File to load |
143 |
my $backend_class = join "::", @raw, $backend_name, "Base"; # Package name |
150 |
my $backend_class = join "::", @raw, $backend_name, "Base"; # Package name |
144 |
require $location; |
151 |
require $location; |
145 |
$self->{_my_backend} = $backend_class->new({ config => $self->_config }); |
152 |
$self->{_my_backend} = $backend_class->new({ config => $self->_config }); |
146 |
return $self; |
153 |
return $self; |
147 |
} |
154 |
} |
148 |
|
155 |
|
|
|
156 |
|
149 |
=head3 _backend |
157 |
=head3 _backend |
150 |
|
158 |
|
151 |
my $backend = $abstract->_backend($new_backend); |
159 |
my $backend = $abstract->_backend($new_backend); |