Zimlet JavaScript API Reference - ZmCalItem

Class ZmCalItem


Extends ZmCalBaseItem.

This class represents a calendar item.

Defined in: ZmCalItem.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
ZmCalItem(type, list, id, folderId)
Field Summary
Field Attributes Field Name and Description
<static>  
Defines the "copy single instance" mode.
<static>  
ZmCalItem.MODE_DELETE
Defines the "delete" mode.
<static>  
Defines the "delete instance" mode.
<static>  
ZmCalItem.MODE_DELETE_SERIES
Defines the "delete series" mode.
<static>  
ZmCalItem.MODE_EDIT
Defines the "edit" mode.
<static>  
ZmCalItem.MODE_EDIT_SERIES
Defines the "edit series" mode.
<static>  
Defines the "edit single instance" mode.
<static>  
ZmCalItem.MODE_FORWARD
Defines the "forward" mode.
<static>  
Defines the "forward" mode.
<static>  
Defines the "forward series" mode.
<static>  
Defines the "forward single instance" mode.
<static>  
ZmCalItem.MODE_GET
Defines the "get" mode.
<static>  
ZmCalItem.MODE_LAST
Defines the "last" mode index constant.
<static>  
ZmCalItem.MODE_NEW
Defines the "new" mode.
<static>  
Defines the "new from quick" mode.
<static>  
ZmCalItem.MODE_PROPOSE_TIME
Defines the "propose" mode.
<static>  
ZmCalItem.MODE_PURGE
Defines the "purge" (delete from trash) mode.
<static>  
ZmCalItem.PRIORITY_HIGH
Defines the "high" priority.
<static>  
ZmCalItem.PRIORITY_LOW
Defines the "low" priority.
<static>  
ZmCalItem.PRIORITY_NORMAL
Defines the "normal" priority.
<static>  
ZmCalItem.REMINDER_NONE
Defines "none" reminder.
<static>  
ZmCalItem.REMINDER_UNIT_DAYS
Defines "days" reminder units.
<static>  
Defines "hours" reminder units.
<static>  
Defines "minutes "reminder units.
<static>  
Defines "weeks" reminder units.
<static>  
ZmCalItem.ROLE_CHAIR
Defines the "chair" role.
<static>  
Defines the "non-participant" role.
<static>  
ZmCalItem.ROLE_OPTIONAL
Defines the "optional" role.
<static>  
ZmCalItem.ROLE_REQUIRED
Defines the "required" role.
Method Summary
Method Attributes Method Name and Description
 
Sets the exception details to request
 
Adds the given action to this appt's reminders.
 
cancel(mode, msg, callback, errorCallback, batchCmd)
Deletes/cancels appointment/invite
 
clears the recurrence.
 
Gets the attachments.
 
getDateRange(instance, current, refPath)
Gets the date range.
 
getDetails(viewMode, callback, errorCallback, ignoreOutOfDate, noBusyOverlay, batchCmd)
Gets the details.
 
Gets the folder.
 
Gets the summary as HTML.
<static>  
ZmCalItem.getImageForPriority(task, id)
Gets the priority image.
 
Gets a string representation of the invite content.
<static>  
Gets the participation status label.
<static>  
ZmCalItem.getLabelForPriority(priority)
Gets the priority label.
<static>  
ZmCalItem.getLabelForStatus(status)
Gets the status label.
 
Gets the "local" folder id even for remote folders.
 
Gets the mail from address.
 
Gets the mail notification option.
 
getNotesPart(contentType)
Gets the notes part.
 
Gets the organizer.
 
Gets the organizer name.
 
Gets the original calendar item.
 
Gets the original end date.
 
Gets the original end time.
 
Gets the original start date.
 
Gets the original start time.
 
Gets the original timezone.
<static>  
ZmCalItem.getParticipationStatusIcon(status)
Gets the participation status icon.
 
Gets the recurrence "blurb".
 
Gets the recurrence.
 
Gets the recurrence "type".
 
Gets the remote folder owner.
 
Gets the sent by.
 
Gets the start hour in short date format.
 
getSummary(isHtml)
Gets the summary.
 
Gets the summary as text.
 
Gets the timezone.
 
getToolTip(controller)
Gets the tool tip.
 
Gets the unique end date.
 
Gets the unique start date.
 
Gets the view mode
 
Checks if this item has attachments.
 
Checks if this item has attendee type.
 
Checks if this item has attendees.
 
Checks if this item has person attendees.
 
Checks if this item has a custom recurrence.
 
isEndInRange(startTime, endTime)
Checks if the end date is in range.
 
Checks if the folder containing the item is read-only by the .
 
isInRange(startTime, endTime)
Checks if this item is in range.
 
Checks if this item is an organizer.
 
isOverlapping(other, checkFolder)
Checks if the item is overlapping.
 
Checks if the item is read-only.
 
Checks if this item is recurring.
 
isStartInRange(startTime, endTime)
Checks if the start date is in range.
 
Checks whether the duration of this item is valid.
 
Checks whether the duration of this item is valid with respect to the recurrence period.
 
Removes an attachment.
 
Removes the given action from this appt's reminders.
 
Resets the repeat custom day of week.
 
Resets the repeat monthly day months list.
 
Resets the repeat weekly days.
 
Resets the repeat yearly months list.
 
save(attachmentId, callback, errorCallback, notifyList)
Saves the item.
 
setAllDayEvent(isAllDay)
Sets all day event.
 
Sets the attachments.
 
setDateRange(rangeObject, instance, parentValue, refPath)
Sets the date range.
 
setEndDate(endDate, keepCache)
Sets the end date.
 
setEndTimezone(timezone)
Sets the end timezone.
 
setFolderId(folderId)
Sets the folder id.
 
Sets the required data from saved response
 
setMailNotificationOption(sendNotificationMail)
Sets the mail notification option.
 
setName(newName)
Sets the name.
 
setOrganizer(organizer)
Sets the organizer.
 
setOrigTimezone(timezone)
Sets the original timezone.
 
setRecurType(repeatType)
Sets the repeat type.
 
Sets reminder minutes.
 
setReminderUnits(reminderValue, reminderUnits, sendEmail)
Sets the reminder units
 
setStartDate(startDate, keepCache)
Sets the start date.
 
setTextNotes(notes)
Sets the notes (text/plain).
 
setTimezone(timezone, keepCache)
Sets the timezone.
 
setType(newType)
Sets the item type.
 
Sets the view mode, and resets any other fields that should not be set for that view mode.
 
Returns a string representation of the object.
Methods borrowed from class ZmCalBaseItem:
adjustMS, getAlarmData, getAlarmInstStart, getDuration, getDurationText, getEndTime, getLocation, getName, getParticipantStatusStr, getReminderName, getStartTime, getUniqueId, hasAlarmData, isAlarmInRange, isAlarmInstance, isAlarmOld, isAllDayEvent, isMultiDay
Methods borrowed from class ZmItem:
cache, canAddTag, clear, create, deleteLocal, flagLocal, getById, getDefaultDndAction, getFolderId, getRestUrl, getTagImageFromIds, getTagImageInfo, hasTag, isShared, modify, move, moveLocal, removeAllTagsLocal, rename, setFlag, tagLocal
Methods borrowed from class ZmModel:
addChangeListener, removeAllChangeListeners, removeChangeListener
Class Detail
ZmCalItem(type, list, id, folderId)
Parameters:
{constant} type
the item type
{ZmList} list
the list
{int} id
the task id
{String} folderId
the folder id
Field Detail
<static> ZmCalItem.MODE_COPY_SINGLE_INSTANCE
Defines the "copy single instance" mode.

<static> ZmCalItem.MODE_DELETE
Defines the "delete" mode.

<static> ZmCalItem.MODE_DELETE_INSTANCE
Defines the "delete instance" mode.

<static> ZmCalItem.MODE_DELETE_SERIES
Defines the "delete series" mode.

<static> ZmCalItem.MODE_EDIT
Defines the "edit" mode.

<static> ZmCalItem.MODE_EDIT_SERIES
Defines the "edit series" mode.

<static> ZmCalItem.MODE_EDIT_SINGLE_INSTANCE
Defines the "edit single instance" mode.

<static> ZmCalItem.MODE_FORWARD
Defines the "forward" mode.

<static> ZmCalItem.MODE_FORWARD_INVITE
Defines the "forward" mode.

<static> ZmCalItem.MODE_FORWARD_SERIES
Defines the "forward series" mode.

<static> ZmCalItem.MODE_FORWARD_SINGLE_INSTANCE
Defines the "forward single instance" mode.

<static> ZmCalItem.MODE_GET
Defines the "get" mode.

<static> ZmCalItem.MODE_LAST
Defines the "last" mode index constant.

<static> ZmCalItem.MODE_NEW
Defines the "new" mode.

<static> ZmCalItem.MODE_NEW_FROM_QUICKADD
Defines the "new from quick" mode.

<static> ZmCalItem.MODE_PROPOSE_TIME
Defines the "propose" mode.

<static> ZmCalItem.MODE_PURGE
Defines the "purge" (delete from trash) mode.

<static> ZmCalItem.PRIORITY_HIGH
Defines the "high" priority.

<static> ZmCalItem.PRIORITY_LOW
Defines the "low" priority.

<static> ZmCalItem.PRIORITY_NORMAL
Defines the "normal" priority.

<static> ZmCalItem.REMINDER_NONE
Defines "none" reminder.

<static> ZmCalItem.REMINDER_UNIT_DAYS
Defines "days" reminder units.

<static> ZmCalItem.REMINDER_UNIT_HOURS
Defines "hours" reminder units.

<static> ZmCalItem.REMINDER_UNIT_MINUTES
Defines "minutes "reminder units.

<static> ZmCalItem.REMINDER_UNIT_WEEKS
Defines "weeks" reminder units.

<static> ZmCalItem.ROLE_CHAIR
Defines the "chair" role.

<static> ZmCalItem.ROLE_NON_PARTICIPANT
Defines the "non-participant" role.

<static> ZmCalItem.ROLE_OPTIONAL
Defines the "optional" role.

<static> ZmCalItem.ROLE_REQUIRED
Defines the "required" role.
Method Detail
addExceptionDetails(comp)
Sets the exception details to request
Parameters:
{Element} comp
comp element of request object

addReminderAction(action)
Adds the given action to this appt's reminders. A type of action can only be added once.
Parameters:
{constant} action
alarm action

cancel(mode, msg, callback, errorCallback, batchCmd)
Deletes/cancels appointment/invite
Parameters:
{int} mode
designated what kind of delete op is this?
{ZmMailMsg} msg
the message to be sent in lieu of delete
{AjxCallback} callback
the callback to trigger after delete
{AjxCallback} errorCallback
the error callback to trigger
{ZmBatchCommand} batchCmd
set if part of a batch operation

clearRecurrence()
clears the recurrence.
Defined in: ZmAppt.js.

{Array} getAttachments()
Gets the attachments.
Returns:
{Array} an array of attachments or null for none

{Hash} getDateRange(instance, current, refPath)
Gets the date range.
Parameters:
{Object} instance
not used
{Object} current
not used
{Object} refPath
not used
Returns:
{Hash} a hash of startDate and endDate

getDetails(viewMode, callback, errorCallback, ignoreOutOfDate, noBusyOverlay, batchCmd)
Gets the details.
Parameters:
{constant} viewMode
the view mode
{AjxCallback} callback
the callback
{AjxCallback} errorCallback
the callback on error
{Boolean} ignoreOutOfDate
if true, ignore out of date items
{Boolean} noBusyOverlay
if true, no busy overlay
{ZmBatchCommand} batchCmd
set if part of a batch operation

{Object} getFolder()
Gets the folder.
Returns:
{Object} the folder

{String} getHtmlSummary()
Gets the summary as HTML.
Returns:
{String} the summary

<static> {String} ZmCalItem.getImageForPriority(task, id)
Gets the priority image.
Parameters:
{ZmTask} task
the task
{int} id
the id
Returns:
{String} the priority image

{String} getInviteDescription(isHtml)
Gets a string representation of the invite content.
Parameters:
{Boolean} isHtml
if true, get HTML content
Returns:
{String} a string representation of the invite

<static> {String} ZmCalItem.getLabelForParticipationStatus(status)
Gets the participation status label.
Parameters:
{int} status
the status (see ZmCalBaseItem.PSTATUS_ constants)
Returns:
{String} the status label
See:
ZmCalBaseItem

<static> {String} ZmCalItem.getLabelForPriority(priority)
Gets the priority label.
Parameters:
{int} priority
the priority (see ZmCalItem.PRIORITY_ constants)
Returns:
{String} the priority label

<static> {String} ZmCalItem.getLabelForStatus(status)
Gets the status label.
Parameters:
{int} status
the status (see ZmCalendarApp.STATUS_ constants)
Returns:
{String} the status label
See:
ZmCalendarApp

{ZmFolder|String} getLocalFolderId()
Gets the "local" folder id even for remote folders. Otherwise, just use this.folderId.
Returns:
{ZmFolder|String} the folder or folder id

{String} getMailFromAddress()
Gets the mail from address.
Returns:
{String} the address

{Boolean} getMailNotificationOption()
Gets the mail notification option.
Returns:
{Boolean} true if the mail notification is set; false otherwise

{String} getNotesPart(contentType)
Gets the notes part. This method will walk the notesParts array looking for the first part that matches given content type.
Parameters:
{constant} contentType
the content type (see ZmMimeTable.TEXT_PLAIN)
Returns:
{String} the content
See:
ZmMimeTable

{String} getOrganizer()
Gets the organizer.
Returns:
{String} the organizer

{String} getOrganizerName()
Gets the organizer name.
Returns:
{String} the organizer name

{ZmCalItem} getOrig()
Gets the original calendar item.
Returns:
{ZmCalItem} the original calendar item

{Date} getOrigEndDate()
Gets the original end date.
Returns:
{Date} the original end date

{Date} getOrigEndTime()
Gets the original end time.
Returns:
{Date} the original end time

{Date} getOrigStartDate()
Gets the original start date.
Returns:
{Date} the original start date

{Date} getOrigStartTime()
Gets the original start time.
Returns:
{Date} the original start time

{Date} getOrigTimezone()
Gets the original timezone.
Returns:
{Date} the original timezone

<static> {String} ZmCalItem.getParticipationStatusIcon(status)
Gets the participation status icon.
Parameters:
{int} status
the status (see ZmCalBaseItem.PSTATUS_ constants)
Returns:
{String} the status icon or an empty string if status not set
See:
ZmCalBaseItem

{String} getRecurBlurb()
Gets the recurrence "blurb".
Returns:
{String} the recurrence blurb
See:
ZmRecurrence

{ZmRecurrence} getRecurrence()
Gets the recurrence.
Returns:
{ZmRecurrence} the recurrence

{String} getRecurType()
Gets the recurrence "type".
Returns:
{String} the recurrence type
See:
ZmRecurrence

{String} getRemoteFolderOwner()
Gets the remote folder owner.
Returns:
{String} the "owner" of remote/shared item folder this item belongs to

{String} getSentBy()
Gets the sent by.
Returns:
{String} the sent by

{String} getShortStartHour()
Gets the start hour in short date format.
Returns:
{String} the start hour

{String} getSummary(isHtml)
Gets the summary.
Parameters:
{Boolean} isHtml
true to return as html
Returns:
{String} the summary

{String} getTextSummary()
Gets the summary as text.
Returns:
{String} the summary

{AjxTimezone} getTimezone()
Gets the timezone.
Returns:
{AjxTimezone} the timezone

{String} getToolTip(controller)
Gets the tool tip.
Parameters:
{ZmController} controller
the controller
Returns:
{String} the tool tip

{Date} getUniqueEndDate()
Gets the unique end date.
Returns:
{Date} the end date

{Date} getUniqueStartDate()
Gets the unique start date.
Returns:
{Date} the start date

getViewMode(mode)
Gets the view mode
Parameters:
mode

{Boolean} hasAttachments()
Checks if this item has attachments.
Returns:
{Boolean} true if this item has attachments

{Boolean} hasAttendeeForType(type)
Checks if this item has attendee type.
Parameters:
type
Returns:
{Boolean} always returns false; override if necessary

{Boolean} hasAttendees()
Checks if this item has attendees.
Returns:
{Boolean} always returns false; override if necessary

{Boolean} hasPersonAttendees()
Checks if this item has person attendees.
Returns:
{Boolean} always returns false; override if necessary

{Boolean} isCustomRecurrence()
Checks if this item has a custom recurrence.
Returns:
{Boolean} true for a custom recurrence

{Boolean} isEndInRange(startTime, endTime)
Checks if the end date is in range.
Parameters:
{Date} startTime
the start time of the range
{Date} endTime
the end time of the range
Returns:
{Boolean} true if the end date of this item is within range

{Boolean} isFolderReadOnly()
Checks if the folder containing the item is read-only by the .
Returns:
{Boolean} true if the folder is read-only

{Boolean} isInRange(startTime, endTime)
Checks if this item is in range.
Parameters:
{Date} startTime
the start range
{Date} endTime
the end range
Returns:
{Boolean} true if the item is in range

{Boolean} isOrganizer()
Checks if this item is an organizer.
Returns:
{Boolean} true for an organizer

{Boolean} isOverlapping(other, checkFolder)
Checks if the item is overlapping.
Parameters:
{ZmCalItem} other
the other item to check
{Boolean} checkFolder
true to check the folder id
Returns:
{Boolean} true if the items overlap; false if the items do not overlap or the item folder ids do not match

{Boolean} isReadOnly()
Checks if the item is read-only.
Returns:
{Boolean} true if the item is read-only

{Boolean} isRecurring()
Checks if this item is recurring.
Returns:
{Boolean} true for recurrence

{Boolean} isStartInRange(startTime, endTime)
Checks if the start date is in range.
Parameters:
{Date} startTime
the start time of the range
{Date} endTime
the end time of the range
Returns:
{Boolean} true if the start date of this item is within range

{Boolean} isValidDuration()
Checks whether the duration of this item is valid.
Returns:
{Boolean} true if the item possess valid duration.

{Boolean} isValidDurationRecurrence()
Checks whether the duration of this item is valid with respect to the recurrence period. For example, if the item repeats daily, its duration should not be longer than a day. This can get very complicated due to custom repeat rules. So the limitation is just set on the repeat type. The purpose is to prevent (as has happened) someone creating a repeating appt where they set the duration to be the span the appt is in effect over a year instead of its duration during the day. For example, repeat daily, start = Jan 1 2014, end = July 1 2014. See Bug 87993.
Returns:
{Boolean} true if the item possess valid duration.

removeAttachment(part)
Removes an attachment.
Parameters:
{Object} part
the attachment part to remove

removeReminderAction(action)
Removes the given action from this appt's reminders.
Parameters:
{constant} action
alarm action

resetRepeatCustomDayOfWeek()
Resets the repeat custom day of week.

resetRepeatMonthlyDayList()
Resets the repeat monthly day months list.

resetRepeatWeeklyDays()
Resets the repeat weekly days.

resetRepeatYearlyMonthsList(mo)
Resets the repeat yearly months list.
Parameters:
mo

save(attachmentId, callback, errorCallback, notifyList)
Saves the item.
Parameters:
{String} attachmentId
the id of the already uploaded attachment
{AjxCallback} callback
the callback triggered once request for appointment save is complete
{AjxCallback} errorCallback
the callback triggered if error during appointment save request
{Array} notifyList
the optional sublist of attendees to be notified (if different from original list of attendees)

setAllDayEvent(isAllDay)
Sets all day event.
Parameters:
{Boolean} isAllDay
true for an all day event

setAttachments(ids)
Sets the attachments.
Parameters:
{String} ids
a comma delimited string of ids

setDateRange(rangeObject, instance, parentValue, refPath)
Sets the date range.
Parameters:
{Hash} rangeObject
a hash of startDate and endDate
{Object} instance
not used
{Object} parentValue
not used
{Object} refPath
not used

setEndDate(endDate, keepCache)
Sets the end date.
Parameters:
{Date} endDate
the end date
{Boolean} keepCache
if true, keep the cache; false to reset the cache

setEndTimezone(timezone)
Sets the end timezone.
Parameters:
{AjxTimezone} timezone
the timezone

setFolderId(folderId)
Sets the folder id.
Parameters:
{String} folderId
the folder id

setFromSavedResponse(result)
Sets the required data from saved response
Parameters:
{Object} result
create/moify appt response

setMailNotificationOption(sendNotificationMail)
Sets the mail notification option.
Parameters:
{Boolean} sendNotificationMail
true to set the mail notification

setName(newName)
Sets the name.
Parameters:
{String} newName
the name

setOrganizer(organizer)
Sets the organizer.
Parameters:
{String} organizer
the organizer

setOrigTimezone(timezone)
Sets the original timezone.
Parameters:
{Object} timezone
the timezone

setRecurType(repeatType)
Sets the repeat type.
Parameters:
{constant} repeatType
the repeat type

setReminderMinutes(minutes)
Sets reminder minutes.
Parameters:
{int} minutes
the minutes

setReminderUnits(reminderValue, reminderUnits, sendEmail)
Sets the reminder units
Parameters:
{int} reminderValue
the reminder value
{int} reminderUnits
the reminder units
sendEmail

setStartDate(startDate, keepCache)
Sets the start date.
Parameters:
{Date} startDate
the start date
{Boolean} keepCache
if true, keep the cache; false to reset the cache

setTextNotes(notes)
Sets the notes (text/plain).
Parameters:
{String} notes
the notes

setTimezone(timezone, keepCache)
Sets the timezone.
Parameters:
{AjxTimezone} timezone
the timezone
{Boolean} keepCache
if true, keep the cache; false to reset the cache

setType(newType)
Sets the item type.
Parameters:
{constant} newType
the item type

setViewMode(mode)
Sets the view mode, and resets any other fields that should not be set for that view mode.
Parameters:
{constant} mode
the mode (see ZmCalItem.MODE_ constants)

{String} toString()
Returns a string representation of the object.
Returns:
{String} a string representation of the object

Documentation generated by JsDoc Toolkit 2.3.0 on Tue Jun 28 2016 21:01:33 GMT-0400 (EDT)