Beispiel #1
0
    if (!$canbemodified) {
        accessforbidden();
    }
    $error = 0;
    if (!GETPOST('comment')) {
        $error++;
        setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Comment")), 'errors');
    }
    if (!GETPOST('commentuser')) {
        $error++;
        setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("User")), 'errors');
    }
    if (!$error) {
        $comment = GETPOST("comment");
        $comment_user = GETPOST('commentuser');
        $resql = $object->addComment($comment, $comment_user);
        if (!$resql) {
            dol_print_error($db);
        }
    }
}
// Add vote
if (GETPOST("boutonp") || GETPOST("boutonp.x") || GETPOST("boutonp_x")) {
    if (!$canbemodified) {
        accessforbidden();
    }
    //Si le nom est bien entré
    if (GETPOST('nom')) {
        $nouveauchoix = '';
        for ($i = 0; $i < $nbcolonnes; $i++) {
            if (isset($_POST["choix{$i}"]) && $_POST["choix{$i}"] == '1') {