Skip to content

Commit

Permalink
Fixed issue #08677: Submitdate and datestamp are always the same as s…
Browse files Browse the repository at this point in the history
…tartdate

Dev: Who have this idea to believe $_SESSION for date stamp ?
Dev: Get the date with dateShift(date) and fill $_SESSION[$this->sessid]['datestamp'] (needed ? EM allow {DATESTAMP} but replaced by empty string somewhere)
  • Loading branch information
Shnoulle committed Feb 8, 2014
1 parent 0c137af commit 31fa408
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions application/helpers/expressions/em_manager_helper.php
Expand Up @@ -5203,7 +5203,8 @@ private function _UpdateValuesInDatabase($updatedValues, $finished=false)
$setter[] = dbQuoteID('lastpage') . "=" . dbQuoteAll($thisstep);

if ($this->surveyOptions['datestamp'] && isset($_SESSION[$this->sessid]['datestamp'])) {
$setter[] = dbQuoteID('datestamp') . "=" . dbQuoteAll($_SESSION[$this->sessid]['datestamp']);
$_SESSION[$this->sessid]['datestamp']=dateShift(date("Y-m-d H:i:s"), "Y-m-d H:i:s", $this->surveyOptions['timeadjust']);
$setter[] = dbQuoteID('datestamp') . "=" . dbQuoteAll(dateShift(date("Y-m-d H:i:s"), "Y-m-d H:i:s", $this->surveyOptions['timeadjust']));
}
if ($this->surveyOptions['ipaddr']) {
$setter[] = dbQuoteID('ipaddr') . "=" . dbQuoteAll(getIPAddress());
Expand Down Expand Up @@ -5311,7 +5312,7 @@ private function _UpdateValuesInDatabase($updatedValues, $finished=false)
if($this->surveyOptions['datestamp'])
{
// Replace with date("Y-m-d H:i:s") ? See timeadjust
$sQuery .= dbQuoteID('submitdate') . "=" . dbQuoteAll($_SESSION[$this->sessid]['datestamp']);
$sQuery .= dbQuoteID('submitdate') . "=" . dbQuoteAll(dateShift(date("Y-m-d H:i:s"), "Y-m-d H:i:s", $this->surveyOptions['timeadjust']));
}
else
{
Expand Down

0 comments on commit 31fa408

Please sign in to comment.