Ejemplo n.º 1
0
            $mesg = '<div class="error">' . $object->error . '</div>';
        }
    }
}
// bascule du statut d'un contact
if ($action == 'swapstatut' && $user->rights->contrat->creer) {
    if ($object->fetch($id)) {
        $result = $object->swapContactStatus(GETPOST('ligne'));
    } else {
        dol_print_error($db, $object->error);
    }
}
// Efface un contact
if ($action == 'deletecontact' && $user->rights->contrat->creer) {
    $object->fetch($id);
    $result = $object->delete_contact($_GET["lineid"]);
    if ($result >= 0) {
        header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id);
        exit;
    }
}
/*
 * View
 */
llxHeader('', $langs->trans("ContractCard"), "Contrat");
$form = new Form($db);
$formcompany = new FormCompany($db);
$contactstatic = new Contact($db);
$userstatic = new User($db);
dol_htmloutput_mesg($mesg);
/* *************************************************************************** */
Ejemplo n.º 2
0
			dol_print_error($db, "result=$result");
			$db->rollback();
		}
	}
	else
	{
		dol_print_error($db,$contrat->error);
	}
}

// Efface un contact
if ($_GET["action"] == 'deleteline' && $user->rights->contrat->creer)
{
	$contrat = new Contrat($db);
	$contrat->fetch($_GET["id"]);
	$result = $contrat->delete_contact($_GET["lineid"]);

	if ($result >= 0)
	{
		Header("Location: contact.php?id=".$contrat->id);
		exit;
	}
}


/*
 * View
 */

llxHeader('', $langs->trans("ContractCard"), "Contrat");