$result = $object->fetch(0, $numsondage);
if ($result <= 0) {
    dol_print_error($db, $object->error);
    exit;
}
$expiredate = dol_mktime(0, 0, 0, GETPOST('expiremonth'), GETPOST('expireday'), GETPOST('expireyear'));
/*
 * Actions
 */
// Delete
if ($action == 'delete_confirm') {
    // Security check
    if (!$user->rights->opensurvey->write) {
        accessforbidden();
    }
    $result = $object->delete($user, '', $numsondage);
    header('Location: ' . dol_buildpath('/opensurvey/list.php', 1));
    exit;
}
// Update
if ($action == 'update') {
    // Security check
    if (!$user->rights->opensurvey->write) {
        accessforbidden();
    }
    $error = 0;
    if (!GETPOST('nouveautitre')) {
        setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Title")), 'errors');
        $error++;
        $action = 'edit';
    }