Skip to content

Commit

Permalink
Fixed issue #7006: Copying a survey and setting "reset conditions" do…
Browse files Browse the repository at this point in the history
…esn't reset relevance equations
  • Loading branch information
c-schmitz committed Dec 5, 2012
1 parent b833915 commit 81e3560
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions application/controllers/admin/surveyadmin.php
Expand Up @@ -942,6 +942,11 @@ public function copy()
elseif ($action == 'copysurvey' && (empty($importerror) || !$importerror))
{
$aImportResults = XMLImportSurvey('', $copysurveydata, $sNewSurveyName);
if (isset($exclude['conditions']))
{
Questions::model()->updateAll(array('relevance'=>'1'),'sid='.$aImportResults['newsid']);
Groups::model()->updateAll(array('grelevance'=>'1'),'sid='.$aImportResults['newsid']);
}
if (!isset($exclude['permissions']))
{
Survey_permissions::model()->copySurveyPermissions($iSurveyID,$aImportResults['newsid']);
Expand Down
2 changes: 1 addition & 1 deletion application/views/admin/survey/subview/tabCopy_view.php
Expand Up @@ -15,7 +15,7 @@
<input id='copysurveyexcludepermissions' name="copysurveyexcludepermissions" type="checkbox"/></li>
<li><label for='copysurveyexcludeanswers'><?php echo $clang->gT("Exclude answers?"); ?> </label>
<input id='copysurveyexcludeanswers' name="copysurveyexcludeanswers" type="checkbox" /></li>
<li><label for='copysurveyresetconditions'><?php echo $clang->gT("Reset conditions?"); ?></label>
<li><label for='copysurveyresetconditions'><?php echo $clang->gT("Reset conditions/relevance?"); ?></label>
<input id='copysurveyresetconditions' name="copysurveyresetconditions" type="checkbox" /></li>
</ul>
<p><input type='submit' value='<?php $clang->eT("Copy survey"); ?>' />
Expand Down

0 comments on commit 81e3560

Please sign in to comment.