fix: add missing button to validate survey (#30189)

This commit is contained in:
HENRY Florian
2024-06-29 19:17:37 +02:00
committed by GitHub
parent 3cff90a282
commit 4f5f7ea209

View File

@@ -101,8 +101,8 @@ if (empty($reshook)) {
$object->update($user);
}
// Reopend
if ($action == 'reopen') {
// Valid or Reopend
if ($action == 'reopen' || $action == 'validate') {
$object->status = Opensurveysondage::STATUS_VALIDATED;
$object->update($user);
}
@@ -376,6 +376,11 @@ if ($action != 'edit' && $user->hasRight('opensurvey', 'write')) {
// Modify button
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'&id='.urlencode($numsondage).'">'.$langs->trans("Modify").'</a>';
if ($object->status == Opensurveysondage::STATUS_DRAFT) {
// Validate button
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=validate&token='.newToken().'&id='.urlencode($numsondage).'">'.$langs->trans("Valid").'</a>';
}
if ($object->status == Opensurveysondage::STATUS_VALIDATED) {
// Close button
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=close&token='.newToken().'&id='.urlencode($numsondage).'">'.$langs->trans("Close").'</a>';