Пример #1
0
        } else {
            $db->rollback();
            $id = $idaction;
            $langs->load("errors");
            $error = $langs->trans($actioncomm->error);
        }
    }
}
/*
 * Action cloturer l'action
 */
if (GETPOST("action") == 'close') {
    $actioncomm = new ActionComm($db);
    $actioncomm->fetch($id);
    if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) {
        $result = $actioncomm->close();
        if ($result >= 0) {
            Header("Location: " . DOL_URL_ROOT . '/comm/action/fiche.php?id=' . $id);
            exit;
        } else {
            $mesg = $actioncomm->error;
        }
    }
}
/*
 * Action suppression de l'action
 */
if ($action == 'confirm_delete' && GETPOST("confirm") == 'yes') {
    $actioncomm = new ActionComm($db);
    $actioncomm->fetch($id);
    if ($user->rights->agenda->myactions->delete || $user->rights->agenda->allactions->delete) {