Skip to content

Commit

Permalink
Fixed issue: Copy survey function throws strange error if no survey i…
Browse files Browse the repository at this point in the history
…s selected or no survey name is set

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey@9060 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
c-schmitz committed Aug 12, 2010
1 parent 384a07d commit 4d60bd4
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
2 changes: 2 additions & 0 deletions admin/html.php
Expand Up @@ -3153,6 +3153,8 @@
. "".$clang->gT("Create, import or copy survey")."</div>\n";

$newsurvey .="<script type=\"text/javascript\">
sSelectASurveyMessage='".$clang->gT('Error: You have to select a survey to copy.','js')."';
sSelectASurveyName='".$clang->gT('Error: You have to enter a title for this survey.','js')."';
standardtemplaterooturl='$standardtemplaterooturl';
templaterooturl='$usertemplaterooturl'; \n";
$newsurvey .= "</script>\n";
Expand Down
21 changes: 20 additions & 1 deletion admin/scripts/surveysettings.js
Expand Up @@ -3,6 +3,7 @@
$(document).ready(function(){
$("#template").change(templatechange);
$("#template").keyup(templatechange);
$("#copysurveyform").submit(copysurvey);
});

function templatechange()
Expand All @@ -14,10 +15,28 @@ function templatechange()
}
else
{
$("#preview").attr('src',templaterooturl+'/'+this.value+'/preview.png');
$("#preview").attr('src',templaterooturl+'/'+this.value+'/preview.png');
}
}

function copysurvey()
{
sMessage='';
if ($('#copysurveylist').val()=='')
{
sMessage = sMessage+sSelectASurveyMessage;
}
if ($('#copysurveyname').val()=='')
{
sMessage = sMessage+'\n\r'+sSelectASurveyName;
}
if (sMessage!='')
{
alert(sMessage);
return false;
}
}

function in_array (needle, haystack, argStrict) {

var key = '', strict = !!argStrict;
Expand Down
2 changes: 1 addition & 1 deletion common.php
Expand Up @@ -810,7 +810,7 @@ function getsurveylist($returnarray=false,$returnwithouturl=false)
}
if (!isset($svexist))
{
$surveyselecter = "<option selected='selected'>".$clang->gT("Please Choose...")."</option>\n".$surveyselecter;
$surveyselecter = "<option selected='selected' value=''>".$clang->gT("Please Choose...")."</option>\n".$surveyselecter;
} else
{
if ($returnwithouturl===false)
Expand Down

0 comments on commit 4d60bd4

Please sign in to comment.