--- admin/dataentry.php 2010-09-13 21:56:08.000000000 +0200 +++ admin/dataentry.php.new 2010-09-13 21:56:06.000000000 +0200 @@ -67,9 +67,9 @@ $actsurresult = db_execute_assoc($actsurquery) or safe_die($connect->ErrorMsg()); $actsurrows = $actsurresult->FetchRow(); + if ($_SESSION['USER_RIGHT_SUPERADMIN'] == 1 || $actsurrows['browse_response']) { - $surveyoptions = browsemenubar($clang->gT("Browse Responses")); if (!$surveyid && !$subaction) { @@ -221,9 +221,10 @@ $values=array(); $_POST['startlanguage']=$baselang; $_POST['startdate']=$_POST['datestamp']; - foreach ($fieldmap as $irow) + foreach ($fieldmap as $irow) { $fieldname = $irow['fieldname']; + if (isset($_POST[$fieldname])) { if ($_POST[$fieldname] == "" && ($irow['type'] == 'D' || $irow['type'] == 'N' || $irow['type'] == 'K')) @@ -669,7 +670,7 @@ ."\$b=i;\n" ."\$b += '';\n" ."\$inputname=\"RANK_$thisqid\"+\$b;\n" - ."\$hiddenname=\"d$myfname\"+\$b;\n" + ."\$hiddenname=\"$myfname\"+\$b;\n" ."\$cutname=\"cut_$thisqid\"+i;\n" ."document.getElementById(\$cutname).style.display='none';\n" ."if (!document.getElementById(\$inputname).value)\n" @@ -704,13 +705,13 @@ ."\tif (cutindex > 1)\n" ."{\n" ."\$cut1name=\"cut_$thisqid\"+(cutindex-1);\n" - ."\$cut2name=\"d$myfname\"+(cutindex);\n" + ."\$cut2name=\"$myfname\"+(cutindex);\n" ."document.getElementById(\$cut1name).style.display='';\n" ."document.getElementById(\$cut2name).value='';\n" ."}\n" ."\telse\n" ."{\n" - ."\$cut2name=\"d$myfname\"+(cutindex);\n" + ."\$cut2name=\"$myfname\"+(cutindex);\n" ."document.getElementById(\$cut2name).value='';\n" ."}\n" ."\tvar i=document.getElementById('CHOICES_$thisqid').options.length;\n" @@ -756,7 +757,7 @@ $ranklist .= " value='".$thistext."'"; } $ranklist .= " onFocus=\"this.blur()\" />\n" - . "
\n\n"; + $ranklist .= " id='cut_$thisqid$j' onclick=\"deletethis_$thisqid(document.editresponse.RANK_$thisqid$j.value, document.editresponse.$myfname$j.value, document.editresponse.RANK_$thisqid$j.id, this.id)\" />
\n\n"; } if (!isset($choicelist)) {$choicelist="";} @@ -1839,7 +1840,7 @@ ."\$b=i;\n" ."\$b += '';\n" ."\$inputname=\"RANK_$thisqid\"+\$b;\n" - ."\$hiddenname=\"d$fieldname\"+\$b;\n" + ."\$hiddenname=\"$fieldname\"+\$b;\n" ."\$cutname=\"cut_$thisqid\"+i;\n" ."document.getElementById(\$cutname).style.display='none';\n" ."if (!document.getElementById(\$inputname).value)\n" @@ -1874,13 +1875,13 @@ ."\tif (cutindex > 1)\n" ."{\n" ."\$cut1name=\"cut_$thisqid\"+(cutindex-1);\n" - ."\$cut2name=\"d$fieldname\"+(cutindex);\n" + ."\$cut2name=\"$fieldname\"+(cutindex);\n" ."document.getElementById(\$cut1name).style.display='';\n" ."document.getElementById(\$cut2name).value='';\n" ."}\n" ."\telse\n" ."{\n" - ."\$cut2name=\"d$fieldname\"+(cutindex);\n" + ."\$cut2name=\"$fieldname\"+(cutindex);\n" ."document.getElementById(\$cut2name).value='';\n" ."}\n" ."\tvar i=document.getElementById('CHOICES_$thisqid').options.length;\n" @@ -1933,7 +1934,7 @@ $ranklist .= "'"; } $ranklist .= " onFocus=\"this.blur()\" />\n"; - $ranklist .= "
\n\n"; + $ranklist .= " id='cut_$thisqid$i' onclick=\"deletethis_$thisqid(document.addsurvey.RANK_$thisqid$i.value, document.addsurvey.$fieldname$i.value, document.addsurvey.RANK_$thisqid$i.id, this.id)\" />
\n\n"; } if (!isset($choicelist)) {$choicelist="";} $choicelist .= "