* Copyright 1999-2001, VA Linux Systems, Inc.
* Copyright 2009-2010, Roland Mas
* Copyright 2010-2011, Franck Villaume - Capgemini
- * Copyright 2010-2011, Alain Peyrat - Alcatel-Lucent
+ * Copyright 2010-2012, Alain Peyrat - Alcatel-Lucent
- * Copyright 2012, Franck Villaume - TrivialDev
+ * Copyright 2012-2013, Franck Villaume - TrivialDev
* http://fusionforge.org
*
* This file is part of FusionForge. FusionForge is free software;
return false;
}
}
- $sq_arr =& $sqf->getSurveyQuestions();
- foreach ($sq_arr as $i) {
- if (!is_object($i)) {
- continue;
- }
- if (!$i->delete()) {
- $this->setError(_('Could not properly delete the survey questions'));
- db_rollback();
- return false;
+ //
+ // Delete SurveyQuestions
+ //
+ $sqf = new SurveyQuestionFactory($this);
++ $sq_arr = $sqf->getSurveyQuestions();
++ if (is_array($sq_arr)) {
++ foreach ($sq_arr as $i) {
++ if (!is_object($i)) {
++ continue;
++ }
++ if (!$i->delete()) {
++ $this->setError(_('Could not properly delete the survey questions'));
++ db_rollback();
++ return false;
++ }
+ }
+ }
}
//
// Delete Mailing List Factory
*
* 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;
$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;
}
/**
*
* Copyright 2004, Sung Kim/GForge, LLC
* Copyright 2009, Roland Mas
+ * Copyright (C) 2012 Alain Peyrat - Alcatel-Lucent
+ * Copyright 2013, Franck Villaume - TrivialDev
*
* This file is part of FusionForge. FusionForge is free software;
* you can redistribute it and/or modify it under the terms of the
$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;
}
/**