CardDav categories support (tags)

This commit is contained in:
RainLoop Team 2014-05-15 00:45:52 +04:00
parent fe50a92f88
commit 74b09e93df
10 changed files with 28760 additions and 28760 deletions

View file

@ -1070,7 +1070,7 @@ class Actions
$aResult['DevLogin'] = $oConfig->Get('labs', 'dev_login', '');
$aResult['DevPassword'] = $oConfig->Get('labs', 'dev_password', '');
}
$aResult['AllowGoogleSocial'] = (bool) $oConfig->Get('social', 'google_enable', false);
if ($aResult['AllowGoogleSocial'] && (
'' === \trim($oConfig->Get('social', 'google_client_id', '')) || '' === \trim($oConfig->Get('social', 'google_client_secret', ''))))
@ -1547,7 +1547,7 @@ class Actions
{
$aAccounts[$oAccount->Email()] = $oAccount->GetAuthToken();
}
return $aAccounts;
}
@ -5048,7 +5048,7 @@ class Actions
{
$sUid = \trim($this->GetActionParam('Uid', ''));
$sTags = \trim($this->GetActionParam('Tags', ''));
$aTags = \explode(';', $sTags);
$aTags = \explode(',', $sTags);
$aTags = \array_map('trim', $aTags);
$aTags = \array_unique($aTags);

View file

@ -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);
}
}

View file

@ -615,7 +615,7 @@ class PdoAddressBook
$iUserID = $this->getUserId($sEmail);
$this->aTagsCache = array();
$mResult = false;
try
{
@ -743,14 +743,14 @@ class PdoAddressBook
{
$aContacts = is_array($mContactOrContacts) ? $mContactOrContacts : array(&$mContactOrContacts);
}
if (\is_array($aContacts) && 0 < \count($aContacts))
{
$aIdContacts = array();
$aIdTagsContacts = array();
$aTags = $this->GetContactTags($sEmail);
if (\is_array($aTags) && 0 < \count($aTags))
{
foreach ($aContacts as $oItem)
@ -1175,7 +1175,7 @@ class PdoAddressBook
}
}
}
if ($oContact)
{
$this->populateContactsByTags($sEmail, $oContact);