Skip to content

Commit

Permalink
Fixed issue: survey summary don't show base language summary
Browse files Browse the repository at this point in the history
  • Loading branch information
Shnoulle committed Jan 26, 2013
1 parent 502676b commit a2f7021
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 20 deletions.
18 changes: 4 additions & 14 deletions application/core/Survey_Common_Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -649,20 +649,10 @@ function _surveybar($iSurveyID, $gid=null)
function _surveysummary($iSurveyID, $action=null, $gid=null)
{
$clang = $this->getController()->lang;

$baselang = Survey::model()->findByPk($iSurveyID)->language;
$condition = array('sid' => $iSurveyID, 'language' => $baselang);

$sumresult1 = Survey::model()->with(array('languagesettings'=>array('condition'=>'surveyls_language=language')))->findByPk($iSurveyID); //$sumquery1, 1) ; //Checked
if (is_null($sumresult1))
{
Yii::app()->session['flashmessage'] = $clang->gT("Invalid survey ID");
$this->getController()->redirect($this->getController()->createUrl("admin/index"));
} // if surveyid is invalid then die to prevent errors at a later time
$surveyinfo = $sumresult1->attributes;
$surveyinfo = array_merge($surveyinfo, $sumresult1->languagesettings[0]->attributes);
$surveyinfo = array_map('flattenText', $surveyinfo);
//$surveyinfo = array_map('flattenText', $surveyinfo);
//$surveyinfo = array_map('htmlspecialchars', $surveyinfo);
$surveyinfo=getSurveyInfo($iSurveyID);
$baselang = $surveyinfo['language'];
$activated = $surveyinfo['active'];

$condition = array('sid' => $iSurveyID, 'parent_qid' => 0, 'language' => $baselang);
Expand Down Expand Up @@ -812,7 +802,7 @@ function _surveysummary($iSurveyID, $action=null, $gid=null)

if ($surveyinfo['surveyls_url'] != "")
{
$aData['endurl'] = " <a target='_blank' href=\"" . htmlspecialchars($surveyinfo['surveyls_url']) . "\" title=\"" . htmlspecialchars($surveyinfo['surveyls_url']) . "\">{$surveyinfo['surveyls_urldescription']}</a>";
$aData['endurl'] = " <a target='_blank' href=\"" . htmlspecialchars($surveyinfo['surveyls_url']) . "\" title=\"" . htmlspecialchars($surveyinfo['surveyls_url']) . "\">".flattenText($surveyinfo['surveyls_urldescription'])."</a>";
}
else
{
Expand Down
12 changes: 6 additions & 6 deletions application/views/admin/survey/surveySummary_view.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<strong><?php $clang->eT("Title");?>:</strong>
</td>
<td class='settingentryhighlight'>
<?php echo $surveyinfo['surveyls_title']." (".$clang->gT("ID")." ".$surveyinfo['sid'].")";?>
<?php echo flattenText($surveyinfo['surveyls_title'])." (".$clang->gT("ID")." ".$surveyinfo['sid'].")";?>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -40,7 +40,7 @@
<?php
if (trim($surveyinfo['surveyls_description']) != '')
{
templatereplace($surveyinfo['surveyls_description']);
templatereplace(flattenText($surveyinfo['surveyls_description']));
echo LimeExpressionManager::GetLastPrettyPrintExpression();
}
?>
Expand All @@ -52,7 +52,7 @@
</td>
<td>
<?php
templatereplace($surveyinfo['surveyls_welcometext']);
templatereplace(flattenText($surveyinfo['surveyls_welcometext']));
echo LimeExpressionManager::GetLastPrettyPrintExpression();
?>
</td>
Expand All @@ -63,7 +63,7 @@
</td>
<td>
<?php
templatereplace($surveyinfo['surveyls_endtext']);
templatereplace(flattenText($surveyinfo['surveyls_endtext']));
echo LimeExpressionManager::GetLastPrettyPrintExpression();
?>
</td>
Expand All @@ -82,7 +82,7 @@
<strong><?php $clang->eT("Fax to:");?></strong>
</td>
<td>
<?php echo$surveyinfo['faxto'];?>
<?php echo $surveyinfo['faxto'];?>
</td>
</tr>
<?php } ?>
Expand Down Expand Up @@ -177,4 +177,4 @@
<tr><td><strong><?php $clang->eT("Table column usage");?>: </strong></td><td><strong><?php echo $column_usage;?>%</strong><div class='progressbar' style='width:20%; height:15px;' name='<?php echo $column_usage;?>'></div> </td></tr>
<?php }
} ?>
</table>
</table>

0 comments on commit a2f7021

Please sign in to comment.