Participant has completed survey - fix getting proper information

This commit is contained in:
Meritoo
2017-10-22 18:18:16 +02:00
parent ddb568adf7
commit 626174953b
2 changed files with 7 additions and 2 deletions

View File

@@ -199,7 +199,12 @@ class Participant extends BaseItem
break; break;
case 'completed': case 'completed':
$this->completed = 'Y' === trim(strtoupper($value)); if ('N' === trim(strtoupper($value))) {
$this->completed = false;
break;
}
$this->completed = Date::isValidDate($value, true);
break; break;
case 'usesleft': case 'usesleft':

View File

@@ -200,7 +200,7 @@ class ParticipantTest extends BaseTestCase
'sent' => 'Y', 'sent' => 'Y',
'remindersent' => 'N', 'remindersent' => 'N',
'remindercount' => 1, 'remindercount' => 1,
'completed' => 'Y', 'completed' => (new DateTime())->format('Y-m-d H:i'),
'usesleft' => 5, 'usesleft' => 5,
'validfrom' => (new DateTime())->format('Y-m-d H:i:s'), 'validfrom' => (new DateTime())->format('Y-m-d H:i:s'),
'validuntil' => null, 'validuntil' => null,