From 802713092f11a359fb6c4f8357ea0fb6d3a27fca Mon Sep 17 00:00:00 2001 From: JT Smith Date: Fri, 15 May 2009 16:11:32 +0000 Subject: [PATCH] - Added WebGUI community statistics question to the site setup wizard. --- docs/changelog/7.x.x.txt | 1 + lib/WebGUI/Content/Setup.pm | 11 +++++++++++ lib/WebGUI/Operation/Statistics.pm | 2 ++ lib/WebGUI/i18n/English/Activity_SendWebguiStats.pm | 6 ++++++ 4 files changed, 20 insertions(+) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 12116dd1f..f10a6d825 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -1,5 +1,6 @@ 7.7.7 - rfe #10061: Use email as username at registration + - Added WebGUI community statistics question to the site setup wizard. - Added Ogone payment plugin ( Martin Kamerbeek / Oqapi ) 7.7.6 diff --git a/lib/WebGUI/Content/Setup.pm b/lib/WebGUI/Content/Setup.pm index 42a476006..d3ee8aa57 100644 --- a/lib/WebGUI/Content/Setup.pm +++ b/lib/WebGUI/Content/Setup.pm @@ -22,6 +22,7 @@ use WebGUI::International; use WebGUI::Storage; use WebGUI::VersionTag; use WebGUI::Utility; +use WebGUI::Operation::Statistics; =head1 NAME @@ -154,6 +155,16 @@ sub handler { $session->setting->set('companyName',$form->text("companyName")) if ($form->get("companyName")); $session->setting->set('companyURL',$form->url("companyURL")) if ($form->get("companyURL")); $session->setting->set('companyEmail',$form->email("companyEmail")) if ($form->get("companyEmail")); + $legend = $i18n->get('topicName','Activity_SendWebguiStats'); + $output .= '

'.$i18n->get('why to send','Activity_SendWebguiStats').'

+

'.$i18n->get('would you participate','Activity_SendWebguiStats').'

+

'.$i18n->get('disable','Activity_SendWebguiStats').'       + '.$i18n->get('enable','Activity_SendWebguiStats').'

+ '; + } + elsif ($session->form->process("step") eq "sitestarter") { + my $form = $session->form; + WebGUI::Operation::Statistics::www_enableSendWebguiStats($session) if ($form->get("enableStats")); $legend = $i18n->get('site starter title'); $output .= '

'.$i18n->get('site starter body').'

'.$i18n->get('no thanks').'       diff --git a/lib/WebGUI/Operation/Statistics.pm b/lib/WebGUI/Operation/Statistics.pm index 881035a36..fe2713536 100644 --- a/lib/WebGUI/Operation/Statistics.pm +++ b/lib/WebGUI/Operation/Statistics.pm @@ -91,6 +91,7 @@ Deletes the workflow schedule that sends WebGUI statistics to webgui.org. sub www_disableSendWebguiStats { my $session = shift; + return $session->privilege->adminOnly() unless canView($session); my $task = WebGUI::Workflow::Cron->new($session, 'send_webgui_statistics'); $task->delete; return www_viewStatistics($session); @@ -107,6 +108,7 @@ Creates the workflow schedule that sends WebGUI statistics to webgui.org. sub www_enableSendWebguiStats { my $session = shift; + return $session->privilege->adminOnly() unless canView($session); # we set the current hour, minute, and day of week to send in the stats so we don't DOS webgui.org # by having everybody sending it at the same time my $dt = WebGUI::DateTime->new($session, time()); diff --git a/lib/WebGUI/i18n/English/Activity_SendWebguiStats.pm b/lib/WebGUI/i18n/English/Activity_SendWebguiStats.pm index 1429b8190..05f938f1d 100644 --- a/lib/WebGUI/i18n/English/Activity_SendWebguiStats.pm +++ b/lib/WebGUI/i18n/English/Activity_SendWebguiStats.pm @@ -10,6 +10,12 @@ our $I18N = { context => q|A description of the stats program, what we're sending, and why it's important.| }, + 'would you participate' => { + message => q|Would you like to enable or disable participation in the WebGUI community statistics program?|, + lastUpdated => 0, + context => q|A call to action for the statistics program.| + }, + 'topicName' => { message => q|Send WebGUI Statistics|, lastUpdated => 0,