30require
'../main.inc.php';
31require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
32require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/class/vcard.class.php';
44$ref =
GETPOST(
'ref',
'alphanohtml');
49if ($id > 0 || !empty($ref)) {
51 $result =
$object->fetch($id, $ref);
54 $canadduser = ($user->admin || $user->hasRight(
'user',
'user',
'creer'));
58 $caneditfielduser = ((($user->id ==
$object->user_id) && $user->hasRight(
'user',
'self',
'creer'))
59 || (($user->id !=
$object->user_id) && $user->hasRight(
'user',
'user',
'creer')));
60 $caneditpassworduser = ((($user->id ==
$object->user_id) && $user->hasRight(
'user',
'self',
'password'))
61 || (($user->id !=
$object->user_id) && $user->hasRight(
'user',
'user',
'password')));
66$canaddmember = $user->hasRight(
'adherent',
'creer');
69 $caneditfieldmember = $user->hasRight(
'adherent',
'creer');
89 $result = $company->fetch(
$object->socid);
96$v->setProdId(
'Dolibarr '.DOL_VERSION);
98$v->setUid(
'DOLIBARR-ADHERENTID-'.
$object->id);
100$v->setFormattedName(
$object->getFullName($langs, 1));
102$v->setPhoneNumber(
$object->phone_pro,
"TYPE=WORK;VOICE");
104$v->setPhoneNumber(
$object->phone_mobile,
"TYPE=CELL;VOICE");
105$v->setPhoneNumber(
$object->fax,
"TYPE=WORK;FAX");
114$v->setNote(
$object->note_public);
119 $v->setURL($company->url,
"TYPE=WORK");
121 $v->setPhoneNumber($company->phone,
"TYPE=WORK;VOICE");
124 $v->setPhoneNumber($company->fax,
"TYPE=WORK;FAX");
127 $v->setAddress(
"",
"", $company->address, $company->town, $company->state, $company->zip, $company->country,
"TYPE=WORK;POSTAL");
130 if (empty(trim($company->email))) {
132 } elseif (empty(trim(
$object->email))) {
134 $v->setEmail($company->email);
136 $tmpobject = explode(
"@", trim(
$object->email));
137 $tmpcompany = explode(
"@", trim($company->email));
139 if (strtolower(end($tmpobject)) == strtolower(end($tmpcompany))) {
144 $v->setEmail($company->email,
'INTERNET');
147 $v->setEmail($company->email);
150 $v->setEmail(
$object->email,
'INTERNET');
155 if ($company->typent_code !=
'TE_PRIVATE') {
156 $v->setOrg($company->name);
161$v->setPhoneNumber(
$object->phone_perso,
"TYPE=HOME;VOICE");
163 $v->setBirthday(
$object->birth);
171$output = $v->getVCard();
173$filename = trim(urldecode($v->getFileName()));
178header(
"Content-Disposition: attachment; filename=\"".$filename.
"\"");
179header(
"Content-Length: ".
dol_strlen($output));
180header(
"Connection: close");
181header(
"Content-Type: text/x-vcard; name=\"".$filename.
"\"");
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Class to manage members of a foundation.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to build vCard files.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.