Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issue #18630: Survey list showing wrong icon for surveys. #2960

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions application/models/Survey.php
Expand Up @@ -1154,16 +1154,16 @@ public function getRunning()
// If it's active, then we check if not expired
// Time adjust
$sNow = date("Y-m-d H:i:s", strtotime(Yii::app()->getConfig('timeadjust'), strtotime(date("Y-m-d H:i:s"))));
$sStop = ($this->expires != '') ? date("Y-m-d H:i:s", strtotime(Yii::app()->getConfig('timeadjust'), strtotime($this->expires))) : $sNow;
$sStart = ($this->startdate != '') ? date("Y-m-d H:i:s", strtotime(Yii::app()->getConfig('timeadjust'), strtotime($this->startdate))) : $sNow;
$sStop = ($this->expires != '') ? date("Y-m-d H:i:s", strtotime(Yii::app()->getConfig('timeadjust'), strtotime($this->expires))) : null;
$sStart = ($this->startdate != '') ? date("Y-m-d H:i:s", strtotime(Yii::app()->getConfig('timeadjust'), strtotime($this->startdate))) : null;

// Time comparaison
$oNow = new DateTime($sNow);
$oStop = new DateTime($sStop);
$oStart = new DateTime($sStart);

$bExpired = ($oStop < $oNow);
$bWillRun = ($oStart > $oNow);
$bExpired = (!is_null($sStop) && $oStop < $oNow);
Shnoulle marked this conversation as resolved.
Show resolved Hide resolved
$bWillRun = (!is_null($sStart) && $oStart > $oNow);

$sStop = $sStop != null ? convertToGlobalSettingFormat($sStop) : null;
$sStart = convertToGlobalSettingFormat($sStart);
Expand All @@ -1179,7 +1179,7 @@ public function getRunning()
// Expire prior to will start
$running = ($bExpired) ? $sIconExpired : $sIconFuture;
} else {
if ($this->expires == '') {
if (is_null($sStop)) {
$running = $sIconRunNoEx;
} else {
$running = $sIconRunning;
Expand Down