Bugzilla – Attachment 146403 Details for
Bug 32911
Remove ILL partner_code config from koha-conf.xml and turn it into a system preference
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32911: Remove ILL partner_code config from koha-conf.xml and turn it into a system preference
Bug-32911-Remove-ILL-partnercode-config-from-koha-.patch (text/plain), 7.96 KB, created by
Pedro Amorim
on 2023-02-08 16:59:22 UTC
(
hide
)
Description:
Bug 32911: Remove ILL partner_code config from koha-conf.xml and turn it into a system preference
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2023-02-08 16:59:22 UTC
Size:
7.96 KB
patch
obsolete
>From 5b85da368aac949b9ea3d20ff43571a3f65ebe71 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Wed, 8 Feb 2023 16:57:14 +0000 >Subject: [PATCH] Bug 32911: Remove ILL partner_code config from koha-conf.xml > and turn it into a system preference > >Preparation: >1) apply patch >2) run reset_all >3) enable ILLModule sys preference >4) install a backend (e.g. FreeForm) >5) go into system preferences and confirm that ILLPartnerCode exists and is the default inter-library loan (IL) > >Test plan: >1) create an ILL request >2) ensure the patron of category 'IL' has a primary e-mail configured >3) click on "place request with partners" >4) verify that the patron(s) of said category are on the partners list > >Upgrade test: >1) Remove the system preference from the database, run query: >delete from systempreferences where variable="ILLPartnerCode"; >2) Check or edit the value or partner_code in koha-conf.xml and run atomicupdate: >installer/data/mysql/updatedatabase.pl >3) Confirm the value in koha-conf.xml has been successfully migrated into the system preference, run query: >select * from systempreferences where variable="ILLPartnerCode"; > >Optional tests: >- 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(-) > >diff --git a/Koha/Illrequest/Config.pm b/Koha/Illrequest/Config.pm >index 02dac2ca65..84f4067df3 100644 >--- a/Koha/Illrequest/Config.pm >+++ b/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; > } >diff --git a/about.pl b/about.pl >index f4d1c7a959..654241685d 100755 >--- a/about.pl >+++ b/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; >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index beebd27a6f..8e12690672 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/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'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt >index c8724a8d56..63253eddcf 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt >@@ -514,7 +514,15 @@ > <tr> > <th scope="row"><strong>Warning</strong> </th> > <td> >- 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'. >+ </td> >+ </tr> >+ [% END %] >+ [% IF ill_partner_code_no_patrons %] >+ <tr> >+ <th scope="row"><strong>Warning</strong> </th> >+ <td> >+ The ILL module is enabled and ILLPartnerCode system preference configured, but there are no patrons in [% ill_partner_code_no_patrons | html %] category. > </td> > </tr> > [% END %] >@@ -530,7 +538,7 @@ > <tr> > <th scope="row"><strong>Warning</strong> </th> > <td> >- 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. > </td> > </tr> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/interlibrary_loans.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/interlibrary_loans.pref >index 1b65089039..e4ae679433 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/interlibrary_loans.pref >+++ b/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 >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 32911
:
146403
|
146404
|
146405
|
147417
|
147418
|
147419
|
150672
|
150673
|
150674
|
150750
|
150751
|
150752
|
150753
|
150768
|
150769
|
151011
|
151012
|
151013
|
151014
|
151015
|
151016
|
155195