Skip to content

Commit

Permalink
Fixed issue #09803: When importing token data from CSV file the remin…
Browse files Browse the repository at this point in the history
…der date is ignored

Dev: in $aReplacedFields ...
  • Loading branch information
Shnoulle committed Jul 31, 2015
1 parent 71ec2ac commit b9754d4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions application/controllers/admin/tokens.php
Expand Up @@ -2031,11 +2031,14 @@ function import($iSurveyId)
// Parse first line (header) from CSV
$buffer = removeBOM($buffer);
// We alow all field except tid because this one is really not needed.
$aAllowedFieldNames = array('participant_id','firstname','lastname','email','emailstatus','token','language','blacklisted','sent','remindersent','remindercount','validfrom','validuntil','completed','usesleft');
$aAllowedFieldNames = array_merge($aAttrFieldNames, $aAllowedFieldNames);
$aAllowedFieldNames=Token::model($iSurveyId)->tableSchema->getColumnNames();
if(($kTid = array_search('tid', $aAllowedFieldNames)) !== false) {
unset($aAllowedFieldNames[$kTid]);
}
// Some header don't have same column name
$aReplacedFields=array(
'invited'=>'sent'
'invited'=>'sent',
'reminded'=>'remindersent',
);
switch ($sSeparator)
{
Expand Down Expand Up @@ -2178,7 +2181,6 @@ function import($iSurveyId)
{
$oToken->$key=$value;
}

if (!$oToken->save())
{
tracevar($oToken->getErrors());
Expand Down

0 comments on commit b9754d4

Please sign in to comment.