Skip to content

Commit

Permalink
Fixed issue #11906: Сan not see the quota name when you select an ans…
Browse files Browse the repository at this point in the history
…wer for quota
  • Loading branch information
LouisGac committed Nov 16, 2016
1 parent 4a3ebd1 commit 06dd988
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions application/controllers/admin/quotas.php
Expand Up @@ -441,8 +441,8 @@ function new_answer($iSurveyId, $sSubAction = 'new_answer')
if (($sSubAction == "new_answer" || ($sSubAction == "new_answer_two" && !isset($_POST['quota_qid']))) && Permission::model()->hasSurveyPermission($iSurveyId, 'quotas', 'create'))
{
$result = Quota::model()->findAllByPk(Yii::app()->request->getPost('quota_id'));
foreach ($result as $aQuotaDetails)
{

foreach ($result as $aQuotaDetails){
$quota_name = $aQuotaDetails['name'];
}

Expand All @@ -461,8 +461,11 @@ function new_answer($iSurveyId, $sSubAction = 'new_answer')

if ($sSubAction == "new_answer_two" && isset($_POST['quota_qid']) && Permission::model()->hasSurveyPermission($iSurveyId, 'quotas', 'create'))
{
$aResults = Quota::model()->findByPk(Yii::app()->request->getPost('quota_qid'));
$sQuotaName = $aResults['name'];
$result = Quota::model()->findAllByPk(Yii::app()->request->getPost('quota_id'));

foreach ($result as $aQuotaDetails){
$quota_name = $aQuotaDetails['name'];
}

$aQuestionAnswers = self::getQuotaAnswers(Yii::app()->request->getPost('quota_qid'), $iSurveyId, Yii::app()->request->getPost('quota_id'));
$x = 0;
Expand Down
2 changes: 1 addition & 1 deletion application/views/admin/quotas/newanswertwo_view.php
Expand Up @@ -15,7 +15,7 @@
<?php else:?>
<div class="jumbotron message-box">
<div class='row'>
<h2><?php echo sprintf(gT("New answer for quota %s"), $quota_name);?></h2>
<h2><?php echo sprintf(gT("New answer for quota '%s'"), $quota_name);?></h2>
<p class="lead"><?php eT("Select answer:");?></p>
<?php echo CHtml::form(array("admin/quotas/sa/insertquotaanswer/surveyid/{$iSurveyId}"), 'post', array('#'=>'quota_'.sanitize_int($_POST['quota_id']), 'class' => 'form-horizontal')); ?>
<div class='form-group'>
Expand Down

0 comments on commit 06dd988

Please sign in to comment.