use Koha;
use Koha::Acquisition::Currencies;
+use Koha::Patron::Categories;
use Koha::Patrons;
use Koha::Caches;
use Koha::Config::SysPrefs;
}
}
+# ILL module checks
if ( C4::Context->preference('ILLModule') ) {
my $warnILLConfiguration = 0;
+ my $ill_config_from_file = C4::Context->config("interlibrary_loans");
+ my $ill_config = Koha::Illrequest::Config->new;
+
my $available_ill_backends =
- ( scalar @{ Koha::Illrequest::Config->new->available_backends } > 0 );
+ ( scalar @{ $ill_config->available_backends } > 0 );
+ # Check backends
if ( !$available_ill_backends ) {
$template->param( no_ill_backends => 1 );
$warnILLConfiguration = 1;
}
+ # Check partner_code
+ if ( !Koha::Patron::Categories->find($ill_config->partner_code) ) {
+ $template->param( ill_partner_code_doesnt_exist => $ill_config->partner_code );
+ $warnILLConfiguration = 1;
+ }
+
+ if ( !$ill_config_from_file->{partner_code} ) {
+ # partner code not defined
+ $template->param( ill_partner_code_not_defined => 1 );
+ $warnILLConfiguration = 1;
+ }
+
$template->param( warnILLConfiguration => $warnILLConfiguration );
}
</td></tr>
[% END %]
[% IF warnILLConfiguration %]
+ [% IF no_ill_backends %]
<tr><th scope="row"><b>Warning</b> </th><td>
- [% IF no_ill_backends %]The ILL module is enabled, but there are no backends available.[%END %]
+ The ILL module is enabled, but there are no backends available.
</td></tr>
+ [% END %]
+ [% IF ill_partner_code_not_defined %]
+ <tr><th scope="row"><b>Warning</b> </th><td>
+ The ILL module is enabled, but no 'partner_code' defined in koha-conf.xml. Falling back to the hardcoded 'ILLLIBS'.
+ </td></tr>
+ [%END %]
+ [% IF ill_partner_code_doesnt_exist %]
+ <tr><th scope="row"><b>Warning</b> </th><td>
+ The ILL module is enabled, but the configured 'partner_code' ([% ill_partner_code_doesnt_exist %]) is not defined on the system.
+ </td></tr>
+ [% END %]
[% END %]
</table>
[% END %]