}
    $error = 0;
    if (!GETPOST('nouveautitre')) {
        setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Title")), 'errors');
        $error++;
        $action = 'edit';
    }
    if (!$error) {
        $object->titre = GETPOST('nouveautitre');
        $object->commentaires = GETPOST('nouveauxcommentaires');
        $object->mail_admin = GETPOST('nouvelleadresse');
        $object->date_fin = $expiredate;
        $object->allow_comments = GETPOST('cancomment') == 'on' ? true : false;
        $object->allow_spy = GETPOST('canseeothersvote') == 'on' ? true : false;
        $object->mailsonde = GETPOST('mailsonde') == 'on' ? true : false;
        $res = $object->update($user);
        if ($res < 0) {
            setEventMessage($object->error, 'errors');
            $action = 'edit';
        }
    }
}
// Add comment
if (GETPOST('ajoutcomment')) {
    $error = 0;
    if (!GETPOST('comment')) {
        $error++;
        setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Comment")), 'errors');
    }
    if (!GETPOST('commentuser')) {
        $error++;