@@ -, +, @@ and turn it into a system preference - Set a patron category in the sys pref and then delete said patron category (needs to not have patrons in it) - Check the about page -> System information and confirm the warning message is correct - Set the sys pref to the empty option - Check the about page -> System information and confirm the warning message is correct - Set the sys pref to a category that has no patrons of its type (ktd examples: Board, or Library) - Check the about page -> System information and confirm the warning message is correct --- Koha/Illrequest/Config.pm | 2 +- about.pl | 11 +++++++---- installer/data/mysql/mandatory/sysprefs.sql | 1 + koha-tmpl/intranet-tmpl/prog/en/modules/about.tt | 12 ++++++++++-- .../admin/preferences/interlibrary_loans.pref | 5 +++++ 5 files changed, 24 insertions(+), 7 deletions(-) --- a/Koha/Illrequest/Config.pm +++ a/Koha/Illrequest/Config.pm @@ -319,7 +319,7 @@ sub _load_configuration { if ( $reply_date && 'hide' eq $reply_date ); # ILL Partners - $configuration->{partner_code} = $xml_config->{partner_code} || 'IL'; + $configuration->{partner_code} = C4::Context->preference('ILLPartnerCode') || 'IL'; return $configuration; } --- a/about.pl +++ a/about.pl @@ -303,13 +303,16 @@ if ( C4::Context->preference('ILLModule') ) { $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 ); + # Check ILLPartnerCode sys pref + if ( !Koha::Patron::Categories->find( C4::Context->preference('ILLPartnerCode') ) ) { + $template->param( ill_partner_code_doesnt_exist => C4::Context->preference('ILLPartnerCode') ); + $warnILLConfiguration = 1; + } elsif ( !Koha::Patrons->search( { categorycode => C4::Context->preference('ILLPartnerCode') } )->count ) { + $template->param( ill_partner_code_no_patrons => C4::Context->preference('ILLPartnerCode') ); $warnILLConfiguration = 1; } - if ( !$ill_config_from_file->{partner_code} ) { + if ( !C4::Context->preference('ILLPartnerCode') ) { # partner code not defined $template->param( ill_partner_code_not_defined => 1 ); $warnILLConfiguration = 1; --- a/installer/data/mysql/mandatory/sysprefs.sql +++ a/installer/data/mysql/mandatory/sysprefs.sql @@ -287,6 +287,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('ILLModuleCopyrightClearance','','70|10','Enter text to enable the copyright clearance stage of request creation. Text will be displayed','Textarea'), ('ILLModuleUnmediated','0','','If enabled, try to immediately progress newly placed ILL requests.','YesNo'), ('ILLOpacbackends',NULL,NULL,'ILL backends to enabled for OPAC initiated requests','multiple'), +('ILLPartnerCode','IL','','Patrons from this patron category will be used as partners to place ILL requests with','free'), ('ILLSendStaffNotices', NULL, NULL, 'Send these ILL notices to staff', 'multiple'), ('ILS-DI','0','','Enables ILS-DI services at OPAC.','YesNo'), ('ILS-DI:AuthorizedIPs','','Restricts usage of ILS-DI to some IPs','.','Free'), --- a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt @@ -503,7 +503,15 @@ Warning - The ILL module is enabled, but no 'partner_code' defined in koha-conf.xml. Falling back to the hardcoded 'IL'. + The ILL module is enabled, but ILLPartnerCode system preference is empty. Falling back to the hardcoded 'IL'. + + + [% END %] + [% IF ill_partner_code_no_patrons %] + + Warning + + The ILL module is enabled and ILLPartnerCode system preference configured, but there are no patrons in [% ill_partner_code_no_patrons | html %] category. [% END %] @@ -519,7 +527,7 @@ Warning - The ILL module is enabled, but the configured 'partner_code' ([% ill_partner_code_doesnt_exist | html %]) is not defined on the system. + The ILL module is enabled, but the configured ILLPartnerCode ([% ill_partner_code_doesnt_exist | html %]) is not defined on the system. [% END %] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/interlibrary_loans.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/interlibrary_loans.pref @@ -44,6 +44,11 @@ Interlibrary loans: - pref: ILLSendStaffNotices class: multi - "(separated with |). e.g. ILL_REQUEST_CANCEL|ILL_REQUEST_MODIFIED If left empty, no staff ILL notices will be sent." + - + - "Use patrons from category" + - pref: ILLPartnerCode + choices: patron-categories + - "as partners to place ILL requests with." - - "Fallback email address for staff ILL notices to be sent to in the absence of a library address:" - pref: ILLDefaultStaffEmail --