dolibarr 20.0.0
vCard Class Reference

Class to build vCard files. More...

Public Member Functions

 setPhoneNumber ($number, $type="")
 Format phone number.
 
 setPhoto ($type, $photo)
 Format photo.
 
 setFormattedName ($name)
 Format name.
 
 setName ($family="", $first="", $additional="", $prefix="", $suffix="")
 Format the name.
 
 setBirthday ($date)
 Format the birth date.
 
 setAddress ($postoffice="", $extended="", $street="", $city="", $region="", $zip="", $country="", $type="", $label="")
 Address.
 
 setLabel ($postoffice="", $extended="", $street="", $city="", $region="", $zip="", $country="", $type="HOME")
 Address (old standard)
 
 setEmail ($address, $type="")
 Add a e-mail address to this vCard.
 
 setNote ($note)
 mise en forme de la note
 
 setTitle ($title)
 mise en forme de la fonction
 
 setOrg ($org)
 mise en forme de la societe
 
 setProdId ($prodid)
 mise en forme du logiciel generateur
 
 setUID ($uid)
 mise en forme du logiciel generateur
 
 setURL ($url, $type="")
 mise en forme de l'url
 
 getVCard ()
 Return string of a vcard.
 
 getFileName ()
 Return name of a file.
 
 buildVCardString ($object, $company, $langs, $urlphoto='', $outdir='')
 Return a VCARD string See RFC https://datatracker.ietf.org/doc/html/rfc6350.
 

Detailed Description

Class to build vCard files.

Definition at line 88 of file vcard.class.php.

Member Function Documentation

◆ buildVCardString()

vCard::buildVCardString ( $object,
$company,
$langs,
$urlphoto = '',
$outdir = '' )

Return a VCARD string See RFC https://datatracker.ietf.org/doc/html/rfc6350.

Parameters
Object$objectObject (User or Contact)
Societe | null$companyCompany. May be null.
Translate$langsLang object
string$urlphotoFull public URL of photo
string$outdirDirectory where to store the temporary file
Returns
string String

Definition at line 396 of file vcard.class.php.

References $object, dol_mimetype(), dol_trunc(), dolChmod(), getDolUserInt(), getVCard(), setAddress(), setBirthday(), setEmail(), setFormattedName(), setName(), setNote(), setOrg(), setPhoneNumber(), setPhoto(), setProdId(), setTitle(), setUID(), and setURL().

◆ getFileName()

vCard::getFileName ( )

Return name of a file.

Returns
string Filename

Definition at line 380 of file vcard.class.php.

◆ getVCard()

vCard::getVCard ( )

Return string of a vcard.

Returns
string

Definition at line 359 of file vcard.class.php.

Referenced by buildVCardString().

◆ setAddress()

vCard::setAddress ( $postoffice = "",
$extended = "",
$street = "",
$city = "",
$region = "",
$zip = "",
$country = "",
$type = "",
$label = "" )

Address.

Parameters
string$postofficePostoffice
string$extendedExtended
string$streetStreet
string$cityCity
string$regionRegion
string$zipZip
string$countryCountry
string$typeType
string$labelLabel
Returns
void

Definition at line 200 of file vcard.class.php.

References encode().

Referenced by buildVCardString().

◆ setBirthday()

vCard::setBirthday ( $date)

Format the birth date.

Parameters
integer$dateDate
Returns
void

Definition at line 179 of file vcard.class.php.

References dol_print_date().

Referenced by buildVCardString().

◆ setEmail()

vCard::setEmail ( $address,
$type = "" )

Add a e-mail address to this vCard.

Parameters
string$addressE-mail address
string$type(optional) The type of the e-mail (typical "PREF" or "INTERNET")
Returns
void

Definition at line 267 of file vcard.class.php.

Referenced by buildVCardString().

◆ setFormattedName()

vCard::setFormattedName ( $name)

Format name.

Parameters
string$nameName
Returns
void

Definition at line 147 of file vcard.class.php.

References encode().

Referenced by buildVCardString(), and setName().

◆ setLabel()

vCard::setLabel ( $postoffice = "",
$extended = "",
$street = "",
$city = "",
$region = "",
$zip = "",
$country = "",
$type = "HOME" )

Address (old standard)

Parameters
string$postofficePostoffice
string$extendedExtended
string$streetStreet
string$cityCity
string$regionRegion
string$zipZip
string$countryCountry
string$typeType
Returns
void
Deprecated

Definition at line 232 of file vcard.class.php.

References encode().

◆ setName()

vCard::setName ( $family = "",
$first = "",
$additional = "",
$prefix = "",
$suffix = "" )

Format the name.

Set also the filename to use 'firstname lastname.vcf'

Parameters
string$familyFamily name
string$firstFirst name
string$additionalAdditional (e.g. second name, nick name)
string$prefixTitle prefix (e.g. "Mr.", "Ms.", "Prof.")
string$suffixSuffix (e.g. "sen." for senior, "jun." for junior)
Returns
void

Definition at line 163 of file vcard.class.php.

References encode(), and setFormattedName().

Referenced by buildVCardString().

◆ setNote()

vCard::setNote ( $note)

mise en forme de la note

Parameters
string$noteNote
Returns
void

Definition at line 284 of file vcard.class.php.

References encode().

Referenced by buildVCardString().

◆ setOrg()

vCard::setOrg ( $org)

mise en forme de la societe

Parameters
string$orgOrg
Returns
void

Definition at line 307 of file vcard.class.php.

References encode().

Referenced by buildVCardString().

◆ setPhoneNumber()

vCard::setPhoneNumber ( $number,
$type = "" )

Format phone number.

Parameters
int$numbernumero de telephone
string$typeType ('cell')
Returns
void

Definition at line 113 of file vcard.class.php.

Referenced by buildVCardString().

◆ setPhoto()

vCard::setPhoto ( $type,
$photo )

Format photo.

warning NON TESTE !

Parameters
string$typeType 'image/jpeg' or 'JPEG'
string$photoPhoto
Returns
void

Definition at line 133 of file vcard.class.php.

Referenced by buildVCardString().

◆ setProdId()

vCard::setProdId ( $prodid)

mise en forme du logiciel generateur

Parameters
string$prodidProdid
Returns
void

Definition at line 319 of file vcard.class.php.

References encode().

Referenced by buildVCardString().

◆ setTitle()

vCard::setTitle ( $title)

mise en forme de la fonction

Parameters
string$titleTitle
Returns
void

Definition at line 295 of file vcard.class.php.

References encode().

Referenced by buildVCardString().

◆ setUID()

vCard::setUID ( $uid)

mise en forme du logiciel generateur

Parameters
string$uidUid
Returns
void

Definition at line 331 of file vcard.class.php.

References encode().

Referenced by buildVCardString().

◆ setURL()

vCard::setURL ( $url,
$type = "" )

mise en forme de l'url

Parameters
string$urlURL
string$typeType
Returns
void

Definition at line 344 of file vcard.class.php.

Referenced by buildVCardString().


The documentation for this class was generated from the following file: