Skip to content

Commit

Permalink
Dev: Some merge fixes (WIP)
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Jun 19, 2018
1 parent a4ec6d9 commit 8c2cc94
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 20 deletions.
3 changes: 1 addition & 2 deletions application/controllers/admin/questions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1055,8 +1055,6 @@ public function newquestion($surveyid)
$aViewUrls = [];
$aViewUrls['editQuestion_view'][] = $aData;
App()->getClientScript()->registerScript("EditQuestionView_question_jsviews_".$surveyid.$oQuestion->gid.'new', "OtherSelection('".$oQuestion->type."');", LSYii_ClientScript::POS_POSTSCRIPT);



$this->_renderWrappedTemplate('survey/Question', $aViewUrls, $aData);
}
Expand Down Expand Up @@ -1264,6 +1262,7 @@ public function index($sa, $surveyid, $gid, $qid = null)

$aData['addlanguages'] = $oSurvey->additionalLanguages;

$aData['aQuestionTemplateList'] = \QuestionTemplate::getQuestionTemplateList($oQuestion->type);
$aViewUrls['editQuestion_view'][] = $aData;
App()->getClientScript()->registerScript("EditQuestionView_question_jsviews_".$surveyid.$gid.$qid, "OtherSelection('".$oQuestion->type."');", LSYii_ClientScript::POS_POSTSCRIPT);
} else {
Expand Down
2 changes: 1 addition & 1 deletion application/models/Question.php
Original file line number Diff line number Diff line change
Expand Up @@ -882,4 +882,4 @@ public function insertRecords($data)
}
Yii::log(\CVarDumper::dumpAsString($oRecord->getErrors()), 'warning', 'application.models.Question.insertRecords');
}
}
}
27 changes: 10 additions & 17 deletions application/views/admin/survey/Question/editQuestion_view.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@
'debugKeyCheck' => "Type: ",
'previewWindowTitle' => "Preview question type",
'groupStructureArray' => $aQuestionTypeGroups,
'value' => $eqrow['type'],
'value' => $oQuestion->type,
'debug' => YII_DEBUG,
'currentSelected' => Question::getQuestionTypeName($eqrow['type']),
'currentSelected' => Question::getQuestionTypeName($oQuestion->type),
'optionArray' => [
'selectedClass' => Question::getQuestionClass($eqrow['type']),
'selectedClass' => Question::getQuestionClass($oQuestion->type),
'onUpdate' => [
'value',
"console.ls.log(value); $('#question_type').val(value);"
Expand Down Expand Up @@ -224,32 +224,25 @@
<?php //elseif($activated != "Y" && (isset($selectormodeclass) && $selectormodeclass == "none")): ?>


<div class="form-group">
<div class="form-group">
<?php if( $activated != "Y") : ?>
<input type="hidden" id="question_type" name="type" value="<?php echo $oQuestion->type; ?>" />

<?php if( !$oSurvey->isActive && isset($selectormodeclass) && $selectormodeclass != "none"): ?>
<?=$oQuestionSelector->getButtonOrSelect();?>
<label class=" control-label" for="question_type_button" title="<?php eT("Question type");?>" data-gethelp='{ "title":"Get help", "text" : "More on questions", "href":"https://manual.limesurvey.org/Questions_-_introduction" }' data-help="<?=gT("Select the question type here.")?>">
<?=Question::getQuestionTypeName($oQuestion->type); ?>
Type code: <?php echo $oQuestion->type; ?>
<?php elseif(!$oSurvey->isActive && (isset($selectormodeclass) && $selectormodeclass == "none")): ?>
$selected = $oQuestion->type == $sQuestionTypeKey ? 'selected' : '';
<?php elseif($oSurvey->isActive) : ?>
<input type="hidden" id="question_type" name="type" value="<?php echo $oQuestion->type; ?>" />
<?=$oQuestionSelector->getButtonOrSelect();?>
<?php elseif($activated == "Y") : ?>
<input type="hidden" id="question_type" name="type" value="<?php echo $eqrow['type']; ?>" />
<!-- TODO : control if we can remove, disable update type must be done by PHP -->
<label class=" control-label" for="question_type_button" title="<?php eT("Question type");?>">
<?php
eT("Question type:");
eT("Question type:");
?>
</label>
<div class=" btn-group" id="question_type_button">
<button type="button" class="btn btn-default" disabled aria-haspopup="true" aria-expanded="false" >
<span class="buttontext" id="selector__editView_question_type_description">
<?=Question::getQuestionTypeName($oQuestion->type); ?>
<?=Question::getQuestionTypeName($eqrow['type']); ?>
<?php if(YII_DEBUG):?>
<em class="small">
Type code: <?php echo $oQuestion->type; ?>
Type code: <?php echo $eqrow['type']; ?>
</em>
<?php endif;?>
</span>
Expand Down

0 comments on commit 8c2cc94

Please sign in to comment.