Skip to content

Commit

Permalink
Fixed issue #10607: Multiple numerical input - sum of sliders broken
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Mar 9, 2016
1 parent 918d540 commit b00911e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
10 changes: 6 additions & 4 deletions application/controllers/admin/questions.php
Expand Up @@ -1286,6 +1286,7 @@ public function delete($surveyid, $gid, $qid)

DefaultValue::model()->deleteAllByAttributes(array('qid' => $qid));
QuotaMember::model()->deleteAllByAttributes(array('qid' => $qid));

Question::model()->updateQuestionOrder($gid, $surveyid);

$qid = "";
Expand All @@ -1296,10 +1297,11 @@ public function delete($surveyid, $gid, $qid)
Yii::app()->session['flashmessage'] = gT("Question was successfully deleted.");

// remove question from lastVisited
$oCriteria = new CDbCriteria();
$oCriteria->compare('stg_name','last_question_%',true,'AND',false);
$oCriteria->compare('stg_value',$rqid,false,'AND');
SettingGlobal::model()->deleteAll($oCriteria);
SettingGlobal::model()->deleteAll(
"stg_value = :stg_value",
array(':stg_value' => $rqid )
);


$this->getController()->redirect(array('admin/survey/sa/listquestions/surveyid/' . $surveyid ));
}
Expand Down
12 changes: 7 additions & 5 deletions application/views/survey/questions/multiplenumeric/footer.php
Expand Up @@ -10,6 +10,7 @@
* @var $sumEqn $qinfo['sumEqn']
*/
?>

<?php if($equals_num_value):?>
<p class='multiplenumerichelp help-item text-info'>
<span class="label">
Expand All @@ -23,14 +24,15 @@
<?php endif; ?>

<?php if($displaytotal):?>
<p class='multiplenumerichelp help-item text-info'>
<span class=""><?php eT('Total: '); ?></span>

<li class='multiplenumerichelp help-item'>
<span class="label"><?php eT('Total: '); ?></span>
<span id="totalvalue_<?php echo $id; ?>" class="dynamic_sum">
<?php echo $prefix; ?>
{ <?php echo $sumEqn; ?> }
{<?php echo $sumEqn; ?>}
<?php echo $suffix; ?>
</span>
</p>
<?php endif; ?>
</li>
</ul>
<?php endif; ?>
</div> <!-- Footer -->
5 changes: 3 additions & 2 deletions application/views/survey/questions/multiplenumeric/item.php
Expand Up @@ -19,14 +19,14 @@
*/
?>
<!-- question attribute "display_rows" is set -> we need a textarea to be able to show several rows -->
<li class="question-item answer-item text-item <?php echo $extraclass;?>" <?php echo $sDisplayStyle;?>>
<li id='javatbd<?php echo $myfname; ?>' class="question-item answer-item numeric-item text-item <?php echo $extraclass;?>" <?php echo $sDisplayStyle;?>>
<?php if($alert):?>
<div class="alert alert-danger errormandatory" role="alert">
<?php echo $labelText;?>
</div> <!-- alert -->
<?php endif;?>
<div class="form-group-row row">
<label class='control-label col-xs-12' for="answer<?php echo $myfname; ?>">
<label class='control-label col-xs-12 numeric-label' for="answer<?php echo $myfname; ?>">
<?php echo $labelText;?>
</label>
<br/><br/><br/>
Expand All @@ -42,6 +42,7 @@ class="text form-control numeric <?php echo $kpclass;?>"
id="answer<?php echo $myfname; ?>"
value="<?php echo $dispVal;?>"
onkeyup="<?php echo $checkconditionFunction; ?>"
title="<?php eT('Only numbers may be entered in this field.'); ?>";
<?php echo $maxlength; ?>
/>
<?php else:?>
Expand Down

0 comments on commit b00911e

Please sign in to comment.