Exemple #1
0
    if ($action == 'add') {
        $action = 'create';
    }
    if ($action == 'update') {
        $action = 'edit';
    }
    $listUserAssignedUpdated = true;
}
// Action clone object
if ($action == 'confirm_clone' && $confirm == 'yes') {
    if (1 == 0 && !GETPOST('clone_content') && !GETPOST('clone_receivers')) {
        setEventMessages($langs->trans("NoCloneOptionsSpecified"), null, 'errors');
    } else {
        if ($id > 0) {
            $object->fetch($id);
            $result = $object->createFromClone(GETPOST('fk_userowner'), GETPOST('socid'));
            if ($result > 0) {
                header("Location: " . $_SERVER['PHP_SELF'] . '?id=' . $result);
                exit;
            } else {
                setEventMessages($object->error, $object->errors, 'errors');
                $action = '';
            }
        }
    }
}
// Add event
if ($action == 'add') {
    $error = 0;
    if (empty($backtopage)) {
        if ($socid > 0) {