Skip to content

Commit

Permalink
dev Fixed a couple merge issues
Browse files Browse the repository at this point in the history
git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey@8537 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
c-schmitz committed Mar 31, 2010
1 parent f48ee19 commit 1a9e71c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 39 deletions.
2 changes: 1 addition & 1 deletion admin/activate.php
Expand Up @@ -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);
Expand All @@ -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)
{
Expand Down
27 changes: 0 additions & 27 deletions admin/labels.php
Expand Up @@ -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;}
}
Expand Down Expand Up @@ -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());
}
}


?>
2 changes: 1 addition & 1 deletion admin/usercontrol.php
Expand Up @@ -148,7 +148,7 @@
}
$login = true;

$loginsummary .= "<br /><span style='font-weight:bold;'>" .sprintf($clang->gT("Welcome %s!"),$_SESSION['user']) . "</span><br />";
$loginsummary .= "<p><span style='font-weight:bold;'>" .sprintf($clang->gT("Welcome %s!"),$_SESSION['user']) . "</span><br />";
$loginsummary .= $clang->gT("You logged in successfully.");

if (isset($_POST['refererargs']) && $_POST['refererargs'] &&
Expand Down
13 changes: 3 additions & 10 deletions qanda.php
Expand Up @@ -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())
Expand Down Expand Up @@ -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];
}
}
Expand Down

0 comments on commit 1a9e71c

Please sign in to comment.