From bd67897961a9238aecab05312e08c905fd954fa0 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 22 Oct 2019 13:57:42 +0100 Subject: [PATCH] Bug 23866: Prompt for HEA configuration Signed-off-by: Jonathan Druart Signed-off-by: Josef Moravec --- installer/data/mysql/atomicupdate/bug_23866.perl | 7 +++++++ installer/data/mysql/sysprefs.sql | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt | 9 +++++++++ .../intranet-tmpl/prog/en/modules/admin/preferences/admin.pref | 3 ++- .../intranet-tmpl/prog/en/modules/admin/usage_statistics.tt | 10 ++++++++-- 5 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_23866.perl diff --git a/installer/data/mysql/atomicupdate/bug_23866.perl b/installer/data/mysql/atomicupdate/bug_23866.perl new file mode 100644 index 0000000000..3c1f19c5c0 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_23866.perl @@ -0,0 +1,7 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + $dbh->do( "UPDATE systempreferences SET value = '2' WHERE value = '0' AND variable = 'UsageStats'" ); + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 23866 - Set HEA syspref to prompt for review)\n"; +} diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 11aa53d1dc..3897de89da 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -642,7 +642,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('UploadPurgeTemporaryFilesDays','',NULL,'If not empty, number of days used when automatically deleting temporary uploads','integer'), ('uppercasesurnames','0',NULL,'If ON, surnames are converted to upper case in patron entry form','YesNo'), ('URLLinkText','',NULL,'Text to display as the link anchor in the OPAC','free'), -('UsageStats', 0, NULL, 'Share anonymous usage data on the Hea Koha community website.', 'YesNo'), +('UsageStats', 2, NULL, 'Share anonymous usage data on the Hea Koha community website.', 'YesNo'), ('UsageStatsCountry', '', NULL, 'The country where your library is located, to be shown on the Hea Koha community website', 'Choice'), ('UsageStatsID', '', NULL, 'This preference is part of Koha but it should not be deleted or updated manually.', 'Free'), ('UsageStatsGeolocation', '', NULL, 'Geolocation of the main library.', 'Free'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt index 5059cbfa34..df53b30bc8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt @@ -30,6 +30,15 @@ [% END %] [% END %] + [% IF ( CAN_user_parameters_manage_usage_stats ) %] + [% IF ( Koha.Preference('UsageStats') == 2 ) %] +
+

Share anonymous usage statistics with the Koha community?

+

You haven't decided if you want to activate usage statistic sharing in Koha yet. Change your HEA settings.

+

This feature gives the Koha developers valuable information regarding how Koha is being used and helps to drive decisions during the development cycle

+
+ [% END %] + [% END %]

Koha administration

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref index 5c890706be..00fba12baf 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref @@ -184,10 +184,11 @@ Administration: - - "Share anonymous Koha usage data with the Koha community: " - pref: UsageStats - default: 0 + default: 2 choices: yes: "Yes" no: "No" + 2: "No, let me think about it" - ". Website where usage statistics are published: Hea Koha community website." - "
NOTE: The other \"UsageStats\" preferences have no effect if this preference is set to \"No\"." - "
NOTE: This system preference requires the misc/cronjobs/share_usage_with_koha_community.pl cronjob. Ask your system administrator to schedule it." diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/usage_statistics.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/usage_statistics.tt index 0f8ea78bed..f8d018234d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/usage_statistics.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/usage_statistics.tt @@ -57,12 +57,18 @@
  • -- 2.11.0