Skip to content

Commit

Permalink
Fixed issue: When creating a question and the question code was forgo…
Browse files Browse the repository at this point in the history
…tten then the data was lost

Fixed issue: Automatic code counting for labels now working
Fixed issue: When creating a group and the group title was forgotten then the data was lost


git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey@7446 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
c-schmitz committed Aug 11, 2009
1 parent 537b276 commit 9cfc143
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
9 changes: 8 additions & 1 deletion admin/grouphandling.php
Expand Up @@ -32,9 +32,16 @@


// $newgroupoutput .="<table width='100%' border='0' class='tab-page'>\n\t<tr><td>\n"
$newgroupoutput .= "<form action='$scriptname' id ='addnewgroupfrom' name='addnewgroupfrom' method='post'>";
$newgroupoutput .="\n"
. '<div class="tab-pane" id="tab-pane-newgroup">';
$newgroupoutput .= "<form action='$scriptname' id ='addnewgroupfrom' name='addnewgroupfrom' method='post' onsubmit=\"if (1==0 ";

foreach ($grplangs as $grouplang)
{
$newgroupoutput .= "|| document.getElementById('group_name_$grouplang').value.length==0 ";
}
$newgroupoutput .=" ) {alert ('".$clang->gT("Error: You have to enter a group title for each language.",'js')."'); return false;}\" ";

foreach ($grplangs as $grouplang)
{
$newgroupoutput .= '<div class="tab-page"> <h2 class="tab">'.GetLanguageNameFromCode($grouplang,false);
Expand Down
7 changes: 5 additions & 2 deletions admin/labels.php
Expand Up @@ -408,12 +408,13 @@
}

$position=sprintf("%05d", $position);
if (!isset($_SESSION['nextlabelcode'])) $_SESSION['nextlabelcode']='';
if ($activeuse == 0 && $first)
{ $labelsoutput.= "<tr><td><br /></td></tr><tr><td align='right'>"
."<strong>".$clang->gT("New label").":</strong> <input type='text' maxlength='5' name='insertcode' size='6' id='addnewlabelcode' onkeypress=\"return catchenter(event,'addnewlabelbtn');\" />\n"
."<strong>".$clang->gT("New label").":</strong> <input type='text' maxlength='5' name='insertcode' size='6' value='".$_SESSION['nextlabelcode']."' id='addnewlabelcode' onkeypress=\"return catchenter(event,'addnewlabelbtn');\" />\n"
."\t</td>\n"
."<td style='text-align:center;'>"
."<input style='text-align:right;' type='text' maxlength='5' name='insertassessmentvalue' size='6' id='insertassessmentvalue' "
."<input style='text-align:right;' type='text' maxlength='5' name='insertassessmentvalue' size='6' id='insertassessmentvalue' value='0'"
."onkeypress=\" if(event.keyCode==13) {if (event && event.preventDefault) event.preventDefault(); document.getElementById('addnewlabelbtn').click(); return false;} return goodchars(event,'1234567890-')\" />"
."\t</td>\n"
."\t<td>\n"
Expand Down Expand Up @@ -464,6 +465,7 @@
$labelsoutput .= "\t</center></td>\n"
."</tr>\n";
}
unset($_SESSION['nextlabelcode']);
$first=false;
$labelsoutput.="</tbody></table>\n";

Expand Down Expand Up @@ -693,6 +695,7 @@ function modlabelsetanswers($lid)
case $clang->gT("Add new label", "unescaped"):
if (isset($_POST['insertcode']) && $_POST['insertcode']!='')
{
$_SESSION['nextlabelcode']=getNextCode($_POST['insertcode']);
$_POST['insertcode'] = db_quoteall($_POST['insertcode'],true);
// check that the code doesn't exist yet
$query = "SELECT code FROM ".db_table_name('labels')." WHERE lid='$lid' AND code=".$_POST['insertcode'];
Expand Down
2 changes: 1 addition & 1 deletion admin/questionhandling.php
Expand Up @@ -230,7 +230,7 @@
$editquestion .= "<table width='100%' border='0'>\n\t<tr><td class='settingcaption'>";
if (!$adding) {$editquestion .=$clang->gT("Edit question");} else {$editquestion .=$clang->gT("Add a new question");};
$editquestion .= "</td></tr></table>\n"
. "<form name='frmeditquestion' id='frmeditquestion' action='$scriptname' method='post'>\n"
. "<form name='frmeditquestion' id='frmeditquestion' action='$scriptname' method='post' onsubmit=\"return isEmpty(document.getElementById('title'), '".$clang->gT("Error: You have to enter a question code.",'js')."');\">\n"
. '<div class="tab-pane" id="tab-pane-editquestion-'.$surveyid.'">';

if (!$adding)
Expand Down

0 comments on commit 9cfc143

Please sign in to comment.