Skip to content

Commit

Permalink
Fixed issue #6997: Zero values in Array (Numbers) (inout box layout) …
Browse files Browse the repository at this point in the history
…disappear

Dev: reviewing some include class
  • Loading branch information
Shnoulle committed Nov 30, 2012
1 parent 1cefb42 commit c026dae
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions application/modules/NumberArrayQuestion.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,23 +63,23 @@ public function getAnswerHTML()
}

$checkboxlayout=false;
$inputboxlayout=false;
if ($aQuestionAttributes['multiflexible_checkbox']!=0)
{
$minvalue=0;
$maxvalue=1;
$checkboxlayout=true;
$answertypeclass .=" checkbox";
$answertypeclass =" checkbox";
}

$inputboxlayout=false;
if ($aQuestionAttributes['input_boxes']!=0 && !$checkboxlayout) // checkboxlayout have the
elseif ($aQuestionAttributes['input_boxes']!=0 )
{
$inputboxlayout=true;
$answertypeclass .=" numberonly text";
$answertypeclass =" numeric-item text";
$extraclass.=" numberonly";
}
if (!$checkboxlayout && !$inputboxlayout)
else
{
$answertypeclass .=" dropdown";
$answertypeclass =" dropdown";
}
if(ctype_digit(trim($aQuestionAttributes['repeat_headings'])) && trim($aQuestionAttributes['repeat_headings']!=""))
{
Expand Down Expand Up @@ -269,15 +269,16 @@ public function getAnswerHTML()
$answer .= ">$ii</option>\n";
}
$answer .= "\t</select>\n";
} elseif ($inputboxlayout == true)
}
else
{
$sSeperator = getRadixPointData($thissurvey['surveyls_numberformat']);
$sSeperator = $sSeperator['seperator'];
$answer .= "\t<input type='text' class=\"multiflexitext $kpclass\" name=\"$myfname2\" id=\"answer{$myfname2}\" {$maxlength} size=5 title=\""
$answer .= "\t<input type='text' class=\"multiflexitext $kpclass $extraclass\" name=\"$myfname2\" id=\"answer{$myfname2}\" {$maxlength} size=5 title=\""
. HTMLEscape($labelans[$thiskey]).'"'
. " onkeyup=\"$checkconditionFunction(this.value, this.name, this.type)\""
. " value=\"";
if(isset($_SESSION['survey_'.$this->surveyid][$myfname2]) && $_SESSION['survey_'.$this->surveyid][$myfname2]) {
if(isset($_SESSION['survey_'.$this->surveyid][$myfname2]) && is_numeric($_SESSION['survey_'.$this->surveyid][$myfname2])) {
$dispVal = str_replace('.',$sSeperator,$_SESSION['survey_'.$this->surveyid][$myfname2]);
$answer .= $dispVal;
}
Expand Down Expand Up @@ -1017,4 +1018,4 @@ public function questionProperties($prop = false)
return $prop?$props[$prop]:$props;
}
}
?>
?>

0 comments on commit c026dae

Please sign in to comment.