*
* Copyright 2004, Sung Kim/GForge, LLC
* Copyright 2009, Roland Mas
+ * Copyright (C) 2012 Alain Peyrat - Alcatel-Lucent
+ * Copyright 2013, Franck Villaume - TrivialDev
* http://fusionforge.org
*
* This file is part of FusionForge. FusionForge is free software;
* @param object The Group object to which this survey is associated.
* @param int The survey_id
*/
- function SurveyFactory(&$Group) {
+ function __construct(&$Group) {
$this->Error();
if (!$Group || !is_object($Group)) {
$this->setError(_('No valid Group Object'));
return false;
}
-
if ($Group->isError()) {
$this->setError(_('Survey').':: '.$Group->getErrorMessage());
return false;
}
+ if (!$Group->usesSurvey()) {
+ $this->setError(sprintf(_('%s does not use the Survey tool'),
+ $Group->getPublicName()));
+ return false;
+ }
$this->Group =& $Group;
- return true;
}
/**
// mode: php
// c-file-style: "bsd"
// End:
-
-?>