Class ZmContact
Most of a contact's data is kept in attributes. These include name, phone, etc. Meta-data and data common to items are not kept in attributes. These include flags, tags, folder, and modified/created dates. Since the attribute data for contacts is loaded only once, a contact gets its attribute values from that canonical list. Defined in: ZmContact.js.
Class Detail
ZmContact(id, list, type, newDl)
Creates an empty contact.
Field Detail
<static>
ZmContact.IS_ADDONE
This structure can be queried to determine if the first
entry in a multi-value entry is suffixed with "1". Most
attributes add a numerical suffix to all but the first
entry.
Note: In most cases, ZmContact#getAttributeName is a better choice.
Method Detail
<static>
{int}
ZmContact.compareByFileAs(a, b)
Compares two contacts based on how they are filed. Intended for use by
sort methods.
<static>
{String}
ZmContact.computeCustomFileAs(customFileAs)
Computes the custom file as string by prepending "8:" to the given custom fileAs string.
<static>
ZmContact.computeFileAs(contact)
Figures out the filing string for the contact according to the chosen method.
create(attr, batchCmd, isAutoCreate)
Creates a contact from the given set of attributes. Used to create contacts on
the fly (rather than by loading them). This method is called by a list's
create()
method.
If this is a GAL contact, we assume it is being added to the contact list.
<static>
{ZmContact}
ZmContact.createFromDom(node, args)
Creates a contact from an XML node.
createFromVCard(msgId, vcardPartId)
Creates a contct from a VCF part of a message.
<static>
{String}
ZmContact.fileAsCompanyName(name, company)
Name printing helper "Company (Name)".
<static>
{String}
ZmContact.fileAsFirstLast(first, last, fullname, nickname)
Name printing helper "First Last".
<static>
{String}
ZmContact.fileAsLastFirst(first, last, fullname, nickname)
Name printing helper "Last, First".
<static>
{String}
ZmContact.fileAsNameCompany(name, company)
Name printing helper "Name (Company)".
{ZmAddrBook}
getAddressBook()
Gets the address book.
getAllDLMembers(callback)
Returns a list of all the distribution list members for this contact.
{AjxVector}
getAllGroupMembers()
parses "groups" attr into an AjxEmailAddress with a few extra attributes (see ZmContactsHelper._wrapInlineContact)
{String}
getAttendeeKey(type, shortForm)
Gets display text for an attendee. Prefers name over email.
{String}
getAttendeeText(type, shortForm)
Gets display text for an attendee. Prefers name over email.
<static>
{Object}
ZmContact.getAttr(contact, attr)
Gets an attribute.
{String}
getAttr(name)
Gets the attribute.
<static>
ZmContact.getAttributeName(name, index)
Gets an indexed attribute name taking into account if the field
with index 1 should append the "1" or not. Code should call this
function in lieu of accessing ZmContact.IS_ADDONE directly.
{Hash}
getAttrs(prefix)
Gets the contact attributes.
{String}
getCompanyField()
Gets the company field. Company field has a getter b/c fileAs may be the Company name so
company field should return "last, first" name instead *or* prepend the title
if fileAs is not Company (assuming it exists).
getDLMembers(offset, limit, callback)
Returns a list of distribution list members for this contact. Only the
requested range is returned.
getEmail(asObj)
Gets the email address.
{Array}
getEmails()
Gets the emails.
{Array}
getFields(field, sortByNameFunc)
Gets the fields.
{String}
getFileAs(lower)
Gets the filing string for this contact, computing it if necessary.
{String}
getFileAsNoName()
Gets the filing string for this contact, from the email address (used in case no name exists).
todo - maybe return this from getFileAs, but there are a lot of callers to getFileAs, and not sure
of the implications on all the use-cases.
{String}
getFolderId()
Gets the folder id.
{String}
getFullName(html)
Gets the full name.
{AjxVector}
getGroupMembers()
Gets the group members.
{String}
getHeader()
Gets the header.
{String}
getHomeAddrField(instance)
Gets the home address.
{String}
getIcon(addrBook)
Gets the icon.
{String}
getId(includeUserZid)
Returns the contact id. If includeUserZid is true it will return the format zid:id
{String}
getImageUrl(maxWidth, maxHeight)
Get the image URL.
Please note that maxWidth and maxHeight are hints, as they have no
effect on Zimlet-supplied images.
maxWidth {int} max pixel width (optional - default 48, or pass ZmContact.NO_MAX_IMAGE_WIDTH if full size image is required)
maxHeight {int} max pixel height (optional - default to maxWidth, or pass ZmContact.NO_MAX_IMAGE_HEIGHT if full size image is required)
getLookupEmail(asObj)
Gets the lookup email address, when an contact object is located using email address we store
the referred email address in this variable for easy lookup
<static>
{Hash}
ZmContact.getNormalizedAttrs(attrs, prefix, ignore)
Normalizes the numbering of the given attribute names and
returns a new object with the re-numbered attributes. For
example, if the attributes contains a "foo2" but no "foo",
then the "foo2" attribute will be renamed to "foo" in the
returned object.
{Hash}
getNormalizedAttrs(prefix)
Gets a normalized set of attributes where the attribute
names have been re-numbered as needed. For example, if the
attributes contains a "foo2" but no "foo", then the "foo2"
attribute will be renamed to "foo" in the returned object.
Note: This method is expensive so should be called once and cached temporarily as needed instead of being called for each normalized attribute that is needed.
{String}
getOtherAddrField(instance)
Gets the other address.
{String}
getParticipantRole()
gets the participant role.
{String}
getParticipantStatus()
gets the participant status.
{String}
getPhone()
Returns user's phone number
<static>
ZmContact.getPrefix(s)
returns the prefix of a string in the format "abc123". (would return "abc"). If the string is all number, it's a special case and returns the string itself. e.g. "234" would return "234".
{String}
getToolTip(email, isGal, hint)
Gets the tool tip for this contact.
{Array}
getUnknownFields(sortByNameFunc)
Gets the unknown fields.
{String}
getWorkAddrField(instance)
Gets the work address.
initFromEmail(email, strictName)
Initializes this contact using an email address.
initFromPhone(phone, field)
Initializes this contact using a phone number.
{Boolean}
isDistributionList()
Checks if the contact is a DL.
{Boolean}
isEmpty()
Checks if the contact attributes are empty.
{Boolean}
isGroup()
Checks if the contact is a group.
<static>
{Boolean}
ZmContact.isInTrash(contact)
Checks if the contact is in the trash.
{Boolean}
isLocked()
Checks if the contact is locked. This is different for DLs than read-only.
{Boolean}
isReadOnly()
Checks if the contact is read-only.
{Boolean}
isShared()
Checks if the contact is shared.
<static>
{Object}
ZmContact.mapAttrs(attrs)
Takes a hash of attrs and values and maps it to our attr names as best as it can. Scalar attrs will map if they
have the same name or only differ by case. A multivalued attr will map to a set of our attributes that share the
same case-insensitive base name. Some examples:
FIRSTNAME: "Mildred" => firstName: "Mildred"
email: ['a', 'b'] => email: 'a',
email2: 'b'
WorkEmail: ['y', 'z'] => workEmail1: 'y',
workEmail2: 'z'
IMaddress: ['f', 'g'] => imAddress1: 'f',
imAddress2: 'g'
modify(attr, callback, isAutoSave, batchCmd)
Updates contact attributes.
removeAttr(name)
Removes the attribute.
<static>
ZmContact.setAttr(contact, attr, value)
Sets the attribute.
setAttr(name, value)
Sets the attribute.
setParticipantRole(value)
Sets the participant role.
setParticipantStatus(value)
Sets the participant status.
{String}
toString()
Returns a string representation of the object.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Documentation generated by JsDoc Toolkit 2.3.0 on Tue Jun 28 2016 21:01:30 GMT-0400 (EDT)
|