diff --git a/lib/WebGUI/PassiveAnalytics/Flow.pm b/lib/WebGUI/PassiveAnalytics/Flow.pm index 622cb8c68..25fd8ddc4 100644 --- a/lib/WebGUI/PassiveAnalytics/Flow.pm +++ b/lib/WebGUI/PassiveAnalytics/Flow.pm @@ -25,6 +25,19 @@ running them. #---------------------------------------------------------------------------- +=head2 analysisActive ( session ) + +Returns true if an instance of the PassiveAnalytics workflow is active. + +=cut + +sub analysisActive { + my $session = shift; + return $session->db->quickScalar(q!select count(*) from WorkflowInstance where workflowId='PassiveAnalytics000001'!); +} + +#---------------------------------------------------------------------------- + =head2 canView ( session [, user] ) Returns true if the user can administrate this operation. user defaults to @@ -114,7 +127,12 @@ sub www_editRuleflow { label => $i18n->get('pause interval'), hoverHelp => $i18n->get('pause interval help'), ); - $f->submit(value => $i18n->get('Begin analysis')); + if (analysisActive($session)) { + $f->raw('Passive Analytics analysis is currently active'); + } + else { + $f->submit(value => $i18n->get('Begin analysis')); + } my $steps = '