Skip to content

Commit

Permalink
Fixed issue #16500: Printable survey have no 'group_order' and 'quest…
Browse files Browse the repository at this point in the history
…ion_order' attribute (#1655)

* Fixed issue #16500: Printable survey have no 'group_order' and 'question_order' attribute

Ported PR #1487

* Fixed issue #16500: Printable survey have no 'group_order' and 'question_order' attribute

Dummy change to trigger travis
  • Loading branch information
gabrieljenik committed Dec 10, 2020
1 parent 4f0bb4e commit 0f31470
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions application/controllers/admin/printablesurvey.php
Expand Up @@ -108,11 +108,8 @@ function index($surveyid, $lang = null, $bReturn = false)
// foreach ($aCssFiles as $cssFile) {
// Yii::app()->getClientScript()->registerCssFile("{$sFullTemplateUrl}{$cssFile}");
// }
$oGroupsCriteria = new CDbCriteria();
$oGroupsCriteria->condition = "sid = :sid";
$oGroupsCriteria->params = array(':sid' => $surveyid);
$oGroupsCriteria->order = "group_order";
$arGroups = QuestionGroup::model()->findAll($oGroupsCriteria); //xiao,

$arGroups = $oSurvey->groups;
if (!isset($surveyfaxto) || !$surveyfaxto and isset($surveyfaxnumber)) {
$surveyfaxto = $surveyfaxnumber; //Use system fax number if none is set in survey.
}
Expand Down Expand Up @@ -158,7 +155,7 @@ function index($surveyid, $lang = null, $bReturn = false)
foreach ($arGroups as $arQuestionGroup) {
// ---------------------------------------------------
// START doing groups
$arQuestions = Question::model()->findAllByAttributes(['sid' => $surveyid, 'gid' => $arQuestionGroup['gid']]);
$arQuestions = $arQuestionGroup->questions;

if (!empty($arQuestionGroup->questiongroupl10ns[$sLanguageCode]->description)) {
$group_desc = $arQuestionGroup->questiongroupl10ns[$sLanguageCode]->description;
Expand Down

0 comments on commit 0f31470

Please sign in to comment.