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

@ -9,7 +9,7 @@ ko.bindingHandlers.tooltip = {
sClass = $oEl.data('tooltip-class') || '', sClass = $oEl.data('tooltip-class') || '',
sPlacement = $oEl.data('tooltip-placement') || 'top' sPlacement = $oEl.data('tooltip-placement') || 'top'
; ;
$oEl.tooltip({ $oEl.tooltip({
'delay': { 'delay': {
'show': 500, 'show': 500,
@ -621,8 +621,8 @@ ko.bindingHandlers.contactTags = {
'parseOnBlur': true, 'parseOnBlur': true,
'allowDragAndDrop': false, 'allowDragAndDrop': false,
'focusCallback': fFocusCallback, 'focusCallback': fFocusCallback,
'inputDelimiters': [';'], 'inputDelimiters': [',', ';'],
'outputDelimiter': ';', 'outputDelimiter': ',',
'autoCompleteSource': function (oData, fResponse) { 'autoCompleteSource': function (oData, fResponse) {
RL.getContactsTagsAutocomplete(oData.term, function (aData) { RL.getContactsTagsAutocomplete(oData.term, function (aData) {
fResponse(_.map(aData, function (oTagItem) { fResponse(_.map(aData, function (oTagItem) {

View file

@ -73,7 +73,7 @@ ContactModel.prototype.parse = function (oItem)
if (Utils.isNonEmptyArray(oItem['Tags'])) if (Utils.isNonEmptyArray(oItem['Tags']))
{ {
this.tags = oItem['Tags'].join(';'); this.tags = oItem['Tags'].join(',');
} }
bResult = true; bResult = true;

View file

@ -2,7 +2,7 @@
"name": "RainLoop", "name": "RainLoop",
"title": "RainLoop Webmail", "title": "RainLoop Webmail",
"version": "1.6.6", "version": "1.6.6",
"release": "922", "release": "924",
"description": "Simple, modern & fast web-based email client", "description": "Simple, modern & fast web-based email client",
"homepage": "http://rainloop.net", "homepage": "http://rainloop.net",
"main": "Gruntfile.js", "main": "Gruntfile.js",

View file

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

View file

@ -211,7 +211,7 @@ class Contact
$oVCard->VERSION = '3.0'; $oVCard->VERSION = '3.0';
$oVCard->PRODID = '-//RainLoop//'.APP_VERSION.'//EN'; $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 = ''; $sFirstName = $sLastName = $sMiddleName = $sSuffix = $sPrefix = '';
foreach ($this->Properties as /* @var $oProperty \RainLoop\Providers\AddressBook\Classes\Property */ &$oProperty) foreach ($this->Properties as /* @var $oProperty \RainLoop\Providers\AddressBook\Classes\Property */ &$oProperty)
@ -274,7 +274,7 @@ class Contact
if (0 < \count($this->Tags)) if (0 < \count($this->Tags))
{ {
$oVCard->{'X-RL-TAGS'} = \implode(';', $this->Tags); $oVCard->CATEGORIES = $this->Tags;
} }
return (string) $oVCard->serialize(); return (string) $oVCard->serialize();
@ -590,9 +590,10 @@ class Contact
$this->Properties = $aProperties; $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); $this->Tags = \array_map('trim', $this->Tags);
} }
} }

View file

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

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long