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';
36$ref =
GETPOST(
'ref',
'alphanohtml');
41if ($id > 0 || !empty($ref)) {
43 $result =
$object->fetch($id, $ref);
46 $canadduser = ($user->admin || $user->hasRight(
'user',
'user',
'creer'));
50 $caneditfielduser = ((($user->id ==
$object->user_id) && $user->hasRight(
'user',
'self',
'creer'))
51 || (($user->id !=
$object->user_id) && $user->hasRight(
'user',
'user',
'creer')));
52 $caneditpassworduser = ((($user->id ==
$object->user_id) && $user->hasRight(
'user',
'self',
'password'))
53 || (($user->id !=
$object->user_id) && $user->hasRight(
'user',
'user',
'password')));
58$canaddmember = $user->hasRight(
'adherent',
'creer');
61 $caneditfieldmember = $user->hasRight(
'adherent',
'creer');
81 $result = $company->fetch(
$object->socid);
88$v->setProdId(
'Dolibarr '.DOL_VERSION);
90$v->setUid(
'DOLIBARR-ADHERENTID-'.
$object->id);
92$v->setFormattedName(
$object->getFullName($langs, 1));
94$v->setPhoneNumber(
$object->phone_pro,
"TYPE=WORK;VOICE");
96$v->setPhoneNumber(
$object->phone_mobile,
"TYPE=CELL;VOICE");
97$v->setPhoneNumber(
$object->fax,
"TYPE=WORK;FAX");
106$v->setNote(
$object->note_public);
111 $v->setURL($company->url,
"TYPE=WORK");
113 $v->setPhoneNumber($company->phone,
"TYPE=WORK;VOICE");
116 $v->setPhoneNumber($company->fax,
"TYPE=WORK;FAX");
119 $v->setAddress(
"",
"", $company->address, $company->town, $company->state, $company->zip, $company->country,
"TYPE=WORK;POSTAL");
122 if (empty(trim($company->email))) {
124 } elseif (empty(trim(
$object->email))) {
126 $v->setEmail($company->email);
128 $tmpobject = explode(
"@", trim(
$object->email));
129 $tmpcompany = explode(
"@", trim($company->email));
131 if (strtolower(end($tmpobject)) == strtolower(end($tmpcompany))) {
136 $v->setEmail($company->email,
'INTERNET');
139 $v->setEmail($company->email);
142 $v->setEmail(
$object->email,
'INTERNET');
147 if ($company->typent_code !=
'TE_PRIVATE') {
148 $v->setOrg($company->name);
153$v->setPhoneNumber(
$object->phone_perso,
"TYPE=HOME;VOICE");
155 $v->setBirthday(
$object->birth);
163$output = $v->getVCard();
165$filename = trim(urldecode($v->getFileName()));
170header(
"Content-Disposition: attachment; filename=\"".$filename.
"\"");
171header(
"Content-Length: ".
dol_strlen($output));
172header(
"Connection: close");
173header(
"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.