Skip to content

Commit

Permalink
Fixed issue #10218 : mandatory validation when index is active
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Feb 1, 2016
1 parent 075014a commit 5c1e975
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
17 changes: 7 additions & 10 deletions application/helpers/SurveyRuntimeHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,18 @@ protected function createFullQuestionIndexByGroupMenu($LEMsessid)
// Button will be shown inside the form. Not handled by replacement.
$htmlButtons = array();
$html = '';
$html .= "\n\n<!-- PRESENT THE INDEX -->\n";
$html .= CHtml::openTag('li', array('id' => 'index', 'class'=>'dropdown'));
$html .= "\n\n<!-- PRESENT THE INDEX MENU -->\n";
$html .= CHtml::openTag('li', array('id' => 'index-menu', 'class'=>'dropdown'));
$html .= CHtml::link(gT("Question index").'&nbsp<span class="caret"></span>', array('#'), array('class'=>'dropdown-toggle', 'data-toggle'=>"dropdown", 'role'=>"button", 'aria-haspopup'=>"true", 'aria-expanded'=>"false"));
$html .= CHtml::openTag('ul', array('class'=>'dropdown-menu'));
foreach ($_SESSION[$LEMsessid]['grouplist'] as $key => $group)
{
// echo '<script>';
// echo 'var session = '. json_encode(LimeExpressionManager::singleton()->_ValidateGroup($key)) . ';';
// echo 'console.log(session);';
// echo '</script>';
// Better to use tracevar /

if (LimeExpressionManager::GroupIsRelevant($group['gid']))
{
$group['step'] = $key + 1;
$stepInfo = LimeExpressionManager::singleton()->_ValidateGroup($key);
$classes = implode(' ', array(
'row',
$stepInfo['anyUnanswered'] ? 'missing' : '',
$_SESSION[$LEMsessid]['step'] == $group['step'] ? 'current' : ''

));
Expand All @@ -65,12 +59,15 @@ protected function createFullQuestionIndexByGroupMenu($LEMsessid)
$html .= CHtml::openTag('li');
$html .= CHtml::link($group['group_name'], array('#'), array('class'=>'linkToButton', 'data-button-to-click'=>'#button-'.$group['gid'], ));
$html .= CHtml::closeTag('li');

}
}


$html .= CHtml::closeTag('ul');
$html .= CHtml::closeTag('li');

App()->getClientScript()->registerScript('manageIndex',"manageIndex()\n",CClientScript::POS_END);
//App()->getClientScript()->registerScript('manageIndex',"manageIndex()\n",CClientScript::POS_END);

return array('menulist'=>$html, 'buttons'=>$htmlButtons );
}
Expand Down
1 change: 0 additions & 1 deletion application/helpers/replacements_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,6 @@ function doHtmlSaveAll($move="")
$aHtmlOptionsLoadall=array('type'=>'submit','id'=>'loadallbtn','value'=>'loadall','name'=>'loadall','class'=>"saveall btn btn-default col-xs-12 col-sm-4 submit button hidden");
$aHtmlOptionsSaveall=array('type'=>'submit','id'=>'saveallbtn','value'=>'saveall','name'=>'saveall','class'=>"saveall btn btn-default col-xs-12 col-sm-4 submit button hidden");
if($thissurvey['active'] != "Y")
{
$sLoadButton=CHtml::htmlButton(gT("Load unfinished survey"),$aHtmlOptionsLoadall);
$sSaveButton=CHtml::htmlButton(gT("Resume later"),$aHtmlOptionsSaveall);
}
Expand Down

0 comments on commit 5c1e975

Please sign in to comment.