diff --git a/admin/activate.php b/admin/activate.php index 5d6da0c6646..90f64000283 100644 --- a/admin/activate.php +++ b/admin/activate.php @@ -267,6 +267,7 @@ } else { + $createsurvey=''; //Check for any additional fields for this survey and create necessary fields (token and datestamp) $pquery = "SELECT private, allowregister, datestamp, ipaddr, refurl FROM {$dbprefix}surveys WHERE sid={$postsid}"; $presult=db_execute_assoc($pquery); @@ -292,7 +293,6 @@ } } //Get list of questions for the base language - $createsurvey=''; $fieldmap=createFieldMap($surveyid); foreach ($fieldmap as $arow) //With each question, create the appropriate field(s) { diff --git a/admin/labels.php b/admin/labels.php index 01172e895a1..e9b4e115a46 100644 --- a/admin/labels.php +++ b/admin/labels.php @@ -713,8 +713,6 @@ function modlabelsetanswers($lid) } } - if (isset($_POST['oldcode_'.$codeids[$count]])) update_labelcodes_in_conditions($lid,$_POST['oldcode_'.$codeids[$count]],$_POST['code_'.$codeids[$count]]); - $count++; if ($count>count($codeids)-1) {$count=0;} } @@ -786,32 +784,7 @@ function fixorder($lid) //Function rewrites the sortorder for a group of answers } } -function update_labelcodes_in_conditions($labelid,$oldcode,$newcode) -{ - global $dbprefix, $databasetype, $connect; - if ($oldcode != $newcode) - { - // If question type is not dual scale, then update only if: value is old label code AND question uses the modified label - // If question is Dualscale then check if it uses the modified label as lid or lid1 and check - if ($connect->databaseType == 'odbc_mssql' || $connect->databaseType == 'odbtp' || $connect->databaseType == 'mssql_n') - { - $query = "UPDATE ".db_table_name('conditions') - ." SET value = $newcode " - ." FROM ".db_table_name('conditions')." AS c INNER JOIN " - .db_table_name('questions')." AS q ON c.cqid = q.qid CROSS JOIN ".db_table_name('conditions') - ." WHERE (q.type <> '1') AND (q.lid = 3) AND (c.value = $oldcode) OR" - ." (q.type = '1') AND (q.lid = $labelid) AND (c.value = $oldcode) AND (c.cfieldname LIKE '%#0') OR" - ." (q.type = '1') AND (q.lid1 = $labelid) AND (c.value = $oldcode) AND (c.cfieldname LIKE '%#1')"; - } - else - { - $query = "UPDATE ".db_table_name('conditions')." AS c INNER JOIN ".db_table_name('questions')." AS q ON c.cqid=q.qid SET value=$newcode " - ."WHERE c.value=$oldcode AND ( (q.type <> '1' AND q.lid=$labelid) OR (q.type = '1' AND q.lid=$labelid AND c.cfieldname like '%#0') OR (q.type = '1' AND q.lid1=$labelid AND c.cfieldname like '%#1') )"; - } - $result=$connect->Execute($query) or safe_die($connect->ErrorMsg()); - } -} ?> diff --git a/admin/usercontrol.php b/admin/usercontrol.php index f35de274e20..110b809d9d1 100644 --- a/admin/usercontrol.php +++ b/admin/usercontrol.php @@ -148,7 +148,7 @@ } $login = true; - $loginsummary .= "
" .sprintf($clang->gT("Welcome %s!"),$_SESSION['user']) . "
"; + $loginsummary .= "

" .sprintf($clang->gT("Welcome %s!"),$_SESSION['user']) . "
"; $loginsummary .= $clang->gT("You logged in successfully."); if (isset($_POST['refererargs']) && $_POST['refererargs'] && diff --git a/qanda.php b/qanda.php index 040dc9d81ac..f37743bd6cf 100644 --- a/qanda.php +++ b/qanda.php @@ -352,17 +352,10 @@ function setman_multiflex($ia) global $dbprefix, $connect; - $qq="SELECT lid FROM {$dbprefix}questions WHERE qid={$ia[0]}"; - $qr=db_execute_assoc($qq); - while($qd=$qr->FetchRow()) - { - $lid=$qd['lid']; - } - - $ansquery = "SELECT * FROM {$dbprefix}answers WHERE qid={$ia[0]} AND language='".$_SESSION['s_lang']."' ORDER BY sortorder, answer"; + $ansquery = "SELECT * FROM {$dbprefix}questions WHERE parent_qid={$ia[0]} AND language='".$_SESSION['s_lang']."' and scale_id=0 ORDER BY question_order, title"; $ansresult = db_execute_assoc($ansquery); - $ans2query = "SELECT * FROM {$dbprefix}labels WHERE lid={$lid} AND language='".$_SESSION['s_lang']."' ORDER BY sortorder, title"; + $ans2query = "SELECT * FROM {$dbprefix}questions WHERE parent_qid={$ia[0]} AND language='".$_SESSION['s_lang']."' and scale_id=1 ORDER BY question_order, title"; $ans2result = db_execute_assoc($ans2query); while ($ans2row=$ans2result->FetchRow()) @@ -394,7 +387,7 @@ function setman_multiflex($ia) } else { //There is no array_filter option, so we should definitely add to the mandatory list here! foreach($lset as $ls) { - $mandatorys[]=$ia[1].$ansrow['code']."_".$ls['code']; + $mandatorys[]=$ia[1].$ansrow['title']."_".$ls['title']; $mandatoryfns[]=$ia[1]; } }