Documentation

CalendarRegistrationManager extends CalendarLibrary

Calendar Class Registration manager

Tags
subpackage

module_calendar

author

Cloudrexx info@cloudrexx.com

copyright

CLOUDREXX CMS - CLOUDREXX AG

version
1.00

Table of Contents

Constants

ATTACHMENT_FIELD_KEY  = 'attachment_id'
Attachment field key
MAP_FIELD_KEY  = 'map_id'
map field key
PICTURE_FIELD_KEY  = 'picture_id'
Picture field key
SHOW_EVENTS_OF_TODAY  = 0
Setting value for option frontendPastEvents defining that all events having their start date as of today shall be listed in frontend till the end of today.
SHOW_EVENTS_UNTIL_END  = 1
Setting value for option frontendPastEvents defining that only those events shall be listed in frontend that have not yet ended (end date lies in the past)
SHOW_EVENTS_UNTIL_START  = 2
Setting value for option frontendPastEvents defining that only those events shall be listed in frontend that have not yet started (start date lies in the future)

Properties

$_objTpl  : object
Template object
$arrCommunityGroups  : array<string|int, mixed>
Community group array
$arrFrontendLanguages  : array<string|int, mixed>
active frontend languages
$arrSettings  : array<string|int, mixed>
Settings array
$csvSeparator  : string
CSV separator
$defaultView  : bool
Set true when registration manager is loaded to parse the current view
$endDate  : int
Enddate filter
$errMessage  : string
Error message
$event  : CalendarEvent
Calendar Event instance
$moduleLangVar  : string
module language variable prefix
$moduleName  : string
module name
$moduleTablePrefix  : string
module table prefix
$okMessage  : type
Success message
$pageContent  : string
template content
$registrationList  : array<string|int, mixed>
Registration list
$settings  : array<string|int, mixed>
Static settings array to cache the fetched data from the database
$startDate  : int
Startdate filter
$cx  : Cx
$em  : EntityManager
$eventId  : int
Event id
$formId  : int
Form id
$getDeregistrations  : bool
Get deregistration
$getRegistrations  : bool
Get Registration
$getWaitlist  : bool
Get waitlist

Methods

__construct()  : mixed
Registration manager constructor
checkAccess()  : null
Checks the access level for the given action
detachEntity()  : null
Detach the entity
detachJoinedEntity()  : null
Detach the jointed entity
format2userDate()  : string
Returns the date string (according to the calendar's configuration) from a \DateTime object.
format2userDateTime()  : string
Returns the date/time string (according to the calendar's configuration) from a \DateTime object.
format2userTime()  : string
Returns the time string 'H:i' from a \DateTime object
formatDateTime2user()  : string
Returns a date/time string from a \DateTime object.
generateKey()  : string
generates the random key
getCommunityGroups()  : null
Initilize the available group
getComponent()  : SystemComponentController
Get component controller object
getDateFormat()  : string
Return's the dataformat based on the type
getDateTime()  : DateTime
Returns a \DateTime object from a calendar date/time string.
getDbDateTimeFromIntern()  : DateTime
Returns a \DateTime object in db timezone
getEscortData()  : int
Count returns the number of escort data for the event
getExeceptionDates()  : array<string|int, mixed>
Returns all series dates based on the given post data
getFrontendLanguages()  : null
Initialize the active frontend languages array
getHeadlinePlaceholders()  : array<string|int, mixed>
Get the list of calendar headline placeholders
getInternDateTimeFromDb()  : DateTime
Returns a \DateTime object from a date/time string.
getInternDateTimeFromUser()  : DateTime
Returns a \DateTime object from a date/time string.
getJavascript()  : string
Return's the billing address javascript
getRegistrationList()  : null
Initialize the registration list
getSettings()  : null
Prepares the settings from database to array format
getUserDateTimeFromIntern()  : DateTime
Returns a \DateTime object in user timezone
init()  : mixed
Initialize $cx and $em
parseEventRegistrationStats()  : mixed
Parse the Event registration stats dropdown to filter the registration
showRegistrationInputfields()  : mixed
Set the registration fields placeholders to the template
showRegistrationList()  : void
Parse the registrations of th event identified by {@see static::$eventId} and optional (if set) {@see static::$startDate} and {@see static::$endDate}.
triggerEvent()  : null
Trigger the event
fetchRegistrationData()  : array<string|int, mixed>
Fetch stored registration data for current event (identified by {@see static::e$eventId}).
fetchRegistrationListFields()  : array<string|int, mixed>
fetchStatsLabelByLevel()  : mixed
Fetch label for stats dropdown
fetchTemplateBlockSetup()  : array<string|int, mixed>
Identify the available template blocks to be used by {@see static::showRegistrationList()} for parsing the registration list(s).
getBlockToParseRegistrationList()  : string
Get the name of the template block from $template to be used to parse a registration entry of type $type.
getEventStats()  : array<string|int, mixed>
Get the event registration count by given filter output array format array( year => array( month => array( day1 => registration_count day2 => registration_count ) ) )
parseDateTimeString()  : array<string|int, mixed>
Split a datetime string (i.E.: '08.06.2015 13:37') into an array containing the date, hour and minutes information as separate elements.
parseRegistrationListLabels()  : void
Parse the labels of the form (identified by {@see static::$formId}) of which the registations have been parsed of.

Constants

ATTACHMENT_FIELD_KEY

Attachment field key

public string ATTACHMENT_FIELD_KEY = 'attachment_id'

SHOW_EVENTS_OF_TODAY

Setting value for option frontendPastEvents defining that all events having their start date as of today shall be listed in frontend till the end of today.

public int SHOW_EVENTS_OF_TODAY = 0

SHOW_EVENTS_UNTIL_END

Setting value for option frontendPastEvents defining that only those events shall be listed in frontend that have not yet ended (end date lies in the past)

public int SHOW_EVENTS_UNTIL_END = 1

SHOW_EVENTS_UNTIL_START

Setting value for option frontendPastEvents defining that only those events shall be listed in frontend that have not yet started (start date lies in the future)

public int SHOW_EVENTS_UNTIL_START = 2
Tags
todo

Implement behavior of this option

Properties

$arrCommunityGroups

Community group array

public array<string|int, mixed> $arrCommunityGroups = array()
Tags
access

public

$arrFrontendLanguages

active frontend languages

public array<string|int, mixed> $arrFrontendLanguages = array()
Tags
access

public

$arrSettings

Settings array

public array<string|int, mixed> $arrSettings = array()
Tags
access

public

$moduleLangVar

module language variable prefix

public string $moduleLangVar = "CALENDAR"
Tags
access

public

$moduleTablePrefix

module table prefix

public string $moduleTablePrefix = "calendar"
Tags
access

public

$settings

Static settings array to cache the fetched data from the database

public static array<string|int, mixed> $settings = array()

Methods

__construct()

Registration manager constructor

public __construct(CalendarEvent $event[, bool $getRegistrations = true ][, bool $getDeregistrations = false ][, bool $getWaitlist = false ][, int $startDate = null ][, int $endDate = null ][, bool $isDefaultView = false ]) : mixed

Loads the form object by loading the calendarEvent object

Parameters
$event : CalendarEvent

Event id

$getRegistrations : bool = true

condition to check whether we need the registrations

$getDeregistrations : bool = false

condition to check whether we need the deregistrations

$getWaitlist : bool = false

condition to check whether we need the waitlist

$startDate : int = null

Startdate filter

$endDate : int = null

Enddate filter

$isDefaultView : bool = false

Is registration manager is loaded to parse the current view

checkAccess()

Checks the access level for the given action

public checkAccess(string $strAction) : null

It checks the access level for the given action and return's null if access is granted otherwise it redirect the action to the respective fallback pages.

Parameters
$strAction : string

possible values are add_event, edit_event, my_events

Return values
null

detachEntity()

Detach the entity

public detachEntity(object $entity, string $methodName, array<string|int, mixed> $relation, array<string|int, mixed> $joinEntityRelation) : null
Parameters
$entity : object

entity object

$methodName : string

method name

$relation : array<string|int, mixed>

relationship array

$joinEntityRelation : array<string|int, mixed>

joined entity's relationship array

Return values
null

detachJoinedEntity()

Detach the jointed entity

public detachJoinedEntity(object $entity, array<string|int, mixed> $relations, array<string|int, mixed> $joinEntityRelation) : null
Parameters
$entity : object

entity object

$relations : array<string|int, mixed>

relationship array

$joinEntityRelation : array<string|int, mixed>

joined entity's relationship array

Return values
null

format2userDate()

Returns the date string (according to the calendar's configuration) from a \DateTime object.

public format2userDate(DateTime $dateTime) : string

The SUPPLIED \DateTime object must be in INTERNAL timezone. The RETURNED date string will be in USER timezone.

Parameters
$dateTime : DateTime

DateTime object in internal timezone

Return values
string

A date string

format2userDateTime()

Returns the date/time string (according to the calendar's configuration) from a \DateTime object.

public format2userDateTime(DateTime $dateTime) : string

The SUPPLIED \DateTime object must be in INTERNAL timezone. The RETURNED date/time string will be in USER timezone.

Parameters
$dateTime : DateTime

DateTime object in internal timezone

Return values
string

A date/time string

format2userTime()

Returns the time string 'H:i' from a \DateTime object

public format2userTime(DateTime $dateTime) : string

The SUPPLIED \DateTime object must be in INTERNAL timezone. The RETURNED time string will be in USER timezone.

Parameters
$dateTime : DateTime

DateTime object in internal timezone

Return values
string

A time string

formatDateTime2user()

Returns a date/time string from a \DateTime object.

public formatDateTime2user(DateTime $dateTime, string $format) : string

The SUPPLIED \DateTime object must be in INTERNAL timezone. The RETURNED date/time string will be in USER timezone.

Parameters
$dateTime : DateTime

DateTime object in internal timezone

$format : string

Format string

Return values
string

A date/time string formatted according to $format

generateKey()

generates the random key

public generateKey() : string
Return values
string

combination of alphabet and number in random order

getCommunityGroups()

Initilize the available group

public getCommunityGroups() : null

Fetch the available group from the database and assign those values into $this->arrCommunityGroups

Return values
null

getDateFormat()

Return's the dataformat based on the type

public getDateFormat([int $type = null ]) : string

Return's the dateformat by the given type 1 => frontend (javascript format alone) else backend

Parameters
$type : int = null

type 1 => frontend (javascript format alone) else backend

Return values
string

Date format

getDateTime()

Returns a \DateTime object from a calendar date/time string.

public getDateTime(string $date[, int $hour = 0 ][, int $minute = 0 ]) : DateTime

The format of a calendar date/time string can be configured in the settings section of the calendar component.

Note: In constrast to this method, the method getUserDateTimeFromUser() expects a PHP date/time string.

The SUPPLIED calendar date/time string must be in USER timezone. The RETURNED \DateTime object will be in INTERNAL timezone.

Parameters
$date : string

A calendar date/time string in user timezone

$hour : int = 0

Hour value

$minute : int = 0

Minute value

Return values
DateTime

\DateTime object in internal timezone

getDbDateTimeFromIntern()

Returns a \DateTime object in db timezone

public getDbDateTimeFromIntern(DateTime $dateTime) : DateTime

The SUPPLIED \DateTime object must be in INTERNAL timezone. The RETURNED \DateTime object will be in DB timezone.

Parameters
$dateTime : DateTime

\DateTime object in internal timezone

Return values
DateTime

\DateTime in db timezone

getEscortData()

Count returns the number of escort data for the event

public getEscortData() : int
Return values
int

number of escort data

getExeceptionDates()

Returns all series dates based on the given post data

public getExeceptionDates() : array<string|int, mixed>
Return values
array<string|int, mixed>

Array of dates

getFrontendLanguages()

Initialize the active frontend languages array

public getFrontendLanguages() : null

Fetch the active frontend languages from the database and assign those values into $this->arrFrontendLanguages

Return values
null

getHeadlinePlaceholders()

Get the list of calendar headline placeholders

public static getHeadlinePlaceholders() : array<string|int, mixed>
Return values
array<string|int, mixed>

getInternDateTimeFromDb()

Returns a \DateTime object from a date/time string.

public getInternDateTimeFromDb([string $time = 'now' ]) : DateTime

The SUPPLIED date/time string must be in DB timezone. The RETURNED \DateTime object will be in INTERNAL timezone.

Parameters
$time : string = 'now'

A date/time string in db timezone

Return values
DateTime

\DateTime object in internal timezone

getInternDateTimeFromUser()

Returns a \DateTime object from a date/time string.

public getInternDateTimeFromUser([string $time = 'now' ]) : DateTime

The SUPPLIED date/time string must be in USER timezone. The RETURNED \DateTime object will be in INTERNAL timezone.

Parameters
$time : string = 'now'

A date/time string in user timezone

Return values
DateTime

\DateTime object in internal timezone

getJavascript()

Return's the billing address javascript

public getJavascript() : string
Return values
string

Billing HereDoc phpscript

getSettings()

Prepares the settings from database to array format

public getSettings() : null

Loads the settings values from the database and assign those values into $this->arrSettings

Return values
null

getUserDateTimeFromIntern()

Returns a \DateTime object in user timezone

public getUserDateTimeFromIntern(DateTime $dateTime) : DateTime

The SUPPLIED \DateTime object must be in INTERNAL timezone. The RETURNED \DateTime object will be in USER timezone.

Parameters
$dateTime : DateTime

\DateTime object in internal timezone

Return values
DateTime

\DateTime in user timezone

parseEventRegistrationStats()

Parse the Event registration stats dropdown to filter the registration

public parseEventRegistrationStats(Sigma $objTpl[, array<string|int, mixed> $eventStats = array() ][, string $selected = '' ][, string $parent = '' ][, int $level = 1 ][, int $depth = 1 ][, string $blockName = 'calendar_registration_date' ][, mixed $labelStack = array() ]) : mixed
Parameters
$objTpl : Sigma

Template instance

$eventStats : array<string|int, mixed> = array()

Array of event stats

$selected : string = ''

Selected option

$parent : string = ''

Parent level

$level : int = 1

Current level of parsing, It is used to define the indent of the dropdown entry

$depth : int = 1

Current stats level of parsing. It is used to determine the type of the stats. Depth 1: Year value 2: Month 3: Day 4: Time

$blockName : string = 'calendar_registration_date'

Block name to parse

$labelStack : mixed = array()
Tags
todo

This method's code is magic. Trying to document it is pointless. It makes more sense to refactor the whole method instead.

showRegistrationInputfields()

Set the registration fields placeholders to the template

public showRegistrationInputfields(Sigma $objTpl[, int $regId = null ]) : mixed
Parameters
$objTpl : Sigma

Template instance

$regId : int = null

Registration id

showRegistrationList()

Parse the registrations of th event identified by {@see static::$eventId} and optional (if set) {@see static::$startDate} and {@see static::$endDate}.

public showRegistrationList(Sigma $objTpl[, string $tpl = '' ]) : void
Parameters
$objTpl : Sigma

Template instance to be used for parsing the registration list(s).

$tpl : string = ''

Type of registrations to list. One of:

  • r: Sign-ons
  • d: Sign-offs
  • w: Waitlist Leave empty to list all types of registrations.

triggerEvent()

Trigger the event

public triggerEvent(string $eventName[, object $entity = null ][, array<string|int, mixed> $relations = array() ][, bool $isDetach = false ]) : null
Parameters
$eventName : string

trigger event name

$entity : object = null

entity object

$relations : array<string|int, mixed> = array()

entity relations

$isDetach : bool = false

is detachable entity

Return values
null

fetchRegistrationData()

Fetch stored registration data for current event (identified by {@see static::e$eventId}).

protected fetchRegistrationData(array<string|int, mixed> $fields) : array<string|int, mixed>
Parameters
$fields : array<string|int, mixed>

List of form fields for associated event. (see static::fetchRegistrationListFields())

Return values
array<string|int, mixed>

List of registration data for the currently processed event (identified by static::$eventId and static::$formId. The format of the returned array is as follows: [ => [ => '', => '', ... ], ... ]

fetchRegistrationListFields()

protected fetchRegistrationListFields() : array<string|int, mixed>
Return values
array<string|int, mixed>

List of array elements that represent a field of the currently loaded form (static::$formId). The element's index represent each field's ID. The structure of an element field is as follows: [ 'id' => id of field 'name' => name of field 'defaults' => [ default values ] ]

fetchStatsLabelByLevel()

Fetch label for stats dropdown

protected fetchStatsLabelByLevel(int $level, string $key, mixed $value) : mixed
Parameters
$level : int

Nesting level of stats. Will be used to determine the type of label to return.

$key : string

The key used to identify the stats. Represents one of year, month, day or time.

$value : mixed

Either an array containing the stats or an integer representing the numer of registrations

fetchTemplateBlockSetup()

Identify the available template blocks to be used by {@see static::showRegistrationList()} for parsing the registration list(s).

protected fetchTemplateBlockSetup(Sigma $template) : array<string|int, mixed>
Parameters
$template : Sigma

Template instance that is used by static::showRegistrationList() for parsing the registration list(s).

Return values
array<string|int, mixed>

The returned array is a two-dimensional array, where the first dimension represents the matching registration type (reg/signoff/waitlist) which may or may not be set depending on the existance of the associated template blocks in $template. The associated template blocks would have the following format: <!-- BEGIN/END calendar_event_registration_list_<type> --> If there is a template block without type association present (<!-- BEGIN/END calendar_event_registration_list -->) then that block information will be returned by index '' (empty string). The format of the second dimension is as follows:

[
    'name' => '<name-of-template-block>',
    'parsed'  => false,
    'prefix' => '<prefix>',
    'empty' => '<name-of-empty-template-block>',
]

The keys have the following use:

  • name contains the name of the associated template block to be used by static::showRegistrationList() for parsing the associated registrations. I.e. calendar_event_registration_list_reg for type reg.
  • parsed is initially set to false and will be set to true by static::getBlockToParseRegistrationList() once the associated block (referenced by name) gets parsed. parsed will then be used by static::showRegistrationList() to determine if the block itself or its counterpart (-> empty-block) shall be touched or hidden.
  • prefix will be used by static::parseRegistrationListLabels() for parsing the type specific template blocks and placeholders. <prefix> is either set to an empty string (for <!-- BEGIN/END calendar_event_registration_list -->) or set to the elements index suffixed by an underscore. I.e. the <prefix> for type reg will be set to reg_.
  • empty contains the name of the associated template block to be used by static::showRegistrationList() to show if no registrations of the associated type have been parsed. Be aware that the key empty will only be set if the associated template block (i.e. calendar_event_registration_list_reg_empty) is present in the template. On the other hand, the keys name, parsed and prefex are also only set if the associated template (i.e. calendar_event_registration_list_reg) block is present in the template.

getBlockToParseRegistrationList()

Get the name of the template block from $template to be used to parse a registration entry of type $type.

protected getBlockToParseRegistrationList(Sigma $template, int $type, array<string|int, mixed> &$blocks) : string

If a matching block is found, the associated entry in $blocks is incremented by one. The latter will be used by static::showRegistrationList() to determine which main blocks need to be touched or hidden.

Parameters
$template : Sigma

Template instance that is used by static::showRegistrationList() for parsing the registration list(s).

$type : int

One of:

$blocks : array<string|int, mixed>

List of available blocks to parse from $template. See static::fetchTemplateBlockSetup().

Return values
string

Name of template block to be used to parse the registration entry of type $type.

getEventStats()

Get the event registration count by given filter output array format array( year => array( month => array( day1 => registration_count day2 => registration_count ) ) )

protected getEventStats() : array<string|int, mixed>
Return values
array<string|int, mixed>

parseDateTimeString()

Split a datetime string (i.E.: '08.06.2015 13:37') into an array containing the date, hour and minutes information as separate elements.

protected parseDateTimeString(string $datetime[, bool $allDay = false ][, bool $end = false ]) : array<string|int, mixed>
Parameters
$datetime : string

The datetime string to parse.

$allDay : bool = false

If set to TRUE, then the returned hour and minutes value are set to 0, unless $end is also set to TRUE.

$end : bool = false

If set to TRUE and $allDay is also set to TRUE, then the returned hour is set to 23 and the minutes to 59. If $allDay is not set to TRUE, then this argument has no effect.

Return values
array<string|int, mixed>

Return parsed datetime as array having the following format:

array(
     d.m.Y,
     G,
     m
)

parseRegistrationListLabels()

Parse the labels of the form (identified by {@see static::$formId}) of which the registations have been parsed of.

protected parseRegistrationListLabels(Sigma $template, array<string|int, mixed> $fields[, string $typePrefix = '' ]) : void
Parameters
$template : Sigma

Template instance to be used for parsing the registration list(s) labels.

$fields : array<string|int, mixed>

List of form fields for associated event. (see static::fetchRegistrationListFields())

$typePrefix : string = ''

Prefix to be used on template blocks and placeholders for parsing the labels.


        
On this page

Search results