30require
'../main.inc.php';
31require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/class/vcard.class.php';
51$result = $company->fetch($socid);
60$v->setProdId(
'Dolibarr '.DOL_VERSION);
62$v->setUid(
'DOLIBARR-THIRDPARTYID-'.$company->id);
66if (!empty($company->url)) {
67 $v->setURL($company->url,
"TYPE=WORK");
69if (!empty($company->phone)) {
70 $v->setPhoneNumber($company->phone,
"TYPE=WORK;VOICE");
72if (!empty($company->phone_mobile)) {
73 $v->setPhoneNumber($company->phone_mobile,
"TYPE=CELL;VOICE");
75if (!empty($company->fax)) {
76 $v->setPhoneNumber($company->fax,
"TYPE=WORK;FAX");
78$v->setAddress(
"",
"", $company->address, $company->town, $company->state, $company->zip, $company->country,
"TYPE=WORK;POSTAL");
79if (!empty(trim($company->email))) {
80 $v->setEmail($company->email);
84if ($company->typent_code !=
'TE_PRIVATE') {
85 $v->setOrg($company->name);
86 $v->filename = $company->name.
'.vcf';
88 $v->setFormattedName($company->name.(!empty($company->name_alias) ?
' ('.$company->name_alias.
')' :
''));
90 $civility = (
string) $company->civility_code;
91 if (!empty($civility)) {
92 $transKey =
"Civility".$civility;
93 $trans = $langs->transnoentitiesnoconv($transKey);
94 if ($trans !== $transKey) {
98 $v->setName($company->lastname, $company->firstname,
"", $civility,
"");
99 $v->setFormattedName($company->getFullName($langs));
108$output = $v->getVCard();
110$filename = trim(urldecode($v->getFileName()));
115header(
"Content-Disposition: attachment; filename=\"".$filename.
"\"");
116header(
"Content-Length: ".
dol_strlen($output));
117header(
"Connection: close");
118header(
"Content-Type: text/x-vcard; name=\"".$filename.
"\"");
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_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0, $allowdash=0)
Clean a string to use it as a file name.
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
print $langs trans("Show") . '< td style="' . $timeColor . '" align="center"> s</td > badge status0 badge status4 badge status3 Error badge status8< td align="center">< span class="badge ' . $badge . '"></span ></td >< td align="center">< a href="#" class="button button-small" onclick="openLogModal(this)" data-req="' . dol_escape_htmltag($reqSafe) . '" data-res="' . dol_escape_htmltag($resSafe) . '" data-err="' . dol_escape_htmltag($errSafe) . '">< span class="fa fa-search-plus"></span ></a ></td ></tr >< tr >< td colspan="' . $colspan . '" class="opacitymedium"></td ></tr ></table ></div ></form > logModal none logModal none s a JSON string
buildzip.php
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.