Contacts tags support (unstable - step 1).

+ Small fixes
This commit is contained in:
RainLoop Team 2014-05-13 12:29:36 +04:00
parent 74fa12c000
commit 0ca00dec40
34 changed files with 1790 additions and 801 deletions

View file

@ -8,6 +8,7 @@ function ContactModel()
this.idContact = 0;
this.display = '';
this.properties = [];
this.tags = '';
this.readOnly = false;
this.focused = ko.observable(false);
@ -21,11 +22,11 @@ function ContactModel()
*/
ContactModel.prototype.getNameAndEmailHelper = function ()
{
var
var
sName = '',
sEmail = ''
;
if (Utils.isNonEmptyArray(this.properties))
{
_.each(this.properties, function (aProperty) {
@ -58,6 +59,7 @@ ContactModel.prototype.parse = function (oItem)
this.idContact = Utils.pInt(oItem['IdContact']);
this.display = Utils.pString(oItem['Display']);
this.readOnly = !!oItem['ReadOnly'];
this.tags = '';
if (Utils.isNonEmptyArray(oItem['Properties']))
{
@ -69,6 +71,11 @@ ContactModel.prototype.parse = function (oItem)
}, this);
}
if (Utils.isNonEmptyArray(oItem['Tags']))
{
this.tags = oItem['Tags'].join(';');
}
bResult = true;
}