Skip to content

Commit

Permalink
Fixed issue #7812: Iterate survey not working
Browse files Browse the repository at this point in the history
  • Loading branch information
c-schmitz committed May 10, 2013
1 parent aff05bb commit e2bd4ae
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 11 deletions.
2 changes: 2 additions & 0 deletions application/controllers/admin/database.php
Expand Up @@ -442,7 +442,9 @@ function index($sa = null)
'question_order' => $question_order,
'language' => $alang
);
switchMSSQLIdentityInsert('questions',true);
$langqid=Question::model()->insertRecords($data);
switchMSSQLIdentityInsert('questions',false);

// Checked */
if (!$langqid)
Expand Down
7 changes: 2 additions & 5 deletions application/controllers/admin/dataentry.php
Expand Up @@ -97,14 +97,11 @@ function vvimport()
}
}

function iteratesurvey()
function iteratesurvey($surveyid)
{
$aData = array();

$surveyid = sanitize_int(Yii::app()->request->getParam('surveyid'));
if (!empty($_REQUEST['sid'])) {
$surveyid = sanitize_int($_REQUEST['sid']);
}
$surveyid = sanitize_int($surveyid);
$aData['surveyid'] = $surveyid;
$aData['clang'] = $this->getController()->lang;
$aData['success'] = false;
Expand Down
2 changes: 1 addition & 1 deletion application/views/admin/dataentry/iteratesurvey.php
Expand Up @@ -12,7 +12,7 @@
<li><?php $clang->eT("Reset the completed answers to the incomplete state");?></li>
<li><?php $clang->eT("Reset all your tokens to the 'not used' state");?></li>
</ol><br />
<?php echo CHtml::form(array("admin/dataentry/sa/iteratesurvey/unfinalizeanswers/true/surveyid/"), 'post');?>
<?php echo CHtml::form(array("admin/dataentry/sa/iteratesurvey/unfinalizeanswers/true/surveyid/".$surveyid), 'post');?>
<input type='submit' onclick="return confirm('<?php $clang->eT("Are you really sure you want to *delete* some incomplete answers and reset the completed state of both answers and tokens?","js");?>')" value='<?php $clang->eT("Reset answers and token completed state");?>' />
</form>
</div>
Expand Down
18 changes: 13 additions & 5 deletions application/views/admin/responses/browsemenubar_view.php
Expand Up @@ -97,11 +97,19 @@
<a href='<?php echo $this->createUrl("admin/export/sa/vvexport/surveyid/$surveyid"); ?>'>
<img src='<?php echo $sImageURL; ?>exportvv.png' title='' alt='<?php $clang->eT("Export a VV survey file"); ?>' /></a>
<?php }
if (Permission::model()->hasSurveyPermission($surveyid, 'responses', 'delete') && $thissurvey['anonymized'] == 'N' && $thissurvey['tokenanswerspersistence'] == 'Y')
{ ?>
<a href='<?php echo $this->createUrl("admin/dataentry/sa/iteratesurvey/surveyid/$surveyid"); ?>'>
<img src='<?php echo $sImageURL; ?>iterate.png' title='' alt='<?php $clang->eT("Iterate survey"); ?>' /></a>
<?php } ?>
if (Permission::model()->hasSurveyPermission($surveyid, 'responses', 'delete'))
{ ?>
<img src='<?php echo $sImageURL; ?>separator.gif' class='separator' alt='' /> <?php
if ($thissurvey['anonymized'] == 'N' && $thissurvey['tokenanswerspersistence'] == 'Y')
{ ?>
<a href='<?php echo $this->createUrl("admin/dataentry/sa/iteratesurvey/surveyid/$surveyid"); ?>'>
<img src='<?php echo $sImageURL; ?>iterate.png' title='' alt='<?php $clang->eT("Iterate survey"); ?>' /></a>
<?php }
else
{
?> <img src='<?php echo $sImageURL; ?>iterate_disabled.png' title='' alt='<?php $clang->eT("Iterate survey"); ?>' /> <?php
}
} ?>
</div>
</div>
</div>
Binary file added styles/blobblueish/images/iterate_disabled.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added styles/gartergrey/images/iterate_disabled.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added styles/gringegreen/images/iterate_disabled.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e2bd4ae

Please sign in to comment.