Skip to content

Commit

Permalink
Fixed issue #16561: Batch-editing tokens does not set fields properly…
Browse files Browse the repository at this point in the history
… if "completed", "invitation sent" or "reminder sent" is set to No.

Fixed issue: When editing a token the date/time format is not properly displayed and handled on "invitation sent" or "reminder sent" field and thus wrong values are saved
  • Loading branch information
c-schmitz committed Aug 6, 2020
1 parent 62f988e commit ff3729e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions application/controllers/admin/tokens.php
Expand Up @@ -776,10 +776,12 @@ public function edit($iSurveyId, $iTokenId, $ajax = false)
}

// completed
if (trim($request->getPost('completed')) == 'N') {
if (trim($request->getPost('completed')) == 'N' || trim($request->getPost('completed')) == '') {
$_POST['completed'] = 'N';
} elseif (trim($request->getPost('completed')) == 'Y') {
$_POST['completed'] = 'Y';
} else {
$datetimeobj = new Date_Time_Converter(trim($request->getPost('completed')), $dateformatdetails['phpdate'] . ' H:i');
$datetimeobj = new Date_Time_Converter(trim($request->getPost('completed')), $dateformatdetails['phpdate'] . ' H:i');
$_POST['completed'] = $datetimeobj->convert('Y-m-d H:i');
}

Expand Down

0 comments on commit ff3729e

Please sign in to comment.