Skip to content

Commit

Permalink
Fixed issue #6862: Question cannot be copied to different group
Browse files Browse the repository at this point in the history
  • Loading branch information
c-schmitz committed Nov 14, 2012
1 parent c5fca97 commit 0e59ff3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions application/controllers/admin/database.php
Expand Up @@ -362,6 +362,10 @@ function index($sa = null)

if (in_array($action, array('insertquestion', 'copyquestion')) && hasSurveyPermission($surveyid, 'surveycontent','create'))
{
if ($action=='copyquestion')
{
$gid=intval(Yii::app()->request->getPost('copygid'));
}
$baselang = Survey::model()->findByPk($surveyid)->language;
if (strlen(Yii::app()->request->getPost('title')) < 1)
{
Expand All @@ -371,8 +375,6 @@ function index($sa = null)
}
else
{
if (!Yii::app()->request->getPost('lid') || Yii::app()->request->getPost('lid') == '') {$_POST['lid']="0";}
if (!Yii::app()->request->getPost('lid1') || Yii::app()->request->getPost('lid1') == '') {$_POST['lid1']="0";}
if (Yii::app()->request->getPost('questionposition',"")!="")
{
$question_order= intval(Yii::app()->request->getPost('questionposition'));
Expand Down
2 changes: 1 addition & 1 deletion application/helpers/qanda_helper.php
Expand Up @@ -3696,7 +3696,7 @@ function do_numerical($ia)
$tiwidth=10;
}

if (trim($aQuestionAttributes['num_value_int_only'])==1)
if (trim($aQuestionAttributes['num_value_int_only'])==1 && is_float($_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$ia[1]]))
{
$acomma="";
$extraclass .=" integeronly";
Expand Down
4 changes: 2 additions & 2 deletions application/views/admin/survey/Question/editQuestion_view.php
Expand Up @@ -138,8 +138,8 @@
<?php if ($activated != "Y")
{ ?>
<li>
<label for='gid'><?php $clang->eT("Question group:"); ?></label>
<select name='gid' id='gid'>
<label for='copygid'><?php $clang->eT("Question group:"); ?></label>
<select name='copygid' id='copygid'>

<?php echo getGroupList3($eqrow['gid'],$surveyid); ?>
</select></li>
Expand Down

0 comments on commit 0e59ff3

Please sign in to comment.