View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
08596 | Feature requests | RemoteControl | public | 2014-01-25 06:40 | 2014-09-11 22:46 |
Reporter | Spydre13 | Assigned To | c_schmitz | ||
Priority | normal | Severity | feature | ||
Status | closed | Resolution | fixed | ||
Fixed in Version | 2.05+ | ||||
Summary | 08596: Use add_response to prefill answers (submitdate should be null) | ||||
Description | I would like to do this instead of passing in answers on the URL. This currently doesn't work because in the add_response() function in application/helpers/remotecontrol/remotecontrol_handle.php (around line 2186) it checks if 'submitdate' is not set, and if it's not it gets set to the current time assuming the response is completed. In order to do this it seems like there are a couple options: Currently if you pass in null or '' for the value, the submitdate gets set to all zeros. I think this code could work instead, which would be option #2: if (array_key_exists('submitdate', $aResponseData) && empty($aResponseData['submitdate'])) I have tested this code and it seems to work fine. Same could be done for datestamp and startdate, although those don't matter as much to me. Does this sound reasonable? | ||||
Tags | No tags attached. | ||||
Attached Files | remotecontrol_handle.diff (866 bytes)
--- application/helpers/remotecontrol/remotecontrol_handle.php.bak 2014-01-16 10:33:30.000000000 -0500 +++ application/helpers/remotecontrol/remotecontrol_handle.php 2014-01-25 00:46:08.668829243 -0500 @@ -2183,7 +2183,9 @@ //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); | ||||
Bug heat | 2 | ||||
Story point estimate | |||||
Users affected % | |||||
Date Modified | Username | Field | Change |
---|---|---|---|
2014-01-25 06:40 | Spydre13 | New Issue | |
2014-01-25 06:52 | Spydre13 | File Added: remotecontrol_handle.diff | |
2014-02-01 06:08 | Spydre13 | Issue Monitored: Spydre13 | |
2014-03-26 20:48 | c_schmitz | Assigned To | => c_schmitz |
2014-03-26 20:48 | c_schmitz | Status | new => assigned |
2014-09-11 22:46 | c_schmitz | Status | assigned => closed |
2014-09-11 22:46 | c_schmitz | Resolution | open => fixed |
2014-09-11 22:46 | c_schmitz | Fixed in Version | => 2.05+ |
2021-08-02 17:20 | guest | Bug heat | 0 => 2 |