本文整理汇总了PHP中Societe::create_from_member方法的典型用法代码示例。如果您正苦于以下问题:PHP Societe::create_from_member方法的具体用法?PHP Societe::create_from_member怎么用?PHP Societe::create_from_member使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Societe
的用法示例。
在下文中一共展示了Societe::create_from_member方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GETPOST
if ($rowid) {
$caneditfieldmember = $user->rights->adherent->creer;
}
// PDF
$hidedetails = GETPOST('hidedetails', 'int') ? GETPOST('hidedetails', 'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0);
$hidedesc = GETPOST('hidedesc', 'int') ? GETPOST('hidedesc', 'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0);
$hideref = GETPOST('hideref', 'int') ? GETPOST('hideref', 'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0);
/*
* Actions
*/
// Create third party from a member
if ($action == 'confirm_create_thirdparty' && $confirm == 'yes' && $user->rights->societe->creer) {
if ($result > 0) {
// Creation user
$company = new Societe($db);
$result = $company->create_from_member($object, $_POST["companyname"]);
if ($result < 0) {
$langs->load("errors");
$errmsg = $langs->trans($company->error);
setEventMessages($company->error, $company->errors, 'errors');
} else {
$action = 'addsubscription';
}
} else {
$errmsg = $object->error;
}
}
if ($action == 'setuserid' && ($user->rights->user->self->creer || $user->rights->user->user->creer)) {
$error = 0;
if (empty($user->rights->user->user->creer)) {
if ($_POST["userid"] != $user->id && $_POST["userid"] != $object->user_id) {
示例2: User
$nuser = new User($db);
$result = $nuser->create_from_member($object, GETPOST('login'));
if ($result < 0) {
$langs->load("errors");
setEventMessages($langs->trans($nuser->error), null, 'errors');
}
} else {
setEventMessages($object->errors, $object->error, 'errors');
}
}
// Create third party from a member
if ($action == 'confirm_create_thirdparty' && $confirm == 'yes' && $user->rights->societe->creer) {
if ($result > 0) {
// Creation user
$company = new Societe($db);
$result = $company->create_from_member($object, GETPOST('companyname'));
if ($result < 0) {
$langs->load("errors");
setEventMessages($langs->trans($company->error), null, 'errors');
setEventMessages($company->error, $company->errors, 'errors');
}
} else {
setEventMessages($object->error, $object->errors, 'errors');
}
}
if ($action == 'confirm_sendinfo' && $confirm == 'yes') {
if ($object->email) {
$from = $conf->email_from;
if (!empty($conf->global->ADHERENT_MAIL_FROM)) {
$from = $conf->global->ADHERENT_MAIL_FROM;
}