mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Remove tags support from code.
This commit is contained in:
parent
0a95b79eb2
commit
36bdce3084
15 changed files with 11 additions and 640 deletions
|
|
@ -839,17 +839,6 @@
|
||||||
}, sQuery);
|
}, sQuery);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {string} sQuery
|
|
||||||
* @param {Function} fCallback
|
|
||||||
*/
|
|
||||||
AppApp.prototype.getContactTagsAutocomplete = function (sQuery, fCallback)
|
|
||||||
{
|
|
||||||
fCallback(_.filter(Data.contactTags(), function (oContactTag) {
|
|
||||||
return oContactTag && oContactTag.filterHelper(sQuery);
|
|
||||||
}));
|
|
||||||
};
|
|
||||||
|
|
||||||
AppApp.prototype.setMessageList = function (oData, bCached)
|
AppApp.prototype.setMessageList = function (oData, bCached)
|
||||||
{
|
{
|
||||||
if (oData && oData.Result && 'Collection/MessageCollection' === oData.Result['@Object'] &&
|
if (oData && oData.Result && 'Collection/MessageCollection' === oData.Result['@Object'] &&
|
||||||
|
|
|
||||||
74
dev/External/ko.js
vendored
74
dev/External/ko.js
vendored
|
|
@ -636,80 +636,6 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
ko.bindingHandlers.contactTags = {
|
|
||||||
'init': function(oElement, fValueAccessor, fAllBindingsAccessor) {
|
|
||||||
|
|
||||||
var
|
|
||||||
Utils = require('Common/Utils'),
|
|
||||||
ContactTagModel = require('Model/ContactTag'),
|
|
||||||
|
|
||||||
$oEl = $(oElement),
|
|
||||||
fValue = fValueAccessor(),
|
|
||||||
fAllBindings = fAllBindingsAccessor(),
|
|
||||||
fAutoCompleteSource = fAllBindings['autoCompleteSource'] || null,
|
|
||||||
fFocusCallback = function (bValue) {
|
|
||||||
if (fValue && fValue.focusTrigger)
|
|
||||||
{
|
|
||||||
fValue.focusTrigger(bValue);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
;
|
|
||||||
|
|
||||||
$oEl.inputosaurus({
|
|
||||||
'parseOnBlur': true,
|
|
||||||
'allowDragAndDrop': false,
|
|
||||||
'focusCallback': fFocusCallback,
|
|
||||||
'inputDelimiters': [',', ';'],
|
|
||||||
'outputDelimiter': ',',
|
|
||||||
'autoCompleteSource': fAutoCompleteSource,
|
|
||||||
'parseHook': function (aInput) {
|
|
||||||
return _.map(aInput, function (sInputValue) {
|
|
||||||
|
|
||||||
var
|
|
||||||
sValue = Utils.trim(sInputValue),
|
|
||||||
oTag = null
|
|
||||||
;
|
|
||||||
|
|
||||||
if ('' !== sValue)
|
|
||||||
{
|
|
||||||
oTag = new ContactTagModel();
|
|
||||||
oTag.name(sValue);
|
|
||||||
return [oTag.toLine(false), oTag];
|
|
||||||
}
|
|
||||||
|
|
||||||
return [sValue, null];
|
|
||||||
|
|
||||||
});
|
|
||||||
},
|
|
||||||
'change': _.bind(function (oEvent) {
|
|
||||||
$oEl.data('ContactTagsValue', oEvent.target.value);
|
|
||||||
fValue(oEvent.target.value);
|
|
||||||
}, this)
|
|
||||||
});
|
|
||||||
},
|
|
||||||
'update': function (oElement, fValueAccessor, fAllBindingsAccessor) {
|
|
||||||
|
|
||||||
var
|
|
||||||
$oEl = $(oElement),
|
|
||||||
fAllValueFunc = fAllBindingsAccessor(),
|
|
||||||
fContactTagsFilter = fAllValueFunc['contactTagsFilter'] || null,
|
|
||||||
sValue = ko.utils.unwrapObservable(fValueAccessor())
|
|
||||||
;
|
|
||||||
|
|
||||||
if ($oEl.data('ContactTagsValue') !== sValue)
|
|
||||||
{
|
|
||||||
$oEl.val(sValue);
|
|
||||||
$oEl.data('ContactTagsValue', sValue);
|
|
||||||
$oEl.inputosaurus('refresh');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fContactTagsFilter && ko.utils.unwrapObservable(fContactTagsFilter))
|
|
||||||
{
|
|
||||||
$oEl.inputosaurus('focus');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
ko.bindingHandlers.command = {
|
ko.bindingHandlers.command = {
|
||||||
'init': function (oElement, fValueAccessor, fAllBindingsAccessor, oViewModel) {
|
'init': function (oElement, fValueAccessor, fAllBindingsAccessor, oViewModel) {
|
||||||
var
|
var
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,6 @@
|
||||||
this.idContact = 0;
|
this.idContact = 0;
|
||||||
this.display = '';
|
this.display = '';
|
||||||
this.properties = [];
|
this.properties = [];
|
||||||
this.tags = '';
|
|
||||||
this.readOnly = false;
|
this.readOnly = false;
|
||||||
|
|
||||||
this.focused = ko.observable(false);
|
this.focused = ko.observable(false);
|
||||||
|
|
@ -71,7 +70,6 @@
|
||||||
this.idContact = Utils.pInt(oItem['IdContact']);
|
this.idContact = Utils.pInt(oItem['IdContact']);
|
||||||
this.display = Utils.pString(oItem['Display']);
|
this.display = Utils.pString(oItem['Display']);
|
||||||
this.readOnly = !!oItem['ReadOnly'];
|
this.readOnly = !!oItem['ReadOnly'];
|
||||||
this.tags = '';
|
|
||||||
|
|
||||||
if (Utils.isNonEmptyArray(oItem['Properties']))
|
if (Utils.isNonEmptyArray(oItem['Properties']))
|
||||||
{
|
{
|
||||||
|
|
@ -83,11 +81,6 @@
|
||||||
}, this);
|
}, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Utils.isNonEmptyArray(oItem['Tags']))
|
|
||||||
{
|
|
||||||
this.tags = oItem['Tags'].join(',');
|
|
||||||
}
|
|
||||||
|
|
||||||
bResult = true;
|
bResult = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,58 +0,0 @@
|
||||||
|
|
||||||
(function () {
|
|
||||||
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
var
|
|
||||||
ko = require('ko'),
|
|
||||||
|
|
||||||
Utils = require('Common/Utils')
|
|
||||||
;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @constructor
|
|
||||||
*/
|
|
||||||
function ContactTagModel()
|
|
||||||
{
|
|
||||||
this.idContactTag = 0;
|
|
||||||
this.name = ko.observable('');
|
|
||||||
this.readOnly = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
ContactTagModel.prototype.parse = function (oItem)
|
|
||||||
{
|
|
||||||
var bResult = false;
|
|
||||||
if (oItem && 'Object/Tag' === oItem['@Object'])
|
|
||||||
{
|
|
||||||
this.idContact = Utils.pInt(oItem['IdContactTag']);
|
|
||||||
this.name(Utils.pString(oItem['Name']));
|
|
||||||
this.readOnly = !!oItem['ReadOnly'];
|
|
||||||
|
|
||||||
bResult = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return bResult;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {string} sSearch
|
|
||||||
* @return {boolean}
|
|
||||||
*/
|
|
||||||
ContactTagModel.prototype.filterHelper = function (sSearch)
|
|
||||||
{
|
|
||||||
return this.name().toLowerCase().indexOf(sSearch.toLowerCase()) !== -1;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {boolean=} bEncodeHtml = false
|
|
||||||
* @return {string}
|
|
||||||
*/
|
|
||||||
ContactTagModel.prototype.toLine = function (bEncodeHtml)
|
|
||||||
{
|
|
||||||
return (Utils.isUnd(bEncodeHtml) ? false : !!bEncodeHtml) ?
|
|
||||||
Utils.encodeHtml(this.name()) : this.name();
|
|
||||||
};
|
|
||||||
|
|
||||||
module.exports = ContactTagModel;
|
|
||||||
|
|
||||||
}());
|
|
||||||
|
|
@ -335,14 +335,6 @@
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* @return {string}
|
|
||||||
*/
|
|
||||||
EmailModel.prototype.inputoTagLine = function ()
|
|
||||||
{
|
|
||||||
return 0 < this.name.length ? this.name + ' (' + this.email + ')' : this.email;
|
|
||||||
};
|
|
||||||
|
|
||||||
module.exports = EmailModel;
|
module.exports = EmailModel;
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
|
@ -111,7 +111,6 @@
|
||||||
this.identitiesLoading = ko.observable(false).extend({'throttle': 100});
|
this.identitiesLoading = ko.observable(false).extend({'throttle': 100});
|
||||||
|
|
||||||
// contacts
|
// contacts
|
||||||
this.contactTags = ko.observableArray([]);
|
|
||||||
this.contacts = ko.observableArray([]);
|
this.contacts = ko.observableArray([]);
|
||||||
this.contacts.loading = ko.observable(false).extend({'throttle': 200});
|
this.contacts.loading = ko.observable(false).extend({'throttle': 200});
|
||||||
this.contacts.importing = ko.observable(false).extend({'throttle': 200});
|
this.contacts.importing = ko.observable(false).extend({'throttle': 200});
|
||||||
|
|
|
||||||
|
|
@ -715,12 +715,11 @@
|
||||||
/**
|
/**
|
||||||
* @param {?Function} fCallback
|
* @param {?Function} fCallback
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.contactSave = function (fCallback, sRequestUid, sUid, sTags, aProperties)
|
RemoteAppStorage.prototype.contactSave = function (fCallback, sRequestUid, sUid, aProperties)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'ContactSave', {
|
this.defaultRequest(fCallback, 'ContactSave', {
|
||||||
'RequestUid': sRequestUid,
|
'RequestUid': sRequestUid,
|
||||||
'Uid': Utils.trim(sUid),
|
'Uid': Utils.trim(sUid),
|
||||||
'Tags': Utils.trim(sTags),
|
|
||||||
'Properties': aProperties
|
'Properties': aProperties
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -271,27 +271,6 @@
|
||||||
-webkit-overflow-scrolling: touch;
|
-webkit-overflow-scrolling: touch;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tags-property-container {
|
|
||||||
font-size: 18px;
|
|
||||||
width: 400px;
|
|
||||||
|
|
||||||
.inputosaurus-container {
|
|
||||||
border-width: 1px;
|
|
||||||
border-color: transparent;
|
|
||||||
box-shadow: none;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
|
|
||||||
border-color: #ccc;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.inputosaurus-focused {
|
|
||||||
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
|
|
||||||
border-color: #999;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.contactValueStatic, .contactValueLargeStatic, .contactValueTextAreaStatic {
|
.contactValueStatic, .contactValueLargeStatic, .contactValueTextAreaStatic {
|
||||||
height: 20px;
|
height: 20px;
|
||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,6 @@
|
||||||
|
|
||||||
EmailModel = require('Model/Email'),
|
EmailModel = require('Model/Email'),
|
||||||
ContactModel = require('Model/Contact'),
|
ContactModel = require('Model/Contact'),
|
||||||
ContactTagModel = require('Model/ContactTag'),
|
|
||||||
ContactPropertyModel = require('Model/ContactProperty'),
|
ContactPropertyModel = require('Model/ContactProperty'),
|
||||||
|
|
||||||
kn = require('Knoin/Knoin'),
|
kn = require('Knoin/Knoin'),
|
||||||
|
|
@ -53,7 +52,6 @@
|
||||||
this.search = ko.observable('');
|
this.search = ko.observable('');
|
||||||
this.contactsCount = ko.observable(0);
|
this.contactsCount = ko.observable(0);
|
||||||
this.contacts = Data.contacts;
|
this.contacts = Data.contacts;
|
||||||
this.contactTags = Data.contactTags;
|
|
||||||
|
|
||||||
this.currentContact = ko.observable(null);
|
this.currentContact = ko.observable(null);
|
||||||
|
|
||||||
|
|
@ -74,21 +72,6 @@
|
||||||
this.viewReadOnly = ko.observable(false);
|
this.viewReadOnly = ko.observable(false);
|
||||||
this.viewProperties = ko.observableArray([]);
|
this.viewProperties = ko.observableArray([]);
|
||||||
|
|
||||||
this.viewTags = ko.observable('');
|
|
||||||
this.viewTags.visibility = ko.observable(false);
|
|
||||||
this.viewTags.focusTrigger = ko.observable(false);
|
|
||||||
|
|
||||||
this.viewTags.focusTrigger.subscribe(function (bValue) {
|
|
||||||
if (!bValue && '' === this.viewTags())
|
|
||||||
{
|
|
||||||
this.viewTags.visibility(false);
|
|
||||||
}
|
|
||||||
else if (bValue)
|
|
||||||
{
|
|
||||||
this.viewTags.visibility(true);
|
|
||||||
}
|
|
||||||
}, this);
|
|
||||||
|
|
||||||
this.viewSaveTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
|
this.viewSaveTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
|
||||||
|
|
||||||
this.viewPropertiesNames = this.viewProperties.filter(function(oProperty) {
|
this.viewPropertiesNames = this.viewProperties.filter(function(oProperty) {
|
||||||
|
|
@ -336,7 +319,7 @@
|
||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
}, sRequestUid, this.viewID(), this.viewTags(), aProperties);
|
}, sRequestUid, this.viewID(), aProperties);
|
||||||
|
|
||||||
}, function () {
|
}, function () {
|
||||||
var
|
var
|
||||||
|
|
@ -369,7 +352,7 @@
|
||||||
this.watchHash = ko.observable(false);
|
this.watchHash = ko.observable(false);
|
||||||
|
|
||||||
this.viewHash = ko.computed(function () {
|
this.viewHash = ko.computed(function () {
|
||||||
return '' + self.viewTags() + '|' + _.map(self.viewProperties(), function (oItem) {
|
return '' + _.map(self.viewProperties(), function (oItem) {
|
||||||
return oItem.value();
|
return oItem.value();
|
||||||
}).join('');
|
}).join('');
|
||||||
});
|
});
|
||||||
|
|
@ -385,23 +368,12 @@
|
||||||
|
|
||||||
this.sDefaultKeyScope = Enums.KeyState.ContactList;
|
this.sDefaultKeyScope = Enums.KeyState.ContactList;
|
||||||
|
|
||||||
this.contactTagsSource = _.bind(this.contactTagsSource, this);
|
|
||||||
|
|
||||||
kn.constructorEnd(this);
|
kn.constructorEnd(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
kn.extendAsViewModel(['View/Popup/Contacts', 'PopupsContactsViewModel'], ContactsPopupView);
|
kn.extendAsViewModel(['View/Popup/Contacts', 'PopupsContactsViewModel'], ContactsPopupView);
|
||||||
_.extend(ContactsPopupView.prototype, AbstractView.prototype);
|
_.extend(ContactsPopupView.prototype, AbstractView.prototype);
|
||||||
|
|
||||||
ContactsPopupView.prototype.contactTagsSource = function (oData, fResponse)
|
|
||||||
{
|
|
||||||
require('App/App').getContactTagsAutocomplete(oData.term, function (aData) {
|
|
||||||
fResponse(_.map(aData, function (oTagItem) {
|
|
||||||
return oTagItem.toLine(false);
|
|
||||||
}));
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
ContactsPopupView.prototype.getPropertyPlceholder = function (sType)
|
ContactsPopupView.prototype.getPropertyPlceholder = function (sType)
|
||||||
{
|
{
|
||||||
var sResult = '';
|
var sResult = '';
|
||||||
|
|
@ -442,12 +414,6 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
ContactsPopupView.prototype.addNewTag = function ()
|
|
||||||
{
|
|
||||||
this.viewTags.visibility(true);
|
|
||||||
this.viewTags.focusTrigger(true);
|
|
||||||
};
|
|
||||||
|
|
||||||
ContactsPopupView.prototype.addNewEmail = function ()
|
ContactsPopupView.prototype.addNewEmail = function ()
|
||||||
{
|
{
|
||||||
this.addNewProperty(Enums.ContactPropertyType.Email, 'Home');
|
this.addNewProperty(Enums.ContactPropertyType.Email, 'Home');
|
||||||
|
|
@ -621,7 +587,6 @@
|
||||||
|
|
||||||
this.emptySelection(false);
|
this.emptySelection(false);
|
||||||
this.viewReadOnly(false);
|
this.viewReadOnly(false);
|
||||||
this.viewTags('');
|
|
||||||
|
|
||||||
if (oContact)
|
if (oContact)
|
||||||
{
|
{
|
||||||
|
|
@ -647,14 +612,9 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
this.viewTags(oContact.tags);
|
|
||||||
|
|
||||||
this.viewReadOnly(!!oContact.readOnly);
|
this.viewReadOnly(!!oContact.readOnly);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.viewTags.focusTrigger.valueHasMutated();
|
|
||||||
this.viewTags.visibility('' !== this.viewTags());
|
|
||||||
|
|
||||||
aList.unshift(new ContactPropertyModel(Enums.ContactPropertyType.LastName, '', sLastName, false,
|
aList.unshift(new ContactPropertyModel(Enums.ContactPropertyType.LastName, '', sLastName, false,
|
||||||
this.getPropertyPlceholder(Enums.ContactPropertyType.LastName)));
|
this.getPropertyPlceholder(Enums.ContactPropertyType.LastName)));
|
||||||
|
|
||||||
|
|
@ -689,10 +649,10 @@
|
||||||
|
|
||||||
this.contacts.loading(true);
|
this.contacts.loading(true);
|
||||||
Remote.contacts(function (sResult, oData) {
|
Remote.contacts(function (sResult, oData) {
|
||||||
|
|
||||||
var
|
var
|
||||||
iCount = 0,
|
iCount = 0,
|
||||||
aList = [],
|
aList = []
|
||||||
aTagsList = []
|
|
||||||
;
|
;
|
||||||
|
|
||||||
if (Enums.StorageResultType.Success === sResult && oData && oData.Result && oData.Result.List)
|
if (Enums.StorageResultType.Success === sResult && oData && oData.Result && oData.Result.List)
|
||||||
|
|
@ -709,23 +669,12 @@
|
||||||
iCount = Utils.pInt(oData.Result.Count);
|
iCount = Utils.pInt(oData.Result.Count);
|
||||||
iCount = 0 < iCount ? iCount : 0;
|
iCount = 0 < iCount ? iCount : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Utils.isNonEmptyArray(oData.Result.Tags))
|
|
||||||
{
|
|
||||||
aTagsList = _.map(oData.Result.Tags, function (oItem) {
|
|
||||||
var oContactTag = new ContactTagModel();
|
|
||||||
return oContactTag.parse(oItem) ? oContactTag : null;
|
|
||||||
});
|
|
||||||
|
|
||||||
aTagsList = _.compact(aTagsList);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
self.contactsCount(iCount);
|
self.contactsCount(iCount);
|
||||||
|
|
||||||
self.contacts(aList);
|
self.contacts(aList);
|
||||||
self.contacts.loading(false);
|
self.contacts.loading(false);
|
||||||
self.contactTags(aTagsList);
|
|
||||||
|
|
||||||
self.viewClearSearch('' !== self.search());
|
self.viewClearSearch('' !== self.search());
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5390,7 +5390,6 @@ class Actions
|
||||||
|
|
||||||
$iResultCount = 0;
|
$iResultCount = 0;
|
||||||
$mResult = array();
|
$mResult = array();
|
||||||
$aTags = array();
|
|
||||||
|
|
||||||
$oAbp = $this->AddressBookProvider($oAccount);
|
$oAbp = $this->AddressBookProvider($oAccount);
|
||||||
if ($oAbp->IsActive())
|
if ($oAbp->IsActive())
|
||||||
|
|
@ -5398,8 +5397,6 @@ class Actions
|
||||||
$iResultCount = 0;
|
$iResultCount = 0;
|
||||||
$mResult = $oAbp->GetContacts($oAccount->ParentEmailHelper(),
|
$mResult = $oAbp->GetContacts($oAccount->ParentEmailHelper(),
|
||||||
$iOffset, $iLimit, $sSearch, $iResultCount);
|
$iOffset, $iLimit, $sSearch, $iResultCount);
|
||||||
|
|
||||||
$aTags = $oAbp->GetContactTags($oAccount->ParentEmailHelper());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->DefaultResponse(__FUNCTION__, array(
|
return $this->DefaultResponse(__FUNCTION__, array(
|
||||||
|
|
@ -5407,8 +5404,7 @@ class Actions
|
||||||
'Limit' => $iLimit,
|
'Limit' => $iLimit,
|
||||||
'Count' => $iResultCount,
|
'Count' => $iResultCount,
|
||||||
'Search' => $sSearch,
|
'Search' => $sSearch,
|
||||||
'List' => $mResult,
|
'List' => $mResult
|
||||||
'Tags' => $aTags
|
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -163,7 +163,7 @@ class Api
|
||||||
if (\RainLoop\Api::Actions()->AddressBookProvider() &&
|
if (\RainLoop\Api::Actions()->AddressBookProvider() &&
|
||||||
\RainLoop\Api::Actions()->AddressBookProvider()->IsActive())
|
\RainLoop\Api::Actions()->AddressBookProvider()->IsActive())
|
||||||
{
|
{
|
||||||
\RainLoop\Api::Actions()->AddressBookProvider()->DeleteAllContactsAndTags($sEmail);
|
\RainLoop\Api::Actions()->AddressBookProvider()->DeleteAllContacts($sEmail);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -113,9 +113,9 @@ class AddressBook extends \RainLoop\Providers\AbstractProvider
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function DeleteAllContactsAndTags($sEmail)
|
public function DeleteAllContacts($sEmail)
|
||||||
{
|
{
|
||||||
return $this->IsActive() ? $this->oDriver->DeleteAllContactsAndTags($sEmail) : false;
|
return $this->IsActive() ? $this->oDriver->DeleteAllContacts($sEmail) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -133,17 +133,6 @@ class AddressBook extends \RainLoop\Providers\AbstractProvider
|
||||||
$iOffset, $iLimit, $sSearch, $iResultCount) : array();
|
$iOffset, $iLimit, $sSearch, $iResultCount) : array();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $sEmail
|
|
||||||
* @param bool $bCache = true
|
|
||||||
*
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function GetContactTags($sEmail, $bCache = true)
|
|
||||||
{
|
|
||||||
return $this->IsActive() ? $this->oDriver->GetContactTags($sEmail, $bCache) : array();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $sEmail
|
* @param string $sEmail
|
||||||
* @param string $mID
|
* @param string $mID
|
||||||
|
|
|
||||||
|
|
@ -34,11 +34,6 @@ class Contact
|
||||||
*/
|
*/
|
||||||
public $Properties;
|
public $Properties;
|
||||||
|
|
||||||
/**
|
|
||||||
* @var array
|
|
||||||
*/
|
|
||||||
public $Tags;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var bool
|
* @var bool
|
||||||
*/
|
*/
|
||||||
|
|
@ -66,7 +61,6 @@ class Contact
|
||||||
$this->Display = '';
|
$this->Display = '';
|
||||||
$this->Changed = \time();
|
$this->Changed = \time();
|
||||||
$this->Properties = array();
|
$this->Properties = array();
|
||||||
$this->Tags = array();
|
|
||||||
$this->ReadOnly = false;
|
$this->ReadOnly = false;
|
||||||
$this->IdPropertyFromSearch = 0;
|
$this->IdPropertyFromSearch = 0;
|
||||||
$this->Etag = '';
|
$this->Etag = '';
|
||||||
|
|
@ -149,8 +143,6 @@ class Contact
|
||||||
{
|
{
|
||||||
$this->Properties[] = new \RainLoop\Providers\AddressBook\Classes\Property(PropertyType::FULLNAME, $this->Display);
|
$this->Properties[] = new \RainLoop\Providers\AddressBook\Classes\Property(PropertyType::FULLNAME, $this->Display);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->Tags = \array_map('trim', $this->Tags);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -211,7 +203,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->NICKNAME, $oVCard->CATEGORIES, $oVCard->{'X-RL-TAGS'});
|
unset($oVCard->FN, $oVCard->EMAIL, $oVCard->TEL, $oVCard->URL, $oVCard->NICKNAME);
|
||||||
|
|
||||||
$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)
|
||||||
|
|
@ -272,11 +264,6 @@ class Contact
|
||||||
$oVCard->N = array($sLastName, $sFirstName, $sMiddleName, $sPrefix, $sSuffix);
|
$oVCard->N = array($sLastName, $sFirstName, $sMiddleName, $sPrefix, $sSuffix);
|
||||||
$oVCard->REV = \gmdate('Ymd', $this->Changed).'T'.\gmdate('His', $this->Changed).'Z';
|
$oVCard->REV = \gmdate('Ymd', $this->Changed).'T'.\gmdate('His', $this->Changed).'Z';
|
||||||
|
|
||||||
if (0 < \count($this->Tags))
|
|
||||||
{
|
|
||||||
$oVCard->CATEGORIES = $this->Tags;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (string) $oVCard->serialize();
|
return (string) $oVCard->serialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -589,13 +576,6 @@ class Contact
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->Properties = $aProperties;
|
$this->Properties = $aProperties;
|
||||||
|
|
||||||
if (isset($oVCard->CATEGORIES))
|
|
||||||
{
|
|
||||||
$this->Tags = (array) $oVCard->CATEGORIES->getParts();
|
|
||||||
$this->Tags = \is_array($this->Tags) ? $this->Tags : array();
|
|
||||||
$this->Tags = \array_map('trim', $this->Tags);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->UpdateDependentValues();
|
$this->UpdateDependentValues();
|
||||||
|
|
|
||||||
|
|
@ -28,11 +28,6 @@ class PdoAddressBook
|
||||||
*/
|
*/
|
||||||
private $sPassword;
|
private $sPassword;
|
||||||
|
|
||||||
/**
|
|
||||||
* @var array
|
|
||||||
*/
|
|
||||||
private $aTagsCache;
|
|
||||||
|
|
||||||
public function __construct($sDsn, $sUser = '', $sPassword = '', $sDsnType = 'mysql')
|
public function __construct($sDsn, $sUser = '', $sPassword = '', $sDsnType = 'mysql')
|
||||||
{
|
{
|
||||||
$this->sDsn = $sDsn;
|
$this->sDsn = $sDsn;
|
||||||
|
|
@ -41,7 +36,6 @@ class PdoAddressBook
|
||||||
$this->sDsnType = $sDsnType;
|
$this->sDsnType = $sDsnType;
|
||||||
|
|
||||||
$this->bExplain = false; // debug
|
$this->bExplain = false; // debug
|
||||||
$this->aTagsCache = array(); // debug
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -470,14 +464,6 @@ class PdoAddressBook
|
||||||
':id_contact' => array($iIdContact, \PDO::PARAM_INT)
|
':id_contact' => array($iIdContact, \PDO::PARAM_INT)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
// clear previos tags
|
|
||||||
$this->prepareAndExecute(
|
|
||||||
'DELETE FROM rainloop_ab_tags_contacts WHERE id_contact = :id_contact',
|
|
||||||
array(
|
|
||||||
':id_contact' => array($iIdContact, \PDO::PARAM_INT)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -533,47 +519,6 @@ class PdoAddressBook
|
||||||
|
|
||||||
$this->prepareAndExecute($sSql, $aParams, true);
|
$this->prepareAndExecute($sSql, $aParams, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
$aTags = array();
|
|
||||||
$aContactTags = $this->GetContactTags($sEmail);
|
|
||||||
|
|
||||||
$fFindFunc = function ($sName) use ($aContactTags) {
|
|
||||||
|
|
||||||
$iResult = 0;
|
|
||||||
foreach ($aContactTags as $oItem)
|
|
||||||
{
|
|
||||||
if ($oItem && $oItem->Name === $sName)
|
|
||||||
{
|
|
||||||
$iResult = (int) $oItem->IdContactTag;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $iResult;
|
|
||||||
};
|
|
||||||
|
|
||||||
foreach ($oContact->Tags as $sTagName)
|
|
||||||
{
|
|
||||||
$iTagID = $fFindFunc($sTagName);
|
|
||||||
if (0 >= $iTagID)
|
|
||||||
{
|
|
||||||
$iTagID = $this->CreateTag($sEmail, $sTagName, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (\is_int($iTagID) && 0 < $iTagID)
|
|
||||||
{
|
|
||||||
$aTags[] = array(
|
|
||||||
':id_tag' => array($iTagID, \PDO::PARAM_INT),
|
|
||||||
':id_contact' => array($iIdContact, \PDO::PARAM_INT)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (0 < \count($aTags))
|
|
||||||
{
|
|
||||||
$sSql = 'INSERT INTO rainloop_ab_tags_contacts (id_tag, id_contact) VALUES (:id_tag, :id_contact)';
|
|
||||||
$this->prepareAndExecute($sSql, $aTags, true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (\Exception $oException)
|
catch (\Exception $oException)
|
||||||
|
|
@ -584,51 +529,6 @@ class PdoAddressBook
|
||||||
return 0 < $iIdContact;
|
return 0 < $iIdContact;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $sEmail
|
|
||||||
* @param string $sName
|
|
||||||
* @param bool $bSyncDb = true
|
|
||||||
*
|
|
||||||
* @return bool|int
|
|
||||||
*/
|
|
||||||
public function CreateTag($sEmail, $sName, $bSyncDb = true)
|
|
||||||
{
|
|
||||||
if ($bSyncDb)
|
|
||||||
{
|
|
||||||
$this->SyncDatabase();
|
|
||||||
}
|
|
||||||
|
|
||||||
$iUserID = $this->getUserId($sEmail);
|
|
||||||
|
|
||||||
$this->aTagsCache = array();
|
|
||||||
|
|
||||||
$mResult = false;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
$sSql = 'INSERT INTO rainloop_ab_tags '.
|
|
||||||
'(id_user, tag_name) VALUES (:id_user, :tag_name)';
|
|
||||||
|
|
||||||
$this->prepareAndExecute($sSql,
|
|
||||||
array(
|
|
||||||
':id_user' => array($iUserID, \PDO::PARAM_INT),
|
|
||||||
':tag_name' => array($sName, \PDO::PARAM_STR)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
$sLast = $this->lastInsertId('rainloop_ab_tags', 'id_tag');
|
|
||||||
if (\is_numeric($sLast) && 0 < (int) $sLast)
|
|
||||||
{
|
|
||||||
$mResult = (int) $sLast;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (\Exception $oException)
|
|
||||||
{
|
|
||||||
throw $oException;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $mResult;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $sEmail
|
* @param string $sEmail
|
||||||
* @param array $aContactIds
|
* @param array $aContactIds
|
||||||
|
|
@ -677,7 +577,7 @@ class PdoAddressBook
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function DeleteAllContactsAndTags($sEmail, $bSyncDb = true)
|
public function DeleteAllContacts($sEmail, $bSyncDb = true)
|
||||||
{
|
{
|
||||||
if ($bSyncDb)
|
if ($bSyncDb)
|
||||||
{
|
{
|
||||||
|
|
@ -690,136 +590,10 @@ class PdoAddressBook
|
||||||
|
|
||||||
$this->prepareAndExecute('DELETE FROM rainloop_ab_properties WHERE id_user = :id_user', $aParams);
|
$this->prepareAndExecute('DELETE FROM rainloop_ab_properties WHERE id_user = :id_user', $aParams);
|
||||||
$this->prepareAndExecute('DELETE FROM rainloop_ab_contacts WHERE id_user = :id_user', $aParams);
|
$this->prepareAndExecute('DELETE FROM rainloop_ab_contacts WHERE id_user = :id_user', $aParams);
|
||||||
$this->prepareAndExecute('DELETE FROM rainloop_ab_tags WHERE id_user = :id_user', $aParams);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $sEmail
|
|
||||||
* @param array $aTagsIds
|
|
||||||
*
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
public function DeleteTags($sEmail, $aTagsIds)
|
|
||||||
{
|
|
||||||
$this->SyncDatabase();
|
|
||||||
$iUserID = $this->getUserId($sEmail);
|
|
||||||
|
|
||||||
$aTagsIds = \array_filter($aTagsIds, function (&$mItem) {
|
|
||||||
$mItem = (int) \trim($mItem);
|
|
||||||
return 0 < $mItem;
|
|
||||||
});
|
|
||||||
|
|
||||||
if (0 === \count($aTagsIds))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->aTagsCache = array();
|
|
||||||
|
|
||||||
$sIDs = \implode(',', $aTagsIds);
|
|
||||||
$aParams = array(':id_user' => array($iUserID, \PDO::PARAM_INT));
|
|
||||||
|
|
||||||
$this->prepareAndExecute('DELETE FROM rainloop_pab_tags_contacts WHERE id_tag IN ('.$sIDs.')');
|
|
||||||
$this->prepareAndExecute('DELETE FROM rainloop_pab_tags WHERE id_user = :id_user AND id_tag IN ('.$sIDs.')', $aParams);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $sEmail
|
|
||||||
* @param array|\RainLoop\Providers\AddressBook\Classes\Contact $mContactOrContacts
|
|
||||||
*/
|
|
||||||
private function populateContactsByTags($sEmail, &$mContactOrContacts)
|
|
||||||
{
|
|
||||||
$aContacts = array();
|
|
||||||
if ($mContactOrContacts)
|
|
||||||
{
|
|
||||||
$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)
|
|
||||||
{
|
|
||||||
$aIdContacts[$oItem->IdContact] = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (0 < \count($aIdContacts))
|
|
||||||
{
|
|
||||||
$sSql = 'SELECT id_tag, id_contact FROM rainloop_ab_tags_contacts WHERE id_contact IN ('.\implode(',', \array_keys($aIdContacts)).')';
|
|
||||||
$oStmt = $this->prepareAndExecute($sSql);
|
|
||||||
|
|
||||||
if ($oStmt)
|
|
||||||
{
|
|
||||||
$aFetch = $oStmt->fetchAll(\PDO::FETCH_ASSOC);
|
|
||||||
if (\is_array($aFetch) && 0 < \count($aFetch))
|
|
||||||
{
|
|
||||||
foreach ($aFetch as $aItem)
|
|
||||||
{
|
|
||||||
if ($aItem && isset($aItem['id_tag'], $aItem['id_contact']))
|
|
||||||
{
|
|
||||||
$sID = (string) $aItem['id_contact'];
|
|
||||||
if (!isset($aIdTagsContacts[$sID]))
|
|
||||||
{
|
|
||||||
$aIdTagsContacts[$sID] = array();
|
|
||||||
}
|
|
||||||
|
|
||||||
$aIdTagsContacts[$sID][] = (string) $aItem['id_tag'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
unset($aFetch);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (0 < \count($aIdTagsContacts))
|
|
||||||
{
|
|
||||||
$fFindFunc = function ($sID) use ($aTags) {
|
|
||||||
|
|
||||||
foreach ($aTags as $oItem)
|
|
||||||
{
|
|
||||||
if ($oItem && (string) $oItem->IdContactTag === $sID)
|
|
||||||
{
|
|
||||||
return\trim($oItem->Name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return '';
|
|
||||||
};
|
|
||||||
|
|
||||||
foreach ($aContacts as &$oItem)
|
|
||||||
{
|
|
||||||
$sID = $oItem ? (string) $oItem->IdContact : '';
|
|
||||||
if (0 < \strlen($sID) && isset($aIdTagsContacts[$sID]) && \is_array($aIdTagsContacts[$sID]))
|
|
||||||
{
|
|
||||||
$aNames = array();
|
|
||||||
foreach ($aIdTagsContacts[$sID] as $sSubID)
|
|
||||||
{
|
|
||||||
$sName = $fFindFunc($sSubID);
|
|
||||||
if (0 < \strlen($sName))
|
|
||||||
{
|
|
||||||
$aNames[] = $sName;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$oItem->Tags = $aNames;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $sEmail
|
* @param string $sEmail
|
||||||
* @param int $iOffset = 0
|
* @param int $iOffset = 0
|
||||||
|
|
@ -1012,62 +786,6 @@ class PdoAddressBook
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->populateContactsByTags($sEmail, $aResult);
|
|
||||||
return $aResult;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $sEmail
|
|
||||||
* @param bool $bCache = true
|
|
||||||
*
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function GetContactTags($sEmail, $bCache = true)
|
|
||||||
{
|
|
||||||
if ($bCache && isset($this->aTagsCache[$sEmail]))
|
|
||||||
{
|
|
||||||
return $this->aTagsCache[$sEmail];
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->SyncDatabase();
|
|
||||||
|
|
||||||
$iUserID = $this->getUserId($sEmail);
|
|
||||||
|
|
||||||
$sSql = 'SELECT id_tag, id_user, tag_name FROM rainloop_ab_tags WHERE id_user = :id_user ORDER BY tag_name ASC';
|
|
||||||
|
|
||||||
$aParams = array(
|
|
||||||
':id_user' => array($iUserID, \PDO::PARAM_INT)
|
|
||||||
);
|
|
||||||
|
|
||||||
$aResult = array();
|
|
||||||
$oStmt = $this->prepareAndExecute($sSql, $aParams);
|
|
||||||
if ($oStmt)
|
|
||||||
{
|
|
||||||
$aFetch = $oStmt->fetchAll(\PDO::FETCH_ASSOC);
|
|
||||||
if (\is_array($aFetch) && 0 < \count($aFetch))
|
|
||||||
{
|
|
||||||
foreach ($aFetch as $aItem)
|
|
||||||
{
|
|
||||||
$iIdContactTag = $aItem && isset($aItem['id_tag']) ? (int) $aItem['id_tag'] : 0;
|
|
||||||
if (0 < $iIdContactTag)
|
|
||||||
{
|
|
||||||
$oContactTag = new \RainLoop\Providers\AddressBook\Classes\Tag();
|
|
||||||
|
|
||||||
$oContactTag->IdContactTag = (string) $iIdContactTag;
|
|
||||||
$oContactTag->Name = isset($aItem['tag_name']) ? (string) $aItem['tag_name'] : '';
|
|
||||||
$oContactTag->ReadOnly = $iUserID !== (isset($aItem['id_user']) ? (int) $aItem['id_user'] : 0);
|
|
||||||
|
|
||||||
$aResult[] = $oContactTag;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($bCache)
|
|
||||||
{
|
|
||||||
$this->aTagsCache[$sEmail] = $aResult;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $aResult;
|
return $aResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1171,11 +889,6 @@ class PdoAddressBook
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($oContact)
|
|
||||||
{
|
|
||||||
$this->populateContactsByTags($sEmail, $oContact);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $oContact;
|
return $oContact;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1609,27 +1322,6 @@ CREATE TABLE IF NOT EXISTS rainloop_ab_properties (
|
||||||
|
|
||||||
)/*!40000 ENGINE=INNODB *//*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
|
)/*!40000 ENGINE=INNODB *//*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS rainloop_ab_tags (
|
|
||||||
|
|
||||||
id_tag int UNSIGNED NOT NULL AUTO_INCREMENT,
|
|
||||||
id_user int UNSIGNED NOT NULL,
|
|
||||||
tag_name varchar(255) NOT NULL,
|
|
||||||
|
|
||||||
PRIMARY KEY(id_tag),
|
|
||||||
INDEX id_user_rainloop_ab_tags_index (id_user),
|
|
||||||
INDEX id_user_name_rainloop_ab_tags_index (id_user, tag_name)
|
|
||||||
|
|
||||||
)/*!40000 ENGINE=INNODB *//*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS rainloop_ab_tags_contacts (
|
|
||||||
|
|
||||||
id_tag int UNSIGNED NOT NULL,
|
|
||||||
id_contact bigint UNSIGNED NOT NULL,
|
|
||||||
|
|
||||||
INDEX id_tag_rainloop_ab_tags_contacts_index (id_tag),
|
|
||||||
INDEX id_contact_rainloop_ab_tags_contacts_index (id_contact)
|
|
||||||
|
|
||||||
)/*!40000 ENGINE=INNODB */;
|
|
||||||
MYSQLINITIAL;
|
MYSQLINITIAL;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
@ -1662,23 +1354,6 @@ CREATE TABLE rainloop_ab_properties (
|
||||||
CREATE INDEX id_user_rainloop_ab_properties_index ON rainloop_ab_properties (id_user);
|
CREATE INDEX id_user_rainloop_ab_properties_index ON rainloop_ab_properties (id_user);
|
||||||
CREATE INDEX id_user_id_contact_rainloop_ab_properties_index ON rainloop_ab_properties (id_user, id_contact);
|
CREATE INDEX id_user_id_contact_rainloop_ab_properties_index ON rainloop_ab_properties (id_user, id_contact);
|
||||||
|
|
||||||
CREATE TABLE rainloop_ab_tags (
|
|
||||||
id_tag serial PRIMARY KEY,
|
|
||||||
id_user integer NOT NULL,
|
|
||||||
tag_name varchar(255) NOT NULL
|
|
||||||
);
|
|
||||||
|
|
||||||
CREATE INDEX id_user_rainloop_ab_tags_index ON rainloop_ab_tags (id_user);
|
|
||||||
CREATE INDEX id_user_name_rainloop_ab_tags_index ON rainloop_ab_tags (id_user, tag_name);
|
|
||||||
|
|
||||||
CREATE TABLE rainloop_ab_tags_contacts (
|
|
||||||
id_tag integer NOT NULL,
|
|
||||||
id_contact integer NOT NULL
|
|
||||||
);
|
|
||||||
|
|
||||||
CREATE INDEX id_tag_rainloop_ab_tags_index ON rainloop_ab_tags_contacts (id_tag);
|
|
||||||
CREATE INDEX id_contact_rainloop_ab_tags_index ON rainloop_ab_tags_contacts (id_contact);
|
|
||||||
|
|
||||||
POSTGRESINITIAL;
|
POSTGRESINITIAL;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
@ -1711,23 +1386,6 @@ CREATE TABLE rainloop_ab_properties (
|
||||||
CREATE INDEX id_user_rainloop_ab_properties_index ON rainloop_ab_properties (id_user);
|
CREATE INDEX id_user_rainloop_ab_properties_index ON rainloop_ab_properties (id_user);
|
||||||
CREATE INDEX id_user_id_contact_rainloop_ab_properties_index ON rainloop_ab_properties (id_user, id_contact);
|
CREATE INDEX id_user_id_contact_rainloop_ab_properties_index ON rainloop_ab_properties (id_user, id_contact);
|
||||||
|
|
||||||
CREATE TABLE rainloop_ab_tags (
|
|
||||||
id_tag integer NOT NULL PRIMARY KEY,
|
|
||||||
id_user integer NOT NULL,
|
|
||||||
tag_name text NOT NULL
|
|
||||||
);
|
|
||||||
|
|
||||||
CREATE INDEX id_user_rainloop_ab_tags_index ON rainloop_ab_tags (id_user);
|
|
||||||
CREATE INDEX id_user_name_rainloop_ab_tags_index ON rainloop_ab_tags (id_user, tag_name);
|
|
||||||
|
|
||||||
CREATE TABLE rainloop_ab_tags_contacts (
|
|
||||||
id_tag integer NOT NULL,
|
|
||||||
id_contact integer NOT NULL
|
|
||||||
);
|
|
||||||
|
|
||||||
CREATE INDEX id_tag_rainloop_ab_tags_index ON rainloop_ab_tags_contacts (id_tag);
|
|
||||||
CREATE INDEX id_contact_rainloop_ab_tags_index ON rainloop_ab_tags_contacts (id_contact);
|
|
||||||
|
|
||||||
SQLITEINITIAL;
|
SQLITEINITIAL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -153,14 +153,6 @@
|
||||||
<span class="i18n" data-i18n-text="CONTACTS/ADD_MENU_NICKNAME"></span>
|
<span class="i18n" data-i18n-text="CONTACTS/ADD_MENU_NICKNAME"></span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="divider" role="presentation"></li>
|
|
||||||
<li class="e-item" role="presentation">
|
|
||||||
<a class="e-link menuitem" href="#" tabindex="-1" data-bind="click: addNewTag">
|
|
||||||
<i class="icon-tags"></i>
|
|
||||||
|
|
||||||
<span class="i18n" data-i18n-text="CONTACTS/ADD_MENU_TAGS"></span>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<!-- <li class="e-item" role="presentation">
|
<!-- <li class="e-item" role="presentation">
|
||||||
<a class="e-link menuitem" href="#" tabindex="-1" data-bind="click: addNewAddress">
|
<a class="e-link menuitem" href="#" tabindex="-1" data-bind="click: addNewAddress">
|
||||||
<span class="i18n" data-i18n-text="CONTACTS/ADD_MENU_ADDRESS"></span>
|
<span class="i18n" data-i18n-text="CONTACTS/ADD_MENU_ADDRESS"></span>
|
||||||
|
|
@ -263,18 +255,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group" data-bind="visible: !viewReadOnly() && viewTags.visibility()">
|
|
||||||
<label class="control-label remove-padding-top fix-width">
|
|
||||||
<i class="icon-tags iconsize24" data-tooltip-placement="left" data-bind="tooltip: 'CONTACTS/LABEL_TAGS'"></i>
|
|
||||||
</label>
|
|
||||||
<div class="controls fix-width">
|
|
||||||
<div class="property-line">
|
|
||||||
<div class="tags-property-container">
|
|
||||||
<input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" data-bind="contactTags: viewTags, contactTagsFilter: viewTags.focusTrigger, autoCompleteSource: contactTagsSource" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<div class="controls fix-width">
|
<div class="controls fix-width">
|
||||||
<br />
|
<br />
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue