コード例 #1
0
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
0
ファイル: card.php プロジェクト: Samara94/dolibarr
         $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;
         }