Skip to content

Commit

Permalink
Fixed issue #10656: Answers list are not editable when survey is acti…
Browse files Browse the repository at this point in the history
…vated
  • Loading branch information
LouisGac committed Mar 3, 2016
1 parent 825384d commit b895f8c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
4 changes: 0 additions & 4 deletions application/controllers/admin/questions.php
Expand Up @@ -419,10 +419,6 @@ public function answeroptions($surveyid, $gid, $qid)
App()->getClientScript()->registerScriptFile( App()->getAssetManager()->publish( ADMIN_SCRIPT_PATH . 'answers.js' ));
App()->getClientScript()->registerPackage('jquery-selectboxes');

//$aData['display']['menu_bars']['surveysummary'] = 'viewgroup';
//$aData['display']['menu_bars']['gid_action'] = 'addquestion';
//$aData['display']['menu_bars']['qid_action'] = 'editansweroptions';

$surveyinfo = Survey::model()->findByPk($surveyid)->surveyinfo;
$aData['title_bar']['title'] = $surveyinfo['surveyls_title']."(".gT("ID").":".$surveyid.")";
$aData['questiongroupbar']['savebutton']['form'] = true;
Expand Down
Expand Up @@ -156,7 +156,7 @@
<?php endif; ?>

<!-- Move icon -->
<?php if ($activated == 'Y' ): ?>
<?php if ($activated == 'Y' && $viewType=='subQuestions' ): ?>
<td>
&nbsp;
</td>
Expand All @@ -171,7 +171,7 @@
/>
<?php echo $title; ?>
</td>
<?php elseif ($activated != 'Y' && $first): // If survey is not activated and first language ?>
<?php elseif (($activated != 'Y' && $first) || ($viewType=='answerOptions' && $first) ): // If survey is not activated and first language ?>
<?php if($title) {$sPattern="^([a-zA-Z0-9]*|{$title})$";}else{$sPattern="^[a-zA-Z0-9]*$";} ?>
<td>
<span class="glyphicon glyphicon-move"></span>
Expand Down Expand Up @@ -305,7 +305,7 @@ class='answer form-control input-lg'

<?php echo getEditor("editanswer","answer_".$row->language."_".$row->qid."_{$row->scale_id}", "[".gT("Subquestion:", "js")."](".$row->language.")",$surveyid,$gid,$qid,'editanswer'); ?>

<?php if ($activated != 'Y' && $first ):?>
<?php if ( ($activated != 'Y' && $first) || ($viewType=='answerOptions' && $first) ):?>
<?php
// TODO : remove this if statement, and merge the two td
// implies : define in controller titles
Expand Down Expand Up @@ -333,7 +333,7 @@ class='answer form-control input-lg'
<span style="display: none" class="relevance"> <?php echo $row->relevance; ?> </span>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
</td>
<?php $position++; ?>

Expand Down
8 changes: 4 additions & 4 deletions application/views/admin/survey/Question/questionbar_view.php
Expand Up @@ -160,10 +160,10 @@ class="btn btn-default"

<!-- Answer Options -->
<?php if( Permission::model()->hasSurveyPermission($surveyid,'surveycontent','read') && $qtypes[$qrrow['type']]['answerscales'] > 0 ):?>
<a class="btn btn-default" href="<?php echo $this->createUrl('admin/questions/sa/answeroptions/surveyid/'.$surveyid.'/gid/'.$gid.'/qid/'.$qid); ?>" role="button">
<span class="icon-defaultanswers"></span>
<?php eT("Edit answer options "); ?>
</a>
<a class="btn btn-default" href="<?php echo $this->createUrl('admin/questions/sa/answeroptions/surveyid/'.$surveyid.'/gid/'.$gid.'/qid/'.$qid); ?>" role="button">
<span class="icon-defaultanswers"></span>
<?php eT("Edit answer options "); ?>
</a>
<?php endif;?>


Expand Down

0 comments on commit b895f8c

Please sign in to comment.