Fix warning on late surveys

This commit is contained in:
Laurent Destailleur 2017-11-24 10:06:42 +01:00
parent 6d5f2b2f21
commit 8450c78dff
3 changed files with 5 additions and 5 deletions

View File

@ -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 '</td></tr>';

View File

@ -211,7 +211,7 @@ while ($i < min($num,$limit))
print'<td align="right">'.$nbuser.'</td>'."\n";
print '<td align="center">'.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 '</td>';
print'<td align="center">'.$opensurvey_static->getLibStatut(5).'</td>'."\n";

View File

@ -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 = '<a href="'.DOL_URL_ROOT.'/opensurvey/list.php">'.$langs->trans("BackToList").'</a>';
$linkback = '<a href="'.DOL_URL_ROOT.'/opensurvey/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($object, 'id', $linkback, 1, 'id_sondage', 'id_sondage', $morehtmlref);