@@ -, +, @@ About page and text change in System preferences - Apply patch - Edit syspref 'StatisticsFields'. Verify that the explanation makes sense. - Leave field empty => verify that no message appears on About page, tab System information - Insert valid field names, e.g. location|itype => verify that no message appears on the About page - Add trailing char => verify that the warning message appears on the About page - Fill in some garbage or misspell a field name => verify that the warning message appears on the About page --- about.pl | 10 ++++++++++ koha-tmpl/intranet-tmpl/prog/en/modules/about.tt | 7 +++++-- .../prog/en/modules/admin/preferences/patrons.pref | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) --- a/about.pl +++ a/about.pl @@ -37,6 +37,7 @@ use Koha; use Koha::Acquisition::Currencies; use Koha::Patrons; use Koha::Config::SysPrefs; +use C4::Members::Statistics; #use Smart::Comments '####'; @@ -70,6 +71,14 @@ if ( any { /(^psgi\.|^plack\.)/i } keys %ENV ) { } # Additional system information for warnings + +my $warnStatisticsFieldsError; +my $prefStatisticsFields = C4::Context->preference('StatisticsFields'); +if ($prefStatisticsFields) { + $warnStatisticsFieldsError = $prefStatisticsFields + unless ( $prefStatisticsFields eq C4::Members::Statistics->get_fields() ); +} + my $prefAutoCreateAuthorities = C4::Context->preference('AutoCreateAuthorities'); my $prefBiblioAddsAuthorities = C4::Context->preference('BiblioAddsAuthorities'); my $warnPrefBiblioAddsAuthorities = ( $prefAutoCreateAuthorities && ( !$prefBiblioAddsAuthorities) ); @@ -270,6 +279,7 @@ $template->param( warnIsRootUser => $warnIsRootUser, warnNoActiveCurrency => $warnNoActiveCurrency, xml_config_warnings => \@xml_config_warnings, + warnStatisticsFieldsError => $warnStatisticsFieldsError, ); my @components = (); --- a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt @@ -104,7 +104,7 @@
You are logged in as the database administrative user. This is not recommended because some parts of Koha will not function as expected when using this account.
@@ -112,7 +112,7 @@ [% END %] [% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatron || - warnNoActiveCurrency || QueryParserError || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm %] + warnNoActiveCurrency || QueryParserError || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError%]Warning | No active currency is defined. Please go to Administration > Currencies and exchange rates and mark one currency as active. |
---|---|
Warning | System preference 'StatisticsFields' contains field names not belonging to the items database table: [% warnStatisticsFieldsError %] |
Warning | You have set UseQueryParser but there was a problem inititializing QueryParser. --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref @@ -129,7 +129,7 @@ Patrons: - "Show the following fields from the items database table as columns on the statistics tab on the patron record: " - pref: StatisticsFields class: multi - - (separate fields with |) + - "(separate fields with |, without trailing |). Default if empty: location|itype|ccode" - - pref: EnableBorrowerFiles choices: -- |