Skip to content

Commit

Permalink
Merge branch 'master' into 192_dev
Browse files Browse the repository at this point in the history
  • Loading branch information
TMSWhite committed Jun 18, 2012
2 parents 21f0070 + 9e80a50 commit 3a3e2b8
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 21 deletions.
2 changes: 1 addition & 1 deletion admin/tokens.php
Original file line number Diff line number Diff line change
Expand Up @@ -1230,7 +1230,7 @@
$tokenoutput .= "<td align='left' style='white-space:nowrap;'>\n";
if (bHasSurveyPermission($surveyid, 'tokens','update'))
{
if (($brow['completed'] == "N" || $brow['completed'] == "") &&$brow['token'])
if ((($brow['completed'] == "N" || $brow['completed'] == "") && $brow['token']) || $thissurvey['alloweditaftercompletion']=='Y')
{
$toklang = ($brow['language'] == '') ? $baselanguage : $brow['language'];
$tokenoutput .= "<input style='height: 16; width: 16px; font-size: 8; font-family: verdana' type='image' src='$imageurl/do_16.png' title='"
Expand Down
40 changes: 22 additions & 18 deletions classes/expressions/LimeExpressionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ public static function ConvertConditionsToRelevance($surveyId=NULL, $qid=NULL)
$_qid = $row['qid'];
$_scenario = $row['scenario'];
$_cqid = $row['cqid'];
$_fieldname = -1;
$_subqid = -1;
$relAndList = array();
$relOrList = array();
$scenarios = array();
Expand All @@ -816,43 +816,47 @@ public static function ConvertConditionsToRelevance($surveyId=NULL, $qid=NULL)
$relOrList = array();
$_scenario = $row['scenario'];
$_cqid = $row['cqid'];
$_fieldname = -1;
$_subqid = -1;
}
if ($row['cqid'] != $_cqid)
{
$relAndList[] = '(' . implode(' or ', $relOrList) . ')';
$relOrList = array();
$_cqid = $row['cqid'];
$_fieldname = -1;
$_subqid = -1;
}

// fix fieldnames
if ($row['type'] == '' && preg_match('/^{.+}$/',$row['cfieldname'])) {
$fieldname = substr($row['cfieldname'],1,-1); // {TOKEN:xxxx}
$subqid = $fieldname;
$value = $row['value'];
}
else if ($row['type'] == 'M' || $row['type'] == 'P') {
if (substr($row['cfieldname'],0,1) == '+') {
// if prefixed with +, then a fully resolved name
$fieldname = substr($row['cfieldname'],1) . '.NAOK';
$value = $row['value'];
}
else {
// else create name by concatenating two parts together
$fieldname = $row['cfieldname'] . $row['value'] . '.NAOK';
$value = 'Y';
}
if (substr($row['cfieldname'],0,1) == '+') {
// if prefixed with +, then a fully resolved name
$fieldname = substr($row['cfieldname'],1) . '.NAOK';
$subqid = $fieldname;
$value = $row['value'];
}
else {
$fieldname = $row['cfieldname'] . '.NAOK';
$value = $row['value'];
// else create name by concatenating two parts together
$fieldname = $row['cfieldname'] . $row['value'] . '.NAOK';
$subqid = $row['cfieldname'];
$value = 'Y';
}
}
if ($_fieldname != -1 && $_fieldname != $fieldname)
else {
$fieldname = $row['cfieldname'] . '.NAOK';
$subqid = $fieldname;
$value = $row['value'];
}
if ($_subqid != -1 && $_subqid != $subqid)
{
$relAndList[] = '(' . implode(' or ', $relOrList) . ')';
$relOrList = array();
}
$_fieldname = $fieldname;
$_subqid = $subqid;

// fix values
if (preg_match('/^@\d+X\d+X\d+.*@$/',$value)) {
Expand Down Expand Up @@ -893,7 +897,7 @@ public static function ConvertConditionsToRelevance($surveyId=NULL, $qid=NULL)
$relOrList[] = $fieldname . " " . $row['method'] . " " . $value;
}
}
else
else
{
if ($value == '"0"' || !preg_match('/^".+"$/',$value))
{
Expand Down
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,7 @@
if(($row['submitdate']=='' && $thissurvey['tokenanswerspersistence'] == 'Y' )|| ($row['submitdate']!='' && $thissurvey['alloweditaftercompletion'] == 'Y'))
{
$_SESSION['srid'] = $row['id'];
if (!is_null($row['lastpage']))
if (!is_null($row['lastpage']) && $row['submitdate']=='')
{
$_SESSION['LEMtokenResume'] = true;
$_SESSION['step'] = $row['lastpage'];
Expand Down
2 changes: 1 addition & 1 deletion scripts/modaldialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ function getQueryVariable(variable, url) {
function isValueInArray(arr, val) {
inArray = false;
for (i = 0; i < arr.length; i++) {
if (val === arr[i]) {
if (val.toLowerCase() == arr[i].toLowerCase()) {
inArray = true;
}
}
Expand Down

0 comments on commit 3a3e2b8

Please sign in to comment.