本文整理匯總了PHP中Propal::add_contact方法的典型用法代碼示例。如果您正苦於以下問題:PHP Propal::add_contact方法的具體用法?PHP Propal::add_contact怎麽用?PHP Propal::add_contact使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Propal
的用法示例。
在下文中一共展示了Propal::add_contact方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: GETPOST
$lineid = GETPOST('lineid', 'int');
$action = GETPOST('action', 'alpha');
// Security check
if ($user->societe_id) {
$socid = $user->societe_id;
}
$result = restrictedArea($user, 'propale', $id, 'propal');
$object = new Propal($db);
/*
* Ajout d'un nouveau contact
*/
if ($action == 'addcontact' && $user->rights->propale->creer) {
$result = $object->fetch($id);
if ($result > 0 && $id > 0) {
$contactid = GETPOST('userid', 'int') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int');
$result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]);
}
if ($result >= 0) {
Header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id);
exit;
} else {
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
$langs->load("errors");
$mesg = '<div class="error">' . $langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType") . '</div>';
} else {
$mesg = '<div class="error">' . $object->error . '</div>';
}
}
} else {
if ($action == 'swapstatut' && $user->rights->propale->creer) {
if ($object->fetch($id) > 0) {
示例2: Commande
// Linked documents
if ($typeobject == 'commande' && $object->{$typeobject}->id && !empty($conf->commande->enabled)) {
$objectsrc = new Commande($db);
$objectsrc->fetch($object->{$typeobject}->id);
}
if ($typeobject == 'propal' && $object->{$typeobject}->id && !empty($conf->propal->enabled)) {
$objectsrc = new Propal($db);
$objectsrc->fetch($object->{$typeobject}->id);
}
}
/*
* Actions
*/
if ($action == 'addcontact' && $user->rights->expedition->creer) {
if ($result > 0 && $id > 0) {
$result = $objectsrc->add_contact(GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid'), $_POST["type"], $_POST["source"]);
}
if ($result >= 0) {
header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id);
exit;
} else {
if ($objectsrc->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
$langs->load("errors");
$mesg = $langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType");
} else {
$mesg = $objectsrc->error;
$mesgs = $objectsrc->errors;
}
setEventMessages($mesg, $mesgs, 'errors');
}
} else {
示例3: Commande
// Linked documents
if ($typeobject == 'commande' && $object->{$typeobject}->id && !empty($conf->commande->enabled)) {
$objectsrc = new Commande($db);
$objectsrc->fetch($object->{$typeobject}->id);
}
if ($typeobject == 'propal' && $object->{$typeobject}->id && !empty($conf->propal->enabled)) {
$objectsrc = new Propal($db);
$objectsrc->fetch($object->{$typeobject}->id);
}
}
/*
* Actions
*/
if ($action == 'addcontact' && $user->rights->expedition->creer) {
if ($result > 0 && $id > 0) {
$result = $objectsrc->add_contact($_POST["contactid"], $_POST["type"], $_POST["source"]);
}
if ($result >= 0) {
header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id);
exit;
} else {
if ($objectsrc->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
$langs->load("errors");
$mesg = '<div class="error">' . $langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType") . '</div>';
} else {
$mesg = '<div class="error">' . $objectsrc->error . '</div>';
}
}
} else {
if ($action == 'swapstatut' && $user->rights->expedition->creer) {
$result = $objectsrc->swapContactStatus(GETPOST('ligne'));
示例4: Propal
/*
* Ajout d'un nouveau contact
*/
if ($_POST["action"] == 'addcontact' && $user->rights->propale->creer)
{
$result = 0;
$propal = new Propal($db);
$result = $propal->fetch($id);
if ($result > 0 && $id > 0)
{
$result = $propal->add_contact($_POST["contactid"], $_POST["type"], $_POST["source"]);
}
if ($result >= 0)
{
Header("Location: contact.php?id=".$propal->id);
exit;
}
else
{
if ($propal->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{
$langs->load("errors");
$mesg = '<div class="error">'.$langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType").'</div>';
}
else