diff --git a/htdocs/opensurvey/card.php b/htdocs/opensurvey/card.php
index 2768b32ba3f..fda06d67012 100644
--- a/htdocs/opensurvey/card.php
+++ b/htdocs/opensurvey/card.php
@@ -310,7 +310,7 @@ if ($action == 'edit') print $form->select_date($expiredate?$expiredate:$object-
else
{
print dol_print_date($object->date_fin,'day');
- if ($object->date_fin && $object->date_fin < dol_now()) print img_warning($langs->trans("Expired"));
+ if ($object->date_fin && $object->date_fin < dol_now() && $object->status == Opensurveysondage::STATUS_VALIDATED) print img_warning($langs->trans("Expired"));
}
print '';
diff --git a/htdocs/opensurvey/list.php b/htdocs/opensurvey/list.php
index 41ae2778080..9d0f2c1ed13 100644
--- a/htdocs/opensurvey/list.php
+++ b/htdocs/opensurvey/list.php
@@ -211,7 +211,7 @@ while ($i < min($num,$limit))
print'
'.$nbuser.' | '."\n";
print ''.dol_print_date($db->jdate($obj->date_fin),'day');
- if ($db->jdate($obj->date_fin) < time()) { print img_warning($langs->trans("Expired")); }
+ if ($db->jdate($obj->date_fin) < $now && $obj->status == Opensurveysondage::STATUS_VALIDATED) { print img_warning($langs->trans("Expired")); }
print ' | ';
print''.$opensurvey_static->getLibStatut(5).' | '."\n";
diff --git a/htdocs/opensurvey/results.php b/htdocs/opensurvey/results.php
index 49f26e47cb0..cd6e6ed3225 100644
--- a/htdocs/opensurvey/results.php
+++ b/htdocs/opensurvey/results.php
@@ -389,13 +389,13 @@ for ($i = 0; $i < $nbcolonnes; $i++)
* View
*/
+$form=new Form($db);
+
if ($object->fk_user_creat) {
$userstatic = new User($db);
$userstatic->fetch($object->fk_user_creat);
}
-$form=new Form($db);
-
$result=$object->fetch(0,$numsondage);
if ($result <= 0)
{
@@ -430,7 +430,7 @@ dol_fiche_head($head,'preview',$langs->trans("Survey"), -1, DOL_URL_ROOT.'/opens
$morehtmlref = '';
-$linkback = ''.$langs->trans("BackToList").'';
+$linkback = ''.$langs->trans("BackToList").'';
dol_banner_tab($object, 'id', $linkback, 1, 'id_sondage', 'id_sondage', $morehtmlref);