Overview

Packages

  • application
    • commands
    • components
      • actions
      • filters
      • leftWidget
      • permissions
      • sortableWidget
      • util
      • webupdater
      • x2flow
        • actions
        • triggers
      • X2GridView
      • X2Settings
    • controllers
    • models
      • embedded
    • modules
      • accounts
        • controllers
        • models
      • actions
        • controllers
        • models
      • calendar
        • controllers
        • models
      • charts
        • models
      • contacts
        • controllers
        • models
      • docs
        • components
        • controllers
        • models
      • groups
        • controllers
        • models
      • marketing
        • components
        • controllers
        • models
      • media
        • controllers
        • models
      • mobile
        • components
      • opportunities
        • controllers
        • models
      • products
        • controllers
        • models
      • quotes
        • controllers
        • models
      • services
        • controllers
        • models
      • template
        • models
      • users
        • controllers
        • models
      • workflow
        • controllers
        • models
      • x2Leads
        • controllers
        • models
  • None
  • system
    • base
    • caching
    • console
    • db
      • ar
      • schema
    • validators
    • web
      • actions
      • auth
      • helpers
      • widgets
        • captcha
        • pagers
  • zii
    • widgets
      • grid

Classes

  • Actions
  • Overview
  • Package
  • Class
  • Tree

Class Actions

This is the model class for table "x2_actions".

CComponent
Extended by CModel implements IteratorAggregate, ArrayAccess
Extended by CActiveRecord
Extended by X2ActiveRecord
Extended by X2Model
Extended by Actions
Package: application\modules\actions\models
Located at x2engine/protected/modules/actions/models/Actions.php
Methods summary
public static
# associateAction( X2Model $model, array $attributes )

Add note to model

Add note to model

Parameters

$model
X2Model
$model model to which note should be added
$attributes
string
$note
public static array
# getFormTypes( )

Get names of CFormModel classes associated with action subtypes

Get names of CFormModel classes associated with action subtypes

Returns

array
public static Actions
# model( string $className = __CLASS__ )

Returns the static model of the specified AR class.

Returns the static model of the specified AR class.

Parameters

$className
string
$className active record class name.

Returns

Actions
the static model class

Overrides

X2Model::model()
public string
# tableName( )

Returns

string
the associated database table name

Overrides

CActiveRecord::tableName()
public array
# behaviors( )

Returns a list of behaviors that this model should behave as.

Returns a list of behaviors that this model should behave as.

Returns

array
the behavior configurations (behavior name=>behavior configuration)

Overrides

X2Model::behaviors()
public array
# rules( )

Returns

array
validation rules for model attributes.

Overrides

X2Model::rules()
public
# validateNotificationUsers( mixed $attribute )
public array
# relations( )

Returns

array
relational rules.

Overrides

X2Model::relations()
public
# setX2Fields( array & $data, boolean $filter = false, boolean $bypassPermissions = false )

Sets attributes using X2Fields

Sets attributes using X2Fields

Parameters

$data
array
&$data array of attributes to be set (eg. $_POST['Contacts'])
$filter
boolean
$filter encode all HTML special characters in input
$bypassPermissions
boolean
$bypassPermissions (optional)

Overrides

X2Model::setX2Fields()
public mixed
# multiAssociateWith( X2Model $model )

Associate this action with a record (using join table)

Associate this action with a record (using join table)

Parameters

$model
X2Model
$model

Returns

mixed
false if model couldn't be saved, -1 if association already exists, true if successful

Throws

CException
if this action has an invalid association type
public array
# getMultiassociations( mixed $modelClass = null )

Retrieve the associated models

Retrieve the associated models

Returns

array
of associated models, indexed by model type
public
# convertToMultiassociation( )

Convert an Action from a single association to multiassociation

Convert an Action from a single association to multiassociation

public String
# getAttributeLabel( string $attribute, mixed $short = false )

Returns action type specific attribute labels

Returns action type specific attribute labels

Parameters

$attribute
string
$attribute the attribute name
$short

Returns

String

Overrides

X2Model::getAttributeLabel()
public array
# attributeNames( )

Returns the list of all attribute names of the model. This would return all column names of the table associated with this AR class.

Returns the list of all attribute names of the model. This would return all column names of the table associated with this AR class.

Returns

array
list of attribute names.

Overrides

CActiveRecord::attributeNames()
public array
# getAttributes( mixed $names = true )

Returns all column attribute values. Note, related objects are not returned.

Returns all column attribute values. Note, related objects are not returned.

Parameters

$names
mixed
$names names of attributes whose value needs to be returned. If this is true (default), then all attribute values will be returned, including those that are not loaded from DB (null will be returned for those attributes). If this is null, all attributes except those that are not loaded from DB will be returned.

Returns

array
attribute values indexed by attribute names.

Overrides

CActiveRecord::getAttributes()
public mixed
# getAttribute( string $name, boolean $renderFlag = false, boolean $makeLinks = false )

Returns the named attribute value. Recognizes linked attributes and looks them up with X2Model::getLinkedAttribute()

Returns the named attribute value. Recognizes linked attributes and looks them up with X2Model::getLinkedAttribute()

Parameters

$name
string
$name the attribute name
$renderFlag
boolean
$renderFlag
$makeLinks
boolean
$makeLinks If the render flag is set, determines whether to render attributes as links

Returns

mixed
the attribute value. Null if the attribute is not set or does not exist.

See

CActiveRecord::hasAttribute()

Overrides

X2Model::getAttribute()
public
# getAssociation( )
public boolean
# beforeSave( )

Fixes up record association, parses dates (since this doesn't use X2Model::setX2Fields())

Fixes up record association, parses dates (since this doesn't use X2Model::setX2Fields())

Returns

boolean
whether or not to save

Overrides

X2Model::beforeSave()
public boolean
# beforeDelete( )

This method is invoked before deleting a record. The default implementation raises the CActiveRecord::onBeforeDelete() event. You may override this method to do any preparation work for record deletion. Make sure you call the parent implementation so that the event is raised properly.

This method is invoked before deleting a record. The default implementation raises the CActiveRecord::onBeforeDelete() event. You may override this method to do any preparation work for record deletion. Make sure you call the parent implementation so that the event is raised properly.

Returns

boolean
whether the record should be deleted. Defaults to true.

Overrides

CActiveRecord::beforeDelete()
public CActiveRecord[]
# findAllWithoutActionText( mixed $condition = '', array $params = array() )

Modified findAll function that doesn't attach actionText. See X2Model::findAll().

Modified findAll function that doesn't attach actionText. See X2Model::findAll().

Parameters

$condition
mixed
$condition query condition or criteria
$params
array
$params parameters to be bound to an SQL statement.

Returns

CActiveRecord[]
list of active records satisfying the specified condition. An empty array is returned if none is found.
public
# afterFind( )

Saves attributes on initial model lookup

Saves attributes on initial model lookup

Overrides

X2Model::afterFind()
public
# setTimerIds( mixed $timers )
public
# afterSave( )

Runs when a model is saved. Scans attributes for phone numbers and index them in x2_phone_numbers. Updates x2_relationships table based on link type fields. Fires onAfterSave event.

Runs when a model is saved. Scans attributes for phone numbers and index them in x2_phone_numbers. Updates x2_relationships table based on link type fields. Fires onAfterSave event.

Overrides

X2Model::afterSave()
public
# requiredAssoc( mixed $attribute, mixed $params = array() )
public
# createEvents( mixed $eventType, mixed $timestamp )

Creates an event for each assignee

Creates an event for each assignee

public
# createCalendarFeedEvent( )
public array
# createNotifications( mixed $notificationUsers = 'assigned', mixed $createDate = null, mixed $type = 'create' )

Creates a notification for each assignee

Creates a notification for each assignee

Returns

array
the notifications created by this method
public
# afterCreate( )

Creates an action reminder event. Fires the onAfterCreate event in X2Model::afterCreate()

Creates an action reminder event. Fires the onAfterCreate event in X2Model::afterCreate()

Overrides

X2Model::afterCreate()
public
# afterDelete( )

Deletes the action reminder event, if any Fires the onAfterDelete event in X2Model::afterDelete()

Deletes the action reminder event, if any Fires the onAfterDelete event in X2Model::afterDelete()

Overrides

X2Model::afterDelete()
public
# setEventSubtype( mixed $value )

Sets action subtype for actions of type event

Sets action subtype for actions of type event

public
# setEventStatus( mixed $value )
public
# setActionDescription( mixed $value )
public
# getEventSubtype( )
public
# getEventStatus( )
public
# getActionDescription( )
public boolean
# complete( string $completedBy = null, mixed $notes = null )

Marks the action complete and updates the record.

Marks the action complete and updates the record.

Parameters

$completedBy
string
$completedBy the user completing the action (defaults to currently logged in user)
$notes

Returns

boolean
whether or not the action updated successfully
public boolean
# uncomplete( )

Marks the action incomplete and updates the record.

Marks the action incomplete and updates the record.

Returns

boolean
whether or not the action updated successfully
public
# getName( )

Overrides

X2ActiveRecord::getName()
public
# getLink( mixed $length = 30, mixed $frame = true )
public
# frameLink( )
public string
# getShortActionText( integer $length = 30, string $overflow = '...' )

Queries the database for the first characters of an action description

Queries the database for the first characters of an action description

Parameters

$length
integer
$length length of string to retrieve
$overflow
string
$overflow string to append to text if it overflows

Returns

string
public
# getAssociationLink( )
public
# getRelevantTimestamp( )
public static
# parseStatus( mixed $dueDate, mixed $dateWidth = 'long', mixed $timeWidth = 'short' )
public
# formatDueDate( )
public static
# formatTimeLength( mixed $seconds )
public static
# createCondition( mixed $filters )
public
# search( mixed $criteria = null, mixed $pageSize = null )
public
# searchIndex( mixed $pageSize = null, mixed $uniqueId = null )

Today's Actions

Today's Actions

public
# searchAll( )

All My Actions

All My Actions

public
# searchAllGroup( )

Everyone's Actions

Everyone's Actions

public CActiveDataProvider
# searchBase( CDbCriteria $criteria, integer $pageSize = null, mixed $showHidden = false )

Base search function, includes Retrieves a list of models based on the current
search/filter conditions.

Base search function, includes Retrieves a list of models based on the current search/filter conditions.

Parameters

$criteria
CDbCriteria
$criteria the attribute name
$pageSize
integer
$pageSize If set, will override property of profile model
$showHidden

Returns

CActiveDataProvider
the data provider that can return the models based on the search/filter conditions.

Overrides

X2Model::searchBase()
public
# compareAttributes( mixed & $criteria )

Override parent method to exclude actionDescription

Override parent method to exclude actionDescription

Overrides

X2Model::compareAttributes()
public
# syncGoogleCalendar( mixed $operation, mixed $ajax = false )

TODO: unit test

TODO: unit test

public
# getActionLink( string $linkText )

Returns a link which opens an action view dialog. Event bound in actionFrames.js.

Returns a link which opens an action view dialog. Event bound in actionFrames.js.

Parameters

$linkText
string
$linkText The text to display in the <a> tag.
public static integer
# changeCompleteState( string $operation, array $ids )

Completes/uncompletes set of actions

Completes/uncompletes set of actions

Parameters

$operation
string
$operation <'complete' | 'uncomplete'>
$ids
array
$ids

Returns

integer
$updated number of actions updated successfully
public
# getIsTimedType( )

Returns whether this is the type of action that can be time-tracked

Returns whether this is the type of action that can be time-tracked

public array
# getProfilesOfAssignees( )

Returns

array
all profiles of assignees. For assignees which are groups, all profiles of users in those groups are returned. If an assignee is included more than once, duplicate profiles are removed.
public mixed
# getEditableFieldNames( boolean $suppressAttributeLabels = true )

Override parent method so that action type can be set from X2Flow create action

Override parent method so that action type can be set from X2Flow create action

Parameters

$suppressAttributeLabels
boolean
if false, get attribute labels as well as field names

Returns

mixed
if $suppressAttributeLabels is true, an array of field names is returned, otherwise an associative array is returned (fieldName => attributeLabel)

Overrides

X2Model::getEditableFieldNames()
public static
# getPriorityLabels( )
public string
# getPriorityLabel( )

Retrieve the priority label string, or return the default priority ("Low")

Retrieve the priority label string, or return the default priority ("Low")

Returns

string
Priority label
public type
# renderAttribute( type $fieldName, type $makeLinks = true, type $textOnly = true, type $encode = true )

Special override that prints priority accordingly

Special override that prints priority accordingly

Parameters

$fieldName
type
$fieldName
$makeLinks
type
$makeLinks
$textOnly
type
$textOnly
$encode
type
$encode

Returns

type

Overrides

X2ActiveRecord::renderAttribute()
public
# renderInlineViewLink( mixed $text = null )
public string
# renderInput( type $fieldName, type $htmlOptions = array() )

Parameters

$fieldName
type
$fieldName
$htmlOptions
type
$htmlOptions

Returns

string
the HTML or text for the formatted attribute

Overrides

X2Model::renderInput()
public
# getReminders( mixed $refresh = false )
public
# setNotificationUsers( mixed $notificationUsers )
public
# getNotificationUsers( )
public
# setNotificationTime( mixed $notificationTime )
public
# getNotificationTime( )
public array
# getStaticLinkedModels( )

Overrides parent method to add models which can be linked through the association[id|type] fields.

Overrides parent method to add models which can be linked through the association[id|type] fields.

Returns

array
static linked models indexed by link field name

Overrides

X2Model::getStaticLinkedModels()
Methods inherited from X2Model
__construct(), afterUpdate(), attributeChanged(), attributeLabels(), checkThrowAttrError(), compareAssignment(), compareAttribute(), compareBoolean(), compareDropdown(), duplicateFields(), findAll(), findByAttributes(), findByEmail(), findByNameId(), findByPkInArray(), getAllRecordNames(), getAssignmentOptions(), getAssociationModel(), getAssociationType(), getAssociationTypeOptions(), getAttributeLabels(), getDefaultAssignment(), getDefaultFormLayout(), getDisplayName(), getEditableAttributeNames(), getField(), getFieldComparisonOptions(), getFieldPermissions(), getFields(), getFieldsForDropdown(), getInsertableAttributeTokens(), getIsExemptFromFieldLevelPermissions(), getLinkedAttribute(), getLinkedModel(), getLinkedModelMock(), getModelLink(), getModelLinkMock(), getModelName(), getModelNames(), getModelOfTypeWithId(), getModelOfTypeWithName(), getModelTitle(), getModelTypes(), getModelTypesWhichSupportRelationships(), getModelTypesWhichSupportWorkflow(), getModelsFromNames(), getModuleModel(), getModuleModelName(), getModuleModelNames(), getModuleModelsByName(), getModuleName(), getModules(), getMyModelName(), getOldAttributes(), getPhoneNumber(), getReadableAttributeNames(), getRecordName(), getSort(), getSummaryFields(), getTableNames(), getTranslatedModelTitles(), getVisibleAttributes(), hide(), insert(), isModuleModelName(), massUpdateNameId(), model2(), modelRules(), onAfterCreate(), onAfterInsert(), onAfterUpdate(), query(), queryFields(), renderErroneousField(), renderLinkedAttribute(), renderMergeInput(), renderModelAutocomplete(), renderModelInput(), resetFieldsPropertyCache(), runWithoutBehavior(), save(), translatedAttributeLabel(), unshiftOperator(), updateNameId(), updateNameIdRefs(), updateTimerTotals()
Methods inherited from X2ActiveRecord
getAllErrorMessages(), getBehaviorRules(), getFormatter(), getInputRenderer(), setFormatter(), setInputRenderer()
Methods inherited from CActiveRecord
__call(), __get(), __isset(), __set(), __sleep(), __unset(), addRelatedRecord(), afterFindInternal(), applyScopes(), beforeCount(), beforeFind(), beforeFindInternal(), cache(), count(), countByAttributes(), countBySql(), defaultScope(), delete(), deleteAll(), deleteAllByAttributes(), deleteByPk(), equals(), exists(), find(), findAllByAttributes(), findAllByPk(), findAllBySql(), findByPk(), findBySql(), getActiveFinder(), getActiveRelation(), getCommandBuilder(), getDbConnection(), getDbCriteria(), getIsNewRecord(), getMetaData(), getOldPrimaryKey(), getPrimaryKey(), getRelated(), getTableAlias(), getTableSchema(), hasAttribute(), hasRelated(), init(), instantiate(), offsetExists(), onAfterDelete(), onAfterFind(), onAfterSave(), onBeforeCount(), onBeforeDelete(), onBeforeFind(), onBeforeSave(), populateRecord(), populateRecords(), primaryKey(), refresh(), refreshMetaData(), resetScope(), saveAttributes(), saveCounters(), scopes(), setAttribute(), setDbCriteria(), setIsNewRecord(), setOldPrimaryKey(), setPrimaryKey(), setTableAlias(), together(), update(), updateAll(), updateByPk(), updateCounters(), with()
Methods inherited from CModel
addError(), addErrors(), afterConstruct(), afterValidate(), beforeValidate(), clearErrors(), createValidators(), generateAttributeLabel(), getError(), getErrors(), getIterator(), getSafeAttributeNames(), getScenario(), getValidatorList(), getValidators(), hasErrors(), isAttributeRequired(), isAttributeSafe(), offsetGet(), offsetSet(), offsetUnset(), onAfterConstruct(), onAfterValidate(), onBeforeValidate(), onUnsafeAttribute(), setAttributes(), setScenario(), unsetAttributes(), validate()
Methods inherited from CComponent
asa(), attachBehavior(), attachBehaviors(), attachEventHandler(), canGetProperty(), canSetProperty(), detachBehavior(), detachBehaviors(), detachEventHandler(), disableBehavior(), disableBehaviors(), enableBehavior(), enableBehaviors(), evaluateExpression(), getEventHandlers(), hasEvent(), hasEventHandler(), hasProperty(), raiseEvent()
Constants summary
integer ACTION_INDEX_PAGE_SIZE 20
#

If we want this to be user configurable, then the height of the list view items container needs to be set dynamically. Otherwise, infinity scrolling will break.

If we want this to be user configurable, then the height of the list view items container needs to be set dynamically. Otherwise, infinity scrolling will break.

integer COLORS_DROPDOWN_ID 123
#
string ASSOCIATION_TYPE_MULTI '__multiple__'
#

Setting associationType to this implies that the action is associated via the x2_action_to_record table

Setting associationType to this implies that the action is associated via the x2_action_to_record table

Constants inherited from CActiveRecord
BELONGS_TO, HAS_MANY, HAS_ONE, MANY_MANY, STAT
Properties summary
public boolean $skipActionTimers false
#
public true $supportsWorkflow false
#

if this model can have workflows associated with it, false otherwise

if this model can have workflows associated with it, false otherwise

public static type $emailTypes array( 'email', 'emailFrom','emailOpened','email_invoice', 'email_quote')
#

Types of actions that should be treated as emails

Types of actions that should be treated as emails

public mixed $verifyCode
#
public string $actionDescriptionTemp ''
#
Properties inherited from X2Model
$_editableFieldNames, $_fieldPermissions, $_fields, $_linkedModels, $_nameIdRefs, $_oldAttributes, $_runAfterCreate, $associationModels, $autoPopulateFields, $dbPersistentGridSettings, $disablePersistentGridSettings, $fieldFormatterClass, $modelNameToModuleName, $subScenario, $supportsFieldLevelPermissions, $translatedModelTitles, $uid
Properties inherited from X2ActiveRecord
$fieldInputRendererClass
Properties inherited from CActiveRecord
$db
Magic properties inherited from X2Model
$fieldPermissions, $isExemptFromFieldLevelPermissions, $myModelName, $readableAttributeNames, $relatedX2Models
Magic properties inherited from CActiveRecord
$attributes, $commandBuilder, $dbConnection, $dbCriteria, $isNewRecord, $metaData, $oldPrimaryKey, $primaryKey, $tableAlias, $tableSchema
Magic properties inherited from CModel
$errors, $iterator, $safeAttributeNames, $scenario, $validatorList, $validators
X2CRM Documentation API documentation generated by ApiGen 2.8.0