Skip to content

Commit

Permalink
Fixed issue #18415: Copy Survey: New Title shouldn't be mandatory (#2709
Browse files Browse the repository at this point in the history
)

Co-authored-by: lapiudevgit <devgit@lapiu.biz>
  • Loading branch information
gabrieljenik and lapiudevgit committed Dec 15, 2022
1 parent d92d1ed commit 6c9f25d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions application/controllers/SurveyAdministrationController.php
Expand Up @@ -2104,9 +2104,6 @@ public function actionCopy()
} elseif ($action == 'copysurvey') {
$iSurveyID = sanitize_int(Yii::app()->request->getParam('copysurveylist'));
$aExcludes = array();

$sNewSurveyName = Yii::app()->request->getPost('copysurveyname');

if (Yii::app()->request->getPost('copysurveyexcludequotas') == "1") {
$aExcludes['quotas'] = true;
}
Expand Down Expand Up @@ -2146,6 +2143,12 @@ public function actionCopy()
} else {
Yii::app()->loadHelper('export');
$copysurveydata = surveyGetXMLData($iSurveyID, $aExcludes);
if (empty(Yii::app()->request->getPost('copysurveyname'))) {
$sourceSurvey = Survey::model()->findByPk($iSurveyID);
$sNewSurveyName = $sourceSurvey->currentLanguageSettings->surveyls_title;
} else {
$sNewSurveyName = Yii::app()->request->getPost('copysurveyname');
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions application/views/surveyAdministration/tabCopy_view.php
Expand Up @@ -27,11 +27,11 @@
<div class="form-group">
<label for='copysurveyname' class=" control-label"><?php echo eT("New survey title:"); ?> </label>
<div class="">
<input type='text' id='copysurveyname' size='82' maxlength='200' name='copysurveyname' value='' required="required" class="form-control" />
<input type='text' id='copysurveyname' size='82' maxlength='200' name='copysurveyname' placeholder="<?php eT('Copy original survey title');?>" value='' class="form-control" />
</div>
<div class="">
<p class="form-control-static">
<span class='annotation text-warning'><?php echo gT("Required"); ?> </span>
<span class='annotation text-warning'><?php echo gT("Optional"); ?> </span>
</p>
</div>
</div>
Expand Down

0 comments on commit 6c9f25d

Please sign in to comment.