From 3e5ecc3885592816296ede64687497bb72e65061 Mon Sep 17 00:00:00 2001 From: Julian FIOL Date: Tue, 28 Jul 2015 11:18:40 +0200 Subject: [PATCH] Bug 14608 : Add Hea activation in Koha Web Installer This patch add the possibility to share your usage statistics to hea.koha-community.org in the web installer. If you click on : 'Yes' : It set the 'UsageStats' syspref to 1 (activate sharing) and the 'UsageStatsLastDisplay' syspref to 0. 'Later' : It set the 'UsageStats' syspref to 0 and the 'UsageStatsLastDisplay' syspref to the today's date. A message on the Administration page will offer you again the possibility of sharing your stats in 7 days. 'No' : It set the 'UsageStats' syspref to 0 and the 'UsageStatsLastDisplay' syspref to 0. --- installer/data/mysql/sysprefs.sql | 2 +- installer/install.pl | 16 ++++++++++ .../prog/en/modules/installer/step3.tt | 34 +++++++++++++++++----- 3 files changed, 43 insertions(+), 9 deletions(-) diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index c2b7e46..6dc4c45 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -458,7 +458,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('UsageStatsLibraryName', '', NULL, 'The library name to be shown on Hea Koha community website', 'Free'), ('UsageStatsLibraryType', 'public', 'public|school|academic|research|private|societyAssociation|corporate|government|religiousOrg|subscription', 'The library type to be shown on the Hea Koha community website', 'Choice'), ('UsageStatsLibraryUrl', '', NULL, 'The library URL to be shown on Hea Koha community website', 'Free'), -('UsageStatsLastDisplay', '', NULL, 'The last time we propose you to share your statistics', 'Free'), +('UsageStatsLastDisplay', '', NULL, 'The last time we offered you to share your statistics', 'Free'), ('UseAuthoritiesForTracings','1','0','Use authority record numbers for subject tracings instead of heading strings.','YesNo'), ('UseBranchTransferLimits','0','','If ON, Koha will will use the rules defined in branch_transfer_limits to decide if an item transfer should be allowed.','YesNo'), ('UseControlNumber','0','','If ON, record control number (w subfields) and control number (001) are used for linking of bibliographic records.','YesNo'), diff --git a/installer/install.pl b/installer/install.pl index cc67557..ef57b53 100755 --- a/installer/install.pl +++ b/installer/install.pl @@ -193,6 +193,22 @@ elsif ( $step && $step == 3 ) { elsif ( $op && $op eq 'finish' ) { $installer->set_version_syspref(); + # + # Share usage stats with Hea + # + if($query->param('hea') eq "1"){ + C4::Context->set_preference('UsageStats', 1); + C4::Context->set_preference('UsageStatsLastDisplay', 0); + } + elsif($query->param('hea') eq "-1"){ + C4::Context->set_preference('UsageStats', 0); + C4::Context->set_preference('UsageStatsLastDisplay', ((DateTime->now->epoch) * 1000)); + } + elsif($query->param('hea') eq "0"){ + C4::Context->set_preference('UsageStats', 0); + C4::Context->set_preference('UsageStatsLastDisplay', 0); + } + # Installation is finished. # We just deny anybody access to install # And we redirect people to mainpage. diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt index 3ae276f..23d8ac1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt @@ -171,15 +171,33 @@ [% END %] [% END %] -

All done!

-

Installation complete.
-

Click on 'Finish' to complete and load the Koha Staff Interface. -

- - -
+ +
+ +
+

Activate Hea ?

+

Please help us improve your user experience by sharing your statistics with community. +
We share sharing data anonymously, please see which data are sent here. +

+ Yes, I want to share my statistics
+ Later
+ No, I don't want to share my statistics
+ +

If you want to see the statistics generated, go to hea.koha-community.org

+
+ +

All done!

+

Installation complete.
+

Click on 'Finish' to complete and load the Koha Staff Interface. + + + + +

-

+
+ + [% END %] -- 2.4.5