Skip to content

Commit

Permalink
Feature request #8596: Allow empty dates for RemoteControl add_respon…
Browse files Browse the repository at this point in the history
…se call
  • Loading branch information
Nate Baker committed Feb 14, 2014
1 parent 691e3cd commit 514a78f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions application/helpers/remotecontrol/remotecontrol_handle.php
Expand Up @@ -2186,16 +2186,22 @@ public function add_response($sSessionKey, $iSurveyID, $aResponseData)
//set required values if not set

// @todo: Some of this is part of the validation and should be done in the model instead
if (!isset($aResponseData['submitdate']))
if (array_key_exists('submitdate', $aResponseData) && empty($aResponseData['submitdate']))
unset($aResponseData['submitdate']);
else if (!isset($aResponseData['submitdate']))
$aResponseData['submitdate'] = date("Y-m-d H:i:s");
if (!isset($aResponseData['startlanguage']))
$aResponseData['startlanguage'] = getBaseLanguageFromSurveyID($iSurveyID);

if ($oSurvey->datestamp=='Y')
{
if (!isset($aResponseData['datestamp']))
if (array_key_exists('datestamp', $aResponseData) && empty($aResponseData['datestamp']))
unset($aResponseData['datestamp']);
else if (!isset($aResponseData['datestamp']))
$aResponseData['datestamp'] = date("Y-m-d H:i:s");
if (!isset($aResponseData['startdate']))
if (array_key_exists('startdate', $aResponseData) && empty($aResponseData['startdate']))
unset($aResponseData['startdate']);
else if (!isset($aResponseData['startdate']))
$aResponseData['startdate'] = date("Y-m-d H:i:s");
}

Expand Down

0 comments on commit 514a78f

Please sign in to comment.