Skip to content

Commit

Permalink
Fixed issue #10761: Question index menu doesn't work for this survey …
Browse files Browse the repository at this point in the history
…(incremental index)
  • Loading branch information
LouisGac committed Jun 6, 2016
1 parent 601d757 commit b306501
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions application/helpers/SurveyRuntimeHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ protected function createFullQuestionIndexByGroupMenu($LEMsessid)
// Button will be shown inside the form. Not handled by replacement.
$htmlButtons = array();
$html = '';
$html .= "\n\n<!-- PRESENT THE INDEX MENU -->\n";
$html .= "\n\n<!-- PRESENT THE INDEX MENU (full) -->\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'));
Expand Down Expand Up @@ -90,7 +90,7 @@ protected function createFullQuestionIndexByQuestionMenu($LEMsessid)
protected function createIncrementalQuestionIndexMenu($LEMsessid, $surveyMode)
{
$html = '';
$html .= "\n\n<!-- PRESENT THE INDEX -->\n";
$html .= "\n\n<!-- PRESENT THE INDEX MENU (incremental) -->\n";
$html .= CHtml::openTag('li', array('id' => 'index', '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'));
Expand Down Expand Up @@ -143,14 +143,17 @@ protected function createIncrementalQuestionIndexMenu($LEMsessid, $surveyMode)
if ($surveyMode == 'group')
{
$indexlabel = LimeExpressionManager::ProcessString($g['group_name']);
$sButtonText=gT('Go to this group');
//$sButtonText=gT('Go to this group');
$sButtonText = LimeExpressionManager::ProcessString($g['group_name']);
}
else
{
$indexlabel = LimeExpressionManager::ProcessString($q[3]);
$sButtonText=gT('Go to this question');
//$sButtonText=gT('Go to this question');
$sButtonText= LimeExpressionManager::ProcessString($q[3]);
}


$sText = (($surveyMode == 'group') ? flattenText($indexlabel) : flattenText($indexlabel));
$bGAnsw = !$stepInfo['anyUnanswered'];

Expand All @@ -163,7 +166,12 @@ protected function createIncrementalQuestionIndexMenu($LEMsessid, $surveyMode)
// Button
$htmlButtons[] = CHtml::htmlButton($sButtonText,array('type'=>'submit','value'=>$s,'name'=>'move','class'=>'jshide'));

$html .= '<li><a href="#">'.$sButtonText.'</a></li>';
//$html .= '<li><a href="#">'.$sButtonText.'</a></li>';

$html .= CHtml::openTag('li');
$html .= CHtml::link($sButtonText, array('#'), array('class'=>'linkToButton', 'data-button-to-click'=>'#button-'.$g['gid'], ));
$html .= CHtml::closeTag('li');

}

if ($_SESSION[$LEMsessid]['maxstep'] == $_SESSION[$LEMsessid]['totalsteps'])
Expand Down Expand Up @@ -195,7 +203,7 @@ protected function createFullQuestionIndex($LEMsessid, $surveyMode)

protected function createFullQuestionIndexByGroup($LEMsessid)
{
echo "\n\n<!-- PRESENT THE INDEX -->\n";
echo "\n\n<!-- PRESENT THE INDEX (full) -->\n";
echo CHtml::openTag('div', array('id' => 'index'));
echo CHtml::openTag('div', array('class' => 'container', 'id'=>'indexcontainer'));
echo CHtml::tag('h2', array(), gT("Question index"));
Expand Down Expand Up @@ -246,7 +254,7 @@ protected function createFullQuestionIndexByQuestion($LEMsessid)

protected function createIncrementalQuestionIndex($LEMsessid, $surveyMode)
{
echo "\n\n<!-- PRESENT THE INDEX -->\n";
echo "\n\n<!-- PRESENT THE INDEX (incremental)-->\n";

echo '<div id="index"><div class="container" id="indexcontainer"><h2>' . gT("Question index") . '</h2>';

Expand Down Expand Up @@ -315,7 +323,7 @@ protected function createIncrementalQuestionIndex($LEMsessid, $surveyMode)
echo "<div class=\"row $class\">";
echo "<span class=\"hdr\">$v</span>";
echo "<span title=\"$sText\">$sText</span>";
echo CHtml::htmlButton($sButtonText,array('type'=>'submit','value'=>$s,'name'=>'move','class'=>'jshide'));
echo CHtml::htmlButton($sButtonText,array('type'=>'submit','value'=>$s,'name'=>'move','class'=>'jshide', 'id'=> 'button-'.$g['gid']));
echo "</div>";
}

Expand Down

3 comments on commit b306501

@Shnoulle
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reopen 3b59b81 . Or maybe it's broken before.

@LouisGac
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe just recreate a new bug report about it?

Basically, removing:

indexcontainer {

display: none;

}

show the Index in the old way. So, hidding it in javascript should make it accessible.

@Shnoulle
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, no : OK : deactivate all css : see the real form. I think it was removed now.

Please sign in to comment.