Fix end date of survey (day must be included)

This commit is contained in:
Laurent Destailleur (aka Eldy) 2024-12-16 18:34:21 +01:00
parent 69b30ac8c4
commit 07c2feb69c
2 changed files with 2 additions and 2 deletions

View File

@ -321,7 +321,7 @@ if ($action == 'edit') {
print $form->selectDate($expiredate ? $expiredate : $object->date_fin, 'expire', 0, 0, 0, '', 1, 0);
} else {
print dol_print_date($object->date_fin, 'day');
if ($object->date_fin && $object->date_fin < dol_now() && $object->status == Opensurveysondage::STATUS_VALIDATED) {
if ($object->date_fin && dol_get_last_hour($object->date_fin) < dol_now() && $object->status == Opensurveysondage::STATUS_VALIDATED) {
print img_warning($langs->trans("Expired"));
}
}

View File

@ -65,7 +65,7 @@ $result = $object->fetch(0, $numsondage);
$nblines = $object->fetch_lines();
//If the survey has not yet finished, then it can be modified
$canbemodified = ((empty($object->date_fin) || $object->date_fin > dol_now()) && $object->status != Opensurveysondage::STATUS_CLOSED);
$canbemodified = ((empty($object->date_fin) || dol_get_last_hour($object->date_fin) > dol_now()) && $object->status != Opensurveysondage::STATUS_CLOSED);
// Security check
if (!isModEnabled('opensurvey')) {