Skip to content

Commit

Permalink
Fixed issue #6881: SQL Error when sending e-mail invite from survey t…
Browse files Browse the repository at this point in the history
…okens/participants list and using MSSQL
  • Loading branch information
c-schmitz committed Nov 15, 2012
1 parent b776008 commit 67da66a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion application/controllers/admin/tokens.php
Expand Up @@ -1442,7 +1442,7 @@ function email($iSurveyId, $tokenids = null)
//Update central participant survey_links
if(!empty($emrow['participant_id']))
{
$slquery = Survey_links::model()->find('participant_id = "'.$emrow['participant_id'].'" AND survey_id = '.$iSurveyId.' AND token_id = '.$emrow['tid']);
$slquery = Survey_links::model()->find('participant_id = :pid AND survey_id = :sid AND token_id = :tid',array(':pid'=>$emrow['participant_id'],':sid'=>$iSurveyId,':tid'=>$emrow['tid']));
$slquery->date_invited = dateShift(date("Y-m-d H:i:s"), "Y-m-d H:i", Yii::app()->getConfig("timeadjust"));
$slquery->save();
}
Expand Down
4 changes: 2 additions & 2 deletions application/helpers/frontend_helper.php
Expand Up @@ -904,7 +904,7 @@ function submittokens($quotaexit=false)
if(!empty($participant_id))
{
//Update the survey_links table if necessary
$slquery = Survey_links::model()->find('participant_id = "'.$participant_id.'" AND survey_id = '.$surveyid.' AND token_id = '.$token_id);
$slquery = Survey_links::model()->find('participant_id = :pid AND survey_id = :sid AND token_id = :tid', array(':pid'=>$participant_id, ':sid'=>$surveyid, ':tid'=>$token_id));
if (!is_null($slquery))
{
$slquery->date_completed = $today;
Expand All @@ -925,7 +925,7 @@ function submittokens($quotaexit=false)
if(!empty($participant_id))
{
//Update the survey_links table if necessary, to protect anonymity, use the date_created field date
$slquery = Survey_links::model()->find('participant_id = "'.$participant_id.'" AND survey_id = '.$surveyid.' AND token_id = '.$token_id);
$slquery = Survey_links::model()->find('participant_id = :pid AND survey_id = :sid AND token_id = :tid', array(':pid'=>$participant_id, ':sid'=>$surveyid, ':tid'=>$token_id));
$slquery->date_completed = $slquery->date_created;
$slquery->save();
}
Expand Down

0 comments on commit 67da66a

Please sign in to comment.