Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
Calendar_Event_Recurring Class Reference
Inheritance diagram for Calendar_Event_Recurring:
Calendar_Event Asset MySource_Object

Public Member Functions

 Calendar_Event_Recurring ($assetid=0)
 
 load ($assetid)
 
 _preCreateCheck (&$link)
 
 _secondsToday ($timestamp)
 
 getInstanceDates ($date)
 
 getiCalFrequency ()
 
 getFriendlyFrequency ()
 
 getEventFrequency ($event=NULL)
 
 getiCalExceptions ($id=NULL)
 
 printBody ()
 
 _getAllowedLinks ()
 
 prepareLink (&$asset, $side_of_link, &$link_type, &$value, &$sort_order, &$dependant, &$exclusive)
 
 getKeywordReplacement ($keyword)
 
 _getCancelLink ()
 
 _getModifyLink ()
 
 processEventAction ($action_name)
 
addCancellation ($date, $reason)
 
addModification ($date, $description)
 
 cacheCalendarData ($updating=TRUE)
 
 getAvailableKeywords ()
 
- Public Member Functions inherited from Calendar_Event
 Calendar_Event ($assetid=0)
 
 _preCreateCheck (&$link)
 
 _createAdditional (&$link)
 
 delete ($release_lock=TRUE)
 
 getAvailableKeywords ()
 
 _getAllowedLinks ()
 
 _getDeleteLink ()
 
 saveAttributes ($dont_run_updated=FALSE)
 
 cloneComponents (&$clone, $components, $override=FALSE)
 
 getStartDate ()
 
 getEndDate ()
 
 getStartTime ()
 
 getEndTime ()
 
 getDuration ()
 
 getFriendlyStart ()
 
 getFriendlyEnd ()
 
 getFriendlyDatesAndTimes ()
 
 printBody ()
 
 processEventAction ($action_name)
 
 cacheCalendarData ($updating=TRUE)
 
 getKeywordReplacement ($keyword)
 
 getAsset ($whole_assetid)
 
 getAssetInfo (Array $assetids, $type_code=Array(), $strict_type_code=TRUE, $field='')
 
 getAttributeValuesByName ($attr_name, $asset_type, $assetids, $contextid=NULL)
 
- Public Member Functions inherited from Asset
 Asset ($assetid=0)
 
 create (Array &$link)
 
 load ($assetid)
 
 _loadDataPaths ()
 
 reload ()
 
 canDelete ()
 
 delete ($release_lock=TRUE, $check_locked=TRUE)
 
 useSystemVersion ()
 
 loadSystemVersion ()
 
 saveSystemVersion ()
 
 clearSystemVersion ()
 
 revertToSystemVersion ()
 
 revertNoticeLinksToSystemVersion ()
 
 _updated ($update_parents=TRUE)
 
 type ()
 
 getTypeAncestors ($include_asset=TRUE)
 
 incrementVersion ($number='micro', $update_parents=TRUE)
 
 getLanguages ()
 
 setLanguages (Array $languages)
 
 setCharset ($charset)
 
 setForceSecure ($force_secure)
 
 remapAssetids (Array $map)
 
 morph ($new_type_code)
 
 _morphCleanup ($new_type_code)
 
 onRequestKeywords (Asset $broadcaster, Array $vars=Array())
 
 canClone ()
 
 cloneComponents (Asset $clone, Array $components, $override=FALSE)
 
 cloneComponentsAdditional (Asset $clone, Array $components)
 
 cloneLinks (Asset $clone)
 
 getStatus ()
 
 getAvailableStatii ()
 
 getStatusDescription ()
 
 processStatusChange ($new_status, $update_parents=TRUE, $run_updated=TRUE)
 
 setDate ($date_type, $time=NULL, $userid=NULL)
 
 lockTypes ()
 
 canForceablyAcquireLock ($lock_type)
 
 getEditingLocks ($keywords)
 
 _getAllowedLinks ()
 
 createLink (Asset $minor, $link_type, $value='', $sort_order=NULL, $dependant='0', $exclusive='0', $moving=FALSE, $locked=0)
 
 prepareLink (Asset $asset, $side_of_link, &$link_type, &$value, &$sort_order, &$dependant, &$exclusive)
 
 canCreateLink (Asset $minor, $link_type, $exclusive)
 
 canMoveLink (Asset $minor, Asset $old_major, $link_type)
 
 describeLink ($linkid)
 
 isDeletableLink ($linkid)
 
 canDeleteLink ($linkid)
 
 deleteLink ($linkid, $check_locked=TRUE)
 
 linksUpdated ()
 
 canCloneLink ()
 
 saveAttributes ($dont_run_updated=FALSE, $log_message=TRUE)
 
 setAttrValue ($name, $value)
 
 attr ($name)
 
attrByRef ($name)
 
 getAttribute ($name, $mute_errors=FALSE)
 
 getAssetKeywords ($descriptions=FALSE)
 
 getAvailableKeywords ()
 
 getKeywordReplacement ($keyword)
 
 getAssetWebPathKeywordReplacement ()
 
 getCustomKeywordReplacements ($keywords=Array(), $invoke_backend=FALSE)
 
 processCustomKeywords ($keywords=Array())
 
 getContent ()
 
 setContent ()
 
 getEffectiveLastUpdatedTime ($assetids)
 
 readAccess (Array $assetids=Array())
 
 writeAccess ($lock_type='', Array $assetids=Array(), $only_workflow=TRUE)
 
 adminAccess ($lock_type='', Array $assetids=Array())
 
 backendAccess ()
 
 liveEditAccess ($lock_type)
 
 canliveEdit ($lock_type)
 
 effectiveUnrestricted ()
 
 checkAccess ($perm, $lock_type, Array $assetids=Array(), $only_workflow=TRUE)
 
 accessEffective ()
 
 permissionsUpdated ()
 
 printFrontend ()
 
 printFrontendAsset (Asset $asset, $design=NULL)
 
 getValidProtocols ()
 
 printHead ()
 
 printBody ()
 
 getCurrentPaintLayoutName ()
 
 getCurrentDesignName ()
 
 printBodyWithPaintLayout ($layout_id='')
 
 initLimbo ()
 
 printLimbo ()
 
 paintBackend (Backend_Outputter $o)
 
 getPrefix ()
 
 processBackend (Backend_Outputter $o, Array &$link)
 
 getEI ()
 
 getEditFns ()
 
 getBackendHref ($screen='', $backend_page=TRUE)
 
 getURL ($base_url=NULL, $ignore_rollback=FALSE, $base_contextid=NULL)
 
 getURLs ()
 
 getHref ($base_url=NULL, $ignore_rollback=FALSE)
 
 getWebDataPath ()
 
 getWebPaths ()
 
 saveWebPaths ($paths, $auto_add_remaps=TRUE)
 
 getLookups ($field='')
 
 getDesignLookups ()
 
 getLookupValues ($inherited=NULL, $prefix='', $like_search=TRUE, $ignore_override=FALSE)
 
 deleteLookupValue ($layout_name, $layout_value)
 
 setPaintLayouts ($layouts)
 
 updateLookups ($auto_add_remaps=TRUE)
 
 setLookupValues (Array $values)
 
 getAssetStatusDescriptionKeywordReplacement ()
 
 getAssetStatusColourKeywordReplacement ()
 
 replaceKeywordsInString ($string)
 
 fastTrack ($tasks)
 
 unFastTrack ($tasks)
 
 shouldFastTrack ($task, $assetid=NULL)
 
 getFaskTrackedTaskAssetids ($task)
 
 getDependantParentsURL ()
 
- Public Member Functions inherited from MySource_Object
 MySource_Object ()
 
 __sleep ()
 
 __wakeup ()
 

Static Public Member Functions

 getFirstOccurrenceAfter ($after=NULL, $start=NULL, $freq_type=NULL, $interval=NULL, $stop=NULL)
 
 hasOccurrenceOnDate ($date=NULL, $start=NULL, $freq_type=NULL, $interval=NULL, $stop=NULL)
 
 getExceptionLink ($date, $id=NULL)
 

Data Fields

 $parent_links = Array()
 

Additional Inherited Members

- Protected Member Functions inherited from Calendar_Event
 _getName ($short_name=FALSE, $contextid=NULL)
 

Detailed Description

Definition at line 34 of file calendar_event_recurring.inc.

Member Function Documentation

_getAllowedLinks ( )

Returns an array of all the permitted links type, the type asset and the cardinality

Returns
array private

Definition at line 877 of file calendar_event_recurring.inc.

_getCancelLink ( )

Return the link that the user can click to add a cancellation of this event from the event view

Returns
string private

Definition at line 1156 of file calendar_event_recurring.inc.

_getModifyLink ( )

Return the link that the user can click to modify an instance of this event from the event view

Returns
string private

Definition at line 1173 of file calendar_event_recurring.inc.

_preCreateCheck ( $link)

Perform any pre-validation required during the creation of this asset

For example, checking that attributes are set should bee performed in this method

Parameters
array&$linkinformation used to create the initial link
Array (
  'asset'        => [ref major asset to create link under],
  'link_type'    => SQ_LINK_?,
  'value'        => [link value],
  'sort_order'   => [link sort order],
  'is_dependant' => [0|1],
  'is_exclusive' => [0|1],
)
Returns
boolean private

Definition at line 89 of file calendar_event_recurring.inc.

_secondsToday (   $timestamp)

Returns the number of seconds since the start of the day

Parameters
int$timestampthe date to test
Returns
int private

Definition at line 109 of file calendar_event_recurring.inc.

& addCancellation (   $date,
  $reason 
)

Add a cancellation event linked under this recurring event

Parameters
string$datethe date of the occurrence to cancel (YYYY-MM-DD)
string$reasontext to put in the description field of the cancellation event
Returns
mixed object|boolean public

Definition at line 1303 of file calendar_event_recurring.inc.

& addModification (   $date,
  $description 
)

Add a modification event linked under this recurring event

Parameters
string$datethe date of the occurrence to cancel (YYYY-MM-DD)
string$descriptiontext to put in the description field of the cancellation event
Returns
mixed object|boolean public

Definition at line 1350 of file calendar_event_recurring.inc.

cacheCalendarData (   $updating = TRUE)

Cache the calendar data's stuff

Parameters
boolean$updatingare we updating (TRUE) or inserting a new record (FALSE - set only in create() call)
Returns
boolean private

Definition at line 1395 of file calendar_event_recurring.inc.

Calendar_Event_Recurring (   $assetid = 0)

Constructor

Parameters
int$assetidthe asset id to be loaded

Definition at line 45 of file calendar_event_recurring.inc.

getAvailableKeywords ( )

Return the keywords for this asset type.

This function is called in asset-listing situations like the asset listing, search page etc The return value is in the form:

Array(
  'name' => 'description' => 'the asset name',
);
Returns
array public

Definition at line 1493 of file calendar_event_recurring.inc.

getEventFrequency (   $event = NULL)

Returns recurring event's frequency in days

Parameters
array$eventEvent data (needs to supplied when called statically)
Returns
int|boolean public

Definition at line 747 of file calendar_event_recurring.inc.

getExceptionLink (   $date,
  $id = NULL 
)
static

Gets the link details of the exception (cancellation or modification) event linked under this event for the date given

This function can be called statically (with both parameters) or on an object (with just the first parameter)

Parameters
int$dateYYYY-MM-DD date to consider
int$idThe ID of the recurring event to test, or NULL to use the current object
Returns
mixed array|boolean public (optionally)

Definition at line 1128 of file calendar_event_recurring.inc.

getFirstOccurrenceAfter (   $after = NULL,
  $start = NULL,
  $freq_type = NULL,
  $interval = NULL,
  $stop = NULL 
)
static

Determines the next occurrence of an event on or after a certain time

This function can be called on an object (with just the first parameter) or statically (with all the parameters). If only $after is specified the object's attributes are used. If $after falls ON the date of one of the event's instances, that instance will be returned. If $after falls after the first day of an instance, the next instance will be returned. Returns the date (YYYY-MM-DD) of the next occurrence

Parameters
string$afterthe earliest date (YYYY-MM-DD) we are interested in
string$startThe date (YYYY-MM-DD) on which the event's first instance started
string$freq_type3-letter frequency code
int$intervalThe frequency interval
string$stopThe date on which the event stops recurring
Returns
int public

Definition at line 137 of file calendar_event_recurring.inc.

getFriendlyFrequency ( )

Returns this event's frequency in an easy-to-understand format

Returns
string public

Definition at line 641 of file calendar_event_recurring.inc.

getiCalExceptions (   $id = NULL)

Checks for cancellations and creates the iCalendar exception string for each one

Parameters
int$idId
Returns
string public

Definition at line 806 of file calendar_event_recurring.inc.

getiCalFrequency ( )

Returns this event's frequency in iCal Recurring Rule format

Returns
string public

Definition at line 526 of file calendar_event_recurring.inc.

getInstanceDates (   $date)

Returns the start and end dates/times of the instance containing a specified ISO date If the $date falls within the range of a certain event, it will return that date range. If $date does NOT fall within a recurrence it will return the dates of the NEXT instance that starts after $date.

Return value is Array('start' => start date/time of instance, 'end' => end date/time of instance)

Parameters
string$dateThe date to find an instance with
Returns
array public

Definition at line 472 of file calendar_event_recurring.inc.

getKeywordReplacement (   $keyword)

Get bodycopy keyword replacement

Provides a mechanism for providing keyword replacement functions by looking up the function named 'getKeywordNameKeywordReplacement' so an asset wishing to add support for 'best_ever' custom keyword should implement a function getBestEverKeywordReplacement() which returns a replacement string

Parameters
string$keywordKeyword to find a replacement for
Returns
string public

Definition at line 931 of file calendar_event_recurring.inc.

hasOccurrenceOnDate (   $date = NULL,
  $start = NULL,
  $freq_type = NULL,
  $interval = NULL,
  $stop = NULL 
)
static

Tells us whether this event has an occurrence on the specified date

This function can be called on an object (with just the first parameter) or statically (with all the parameters). If only $after is specified the object's attributes are used.

Parameters
string$datethe date we're interested in, in YYYY-MM-DD format - default is today's date (time can be passed in too but it will be stripped)
string$startThe iso datetime at which the event's 1st instance started
string$freq_type3-letter frequency code
int$intervalThe frequency interval
string$stopThe date after which recurrences should stop
Returns
boolean public

Definition at line 331 of file calendar_event_recurring.inc.

load (   $assetid)

Load the asset represented by the passed asset ID

Parameters
int$assetidthe asset ID to be loaded
Returns
void public

Definition at line 60 of file calendar_event_recurring.inc.

prepareLink ( $asset,
  $side_of_link,
$link_type,
$value,
$sort_order,
$dependant,
$exclusive 
)

Prepares for linking by checking that the link values are valid for this link

This function will be called if this asset is the major or minor party in the link, so the side_of_link flag should be checked to work out what side of the link this asset is on. The return value should indicate if any of the link fields were changed.

Parameters
object&$assetthe major or minor asset that we are linking to
string$side_of_linkthe side of the link we are on (major or minor)
string&$link_typethe type of link we are creating
string&$valuethe value that is to be associated with the link
string&$sort_orderthe position in the links list that this link should take,
string&$dependant'0' / '1' on whether the this asset is dependant on the asset that will be linked by the new link
string&$exclusive'0' / '1' on whether the this asset is linked exclusivly to the asset that will be linked by the new link
Returns
boolean public

Definition at line 907 of file calendar_event_recurring.inc.

printBody ( )

Called by the design to print the body of this asset

Returns
void public

Definition at line 833 of file calendar_event_recurring.inc.

processEventAction (   $action_name)

Process the specified action on this event, and return whatever html the action wants to show

Parameters
string$action_nameThe action to perform, eg 'cancel'
Returns
string public

Definition at line 1192 of file calendar_event_recurring.inc.


The documentation for this class was generated from the following file: