Skip to content

Commit

Permalink
Fixed issue #09535: List with comment (dropdown presentation) doesn't…
Browse files Browse the repository at this point in the history
… display "Please choose..."
  • Loading branch information
Shnoulle committed Feb 21, 2015
1 parent 7653489 commit fd82602
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions application/helpers/qanda_helper.php
Expand Up @@ -2003,11 +2003,13 @@ function do_listwithcomment($ia)
}
else //Dropdown list
{
// --> START NEW FEATURE - SAVE
$answer .= '<p class="select answer-item dropdown-item">
<select class="select" name="'.$ia[1].'" id="answer'.$ia[1].'" onchange="'.$checkconditionFunction.'(this.value, this.name, this.type)" >
';
// --> END NEW FEATURE - SAVE
if (is_null($_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$ia[1]]))
{
$answer .= '<option class="noanswer-item" value=""'.SELECTED.'>'.gT('Please choose...').'</option>'."\n";
}
foreach ($ansresult as $ansrow)
{
$check_ans = '';
Expand All @@ -2022,16 +2024,13 @@ function do_listwithcomment($ia)
$maxoptionsize = strlen($ansrow['answer']);
}
}
if ($ia[6] != 'Y' && SHOW_NO_ANSWER == 1)
if ($ia[6] != 'Y' && SHOW_NO_ANSWER == 1 && !is_null($_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$ia[1]]))
{
if ((!$_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$ia[1]] || $_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$ia[1]] == '') ||($_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$ia[1]] == ' '))
$check_ans="";
if (trim($_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$ia[1]]) == '')
{
$check_ans = SELECTED;
}
elseif ($_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$ia[1]] || $_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$ia[1]] != '')
{
$check_ans = '';
}
$answer .= '<option class="noanswer-item" value=""'.$check_ans.'>'.gT('No answer')."</option>\n";
}
$answer .= ' </select>
Expand Down

0 comments on commit fd82602

Please sign in to comment.