mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-06 07:57:02 +03:00
CardDav categories support (tags)
This commit is contained in:
parent
fe50a92f88
commit
74b09e93df
10 changed files with 28760 additions and 28760 deletions
|
|
@ -211,7 +211,7 @@ class Contact
|
|||
$oVCard->VERSION = '3.0';
|
||||
$oVCard->PRODID = '-//RainLoop//'.APP_VERSION.'//EN';
|
||||
|
||||
unset($oVCard->FN, $oVCard->EMAIL, $oVCard->TEL, $oVCard->URL, $oVCard->{'X-RL-TAGS'});
|
||||
unset($oVCard->FN, $oVCard->EMAIL, $oVCard->TEL, $oVCard->URL, $oVCard->NICKNAME, $oVCard->CATEGORIES, $oVCard->{'X-RL-TAGS'});
|
||||
|
||||
$sFirstName = $sLastName = $sMiddleName = $sSuffix = $sPrefix = '';
|
||||
foreach ($this->Properties as /* @var $oProperty \RainLoop\Providers\AddressBook\Classes\Property */ &$oProperty)
|
||||
|
|
@ -274,7 +274,7 @@ class Contact
|
|||
|
||||
if (0 < \count($this->Tags))
|
||||
{
|
||||
$oVCard->{'X-RL-TAGS'} = \implode(';', $this->Tags);
|
||||
$oVCard->CATEGORIES = $this->Tags;
|
||||
}
|
||||
|
||||
return (string) $oVCard->serialize();
|
||||
|
|
@ -590,9 +590,10 @@ class Contact
|
|||
|
||||
$this->Properties = $aProperties;
|
||||
|
||||
if (isset($oVCard->{'X-RL-TAGS'}) && 0 < \strlen($oVCard->{'X-RL-TAGS'}))
|
||||
if (isset($oVCard->CATEGORIES))
|
||||
{
|
||||
$this->Tags = \explode(';', $oVCard->{'X-RL-TAGS'});
|
||||
$this->Tags = (array) $oVCard->CATEGORIES->getParts();
|
||||
$this->Tags = \is_array($this->Tags) ? $this->Tags : array();
|
||||
$this->Tags = \array_map('trim', $this->Tags);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue