From 5ee1e0fb93ac0bc29e7a9f283819d987642438c1 Mon Sep 17 00:00:00 2001 From: Oli Williams Date: Fri, 23 Jan 2026 06:23:22 +0000 Subject: [PATCH] Bug 41522: Make sysprefs clickable in warnings Modified system information warnings and errors to have hyperlinks to their preferences page for users with the correct permissions for better navigation. --- .../intranet-tmpl/prog/en/modules/about.tt | 303 +++++++++++++++--- 1 file changed, 254 insertions(+), 49 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt index 18a9379..2cc95bc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt @@ -546,66 +546,163 @@ Warning + System preference [% IF (UserHasSysPrefsPerm) %] - System preference ' - RequireChoosingExistingAuthority' is disabled, but needs ' - AutoCreateAuthorities' enabled. Otherwise catalogers can add headings that will not be linked to authorities. + 'RequireChoosingExistingAuthority' [% ELSE %] - System preference 'RequireChoosingExistingAuthority' is disabled, but needs 'AutoCreateAuthorities' enabled. Otherwise catalogers can add headings that will not be linked to authorities. + 'RequireChoosingExistingAuthority' [% END %] + is disabled, but needs + [% IF (UserHasSysPrefsPerm) %] + AutoCreateAuthorities + [% ELSE %] + AutoCreateAuthorities + [% END %] + enabled. Otherwise catalogers can add headings that will not be linked to authorities. [% END %] [% IF (warnPrefEasyAnalyticalRecords) %] Warning - System preference 'EasyAnalyticalRecords' set, but UseControlNumber preference is set to 'Use'. Set it to 'Don't use' or else the 'Show analytics' links in the staff interface and the OPAC will be - broken. + + System preference + [% IF (UserHasSysPrefsPerm) %] + 'EasyAnalyticalRecords' + [% ELSE %] + 'EasyAnalyticalRecords' + [% END %] + set, but + [% IF (UserHasSysPrefsPerm) %] + UseControlNumber + [% ELSE %] + UseControlNumber + [% END %] + preference is set to 'Use'. Set it to 'Don't use' or else the 'Show analytics' links in the staff interface and the OPAC will be broken. + [% END %] [% IF warnPrefAnonymousPatronOPACPrivacy %] Error - System preference 'OPACPrivacy' set, but AnonymousPatron preference is set to '0'. Set it to a valid borrower number or checkins for these patrons will fail. + + System preference + [% IF (UserHasSysPrefsPerm) %] + 'OPACPrivacy' + [% ELSE %] + 'OPACPrivacy' + [% END %] + set, but + [% IF (UserHasSysPrefsPerm) %] + AnonymousPatron + [% ELSE %] + AnonymousPatron + [% END %] + preference is set to '0'. Set it to a valid borrower number or checkins for these patrons will fail. + [% END %] [% IF warnPrefAnonymousPatronAnonSuggestions %] Warning - System preference 'AnonSuggestions' set, but AnonymousPatron preference is set to '0'. Set it to a valid borrower number if you want that this feature works correctly. + + System preference + [% IF (UserHasSysPrefsPerm) %] + 'AnonSuggestions' + [% ELSE %] + 'AnonSuggestions' + [% END %] + set, but + [% IF (UserHasSysPrefsPerm) %] + AnonymousPatron + [% ELSE %] + AnonymousPatron + [% END %] + preference is set to '0'. Set it to a valid borrower number if you want that this feature works correctly. + [% END %] - [% IF warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist %] + [% IF warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist || 1 %] Error - Some patrons have requested privacy after their items are checked in, but the AnonymousPatron preference is not set correctly. Set it to a valid borrower number or checkins for these patrons will fail. + + Some patrons have requested privacy after their items are checked in, but the + [% IF (UserHasSysPrefsPerm) %] + AnonymousPatron + [% ELSE %] + AnonymousPatron + [% END %] + preference is not set correctly. Set it to a valid borrower number or checkins for these patrons will fail. + [% END %] - [% IF warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist %] + [% IF warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist || 1 %] Warning - System preference 'AnonSuggestions' set, but AnonymousPatron preference is not set correctly. Set it to a valid borrower number if you want that this feature works correctly. + + System preference + [% IF (UserHasSysPrefsPerm) %] + 'AnonSuggestions' + [% ELSE %] + 'AnonSuggestions' + [% END %] + set, but + [% IF (UserHasSysPrefsPerm) %] + AnonymousPatron + [% ELSE %] + AnonymousPatron + [% END %] + preference is not set correctly. Set it to a valid borrower number if you want that this feature works correctly. [% END %] [% IF warnPrefKohaAdminEmailAddress %] Warning - System preference 'KohaAdminEmailAddress' does not contain a valid email address. Emails will not be sent. + + System preference + [% IF (UserHasSysPrefsPerm) %] + 'KohaAdminEmailAddress' + [% ELSE %] + 'KohaAdminEmailAddress' + [% END %] + does not contain a valid email address. Emails will not be sent. + [% END %] - [% IF warnPrefOpacHiddenItems %] + [% IF warnPrefOpacHiddenItems || 1 %] Warning - System preference 'OpacHiddenItems' generates a warning and will produce unexpected behaviors: [% warnPrefOpacHiddenItems | html %] + + System preference + [% IF (UserHasSysPrefsPerm) %] + 'OpacHiddenItems' + [% ELSE %] + 'OpacHiddenItems' + [% END %] + generates a warning and will produce unexpected behaviors: [% warnPrefOpacHiddenItems | html %] + [% END %] [% IF warnPrefPatronSelfRegistrationDefaultCategory %] - Warning System preference 'PatronSelfRegistration' is set, but 'PatronSelfRegistrationDefaultCategory' does not contain a valid patron category code. Patron self-registration is disabled. + + Warning + + System preference + [% IF (UserHasSysPrefsPerm) %] + 'PatronSelfRegistration' + [% ELSE %] + 'PatronSelfRegistration' + [% END %] + is set, but + [% IF (UserHasSysPrefsPerm) %] + 'PatronSelfRegistrationDefaultCategory' + [% ELSE %] + 'PatronSelfRegistrationDefaultCategory' + [% END %] + does not contain a valid patron category code. Patron self-registration is disabled. + + [% END %] [% IF warnXSLT %] [% FOR p IN warnXSLT %] @@ -619,10 +716,15 @@ [% FOR p IN invalid_yesno %] Warning - System preference '[% p.variable | html %]' must be '0' or '1', but is - [% IF p.value.defined %]'[% p.value | html %]'[% ELSE %]NULL[% END %]. + + System preference + [% IF (UserHasSysPrefsPerm) %] + '[% p.variable | html %]' + [% ELSE %] + '[% p.variable | html %]' + [% END %] + must be '0' or '1', but is [% IF p.value.defined %]'[% p.value | html %]'[% ELSE %]NULL[% END %]. + [% END %] [% END %] @@ -632,10 +734,18 @@ No active currency is defined. Please go to Administration > Currencies and exchange rates and mark one currency as active. [% END %] - [% IF warnStatisticsFieldsError %] + [% IF warnStatisticsFieldsError || 1 %] Warning - System preference 'StatisticsFields' contains field names not belonging to the items database table: [% warnStatisticsFieldsError | html %] + + System preference + [% IF (UserHasSysPrefsPerm) %] + 'StatisticsFields' + [% ELSE %] + 'StatisticsFields' + [% END %] + contains field names not belonging to the items database table: [% warnStatisticsFieldsError | html %] + [% END %] [% IF AutoSelfCheckPatronDoesNotHaveSelfCheckPerm %] @@ -662,54 +772,133 @@ The PO directory has not been found. See the dedicated wiki page for more information. [% END %] - [% IF warnPassChangeNoticeMissing %] + [% IF warnPassChangeNoticeMissing || 1 %] Warning - System preference 'NotifyPasswordChange' is enabled, but the PASSWORD_CHANGE notice template is missing. Patrons will not be notified about password changes. Please create the PASSWORD_CHANGE notice template - in Tools > Notices and slips. + + System preference + [% IF (UserHasSysPrefsPerm) %] + 'NotifyPasswordChange' + [% ELSE %] + 'NotifyPasswordChange' + [% END %] + is enabled, but the PASSWORD_CHANGE notice template is missing. Patrons will not be notified about password changes. Please create the PASSWORD_CHANGE notice template in + Tools > Notices and slips. + [% END %] - [% IF warnILLConfiguration %] - [% IF no_ill_backends %] + [% IF warnILLConfiguration || 1 %] + [% IF no_ill_backends || 1 %] Warning - The ILL module is enabled, but there are no backends available. + + The + [% IF (UserHasSysPrefsPerm) %] + ILL module + [% ELSE %] + ILL module + [% END %] + is enabled, but there are no backends available. + [% END %] [% IF ill_partner_code_not_defined %] Warning - The ILL module is enabled, but ILLPartnerCode system preference is empty. Falling back to the hardcoded 'IL'. + + The + [% IF (UserHasSysPrefsPerm) %] + ILL module + [% ELSE %] + ILL module + [% END %] + is enabled, but + [% IF (UserHasSysPrefsPerm) %] + ILLPartnerCode + [% ELSE %] + ILLPartnerCode + [% END %] + system preference is empty. Falling back to the hardcoded 'IL'. + [% END %] - [% IF ill_partner_code_no_patrons %] + [% IF ill_partner_code_no_patrons || 1 %] Warning - The ILL module is enabled and ILLPartnerCode system preference configured, but there are no patrons in [% ill_partner_code_no_patrons | html %] category. + + The + [% IF (UserHasSysPrefsPerm) %] + ILL module + [% ELSE %] + ILL module + [% END %] + is enabled and + [% IF (UserHasSysPrefsPerm) %] + ILLPartnerCode + [% ELSE %] + ILLPartnerCode + [% END %] + system preference configured, but there are no patrons in [% ill_partner_code_no_patrons | html %] category. + [% END %] - [% IF ill_branch_not_defined %] + [% IF ill_branch_not_defined || 1 %] Warning - The ILL module is enabled, but no 'branch' block is defined in koha-conf.xml. You must define this block before use. + + The + [% IF (UserHasSysPrefsPerm) %] + ILL module + [% ELSE %] + ILL module + [% END %] + is enabled, but no 'branch' block is defined in koha-conf.xml. You must define this block before use. + [% END %] - [% IF ill_partner_code_doesnt_exist %] + [% IF ill_partner_code_doesnt_exist || 1 %] Warning - The ILL module is enabled, but the configured ILLPartnerCode ([% ill_partner_code_doesnt_exist | html %]) is not defined on the system. + + The + [% IF (UserHasSysPrefsPerm) %] + ILL module + [% ELSE %] + ILL module + [% END %] + is enabled, but the configured + [% IF (UserHasSysPrefsPerm) %] + ILLPartnerCode + [% ELSE %] + ILLPartnerCode + [% END %] + ([% ill_partner_code_doesnt_exist | html %]) is not defined on the system. + [% END %] - [% IF ill_deprecated_backend_freeform_is_installed %] + [% IF ill_deprecated_backend_freeform_is_installed || 1 %] Warning -

The ILL module is enabled, but the deprecated 'FreeForm' backend is installed.

+

The + [% IF (UserHasSysPrefsPerm) %] + ILL module + [% ELSE %] + ILL module + [% END %] + is enabled, but the deprecated 'FreeForm' backend is installed.

'FreeForm' has since become part of core Koha as 'Standard'.

All 'FreeForm' ILL content should've been migrated to 'Standard' upon upgrading Koha to 24.11.

-

To avoid confusion or redundancy, please uninstall the 'FreeForm' backend before using the ILL module.

+

To avoid confusion or redundancy, please uninstall the 'FreeForm' backend before using the + [% IF (UserHasSysPrefsPerm) %] + ILL module. + [% ELSE %] + ILL module. + [% END %] +

[% END %] @@ -721,10 +910,18 @@ > [% END %] - [% IF oauth2_missing_deps %] + [% IF oauth2_missing_deps || 1 %] Warning - System preference 'RESTOAuth2ClientCredentials' is set, but the required Net::OAuth2::AuthorizationServer dependency is missing. The feature is disabled. + + System preference + [% IF (UserHasSysPrefsPerm) %] + 'RESTOAuth2ClientCredentials' + [% ELSE %] + 'RESTOAuth2ClientCredentials' + [% END %] + is set, but the required Net::OAuth2::AuthorizationServer dependency is missing. The feature is disabled. + [% END %] [% IF bad_yaml_prefs %] @@ -733,10 +930,18 @@ Some system preferences have badly formatted YAML content: [% bad_yaml_prefs.join(', ') | html %] [% END %] - [% IF config_bcrypt_settings_no_set %] + [% IF config_bcrypt_settings_no_set || 1 %] Warning - System preference 'Pseudonymization' is set, but there is not 'bcrypt_settings' entry defined in the $KOHA_CONF file. + + System preference + [% IF (UserHasSysPrefsPerm) %] + 'Pseudonymization' + [% ELSE %] + 'Pseudonymization' + [% END %] + is set, but there is not 'bcrypt_settings' entry defined in the $KOHA_CONF file. + [% END %] [% IF warnHiddenBiblionumbers.size %] -- 2.39.5