class CRM_Case_XMLProcessor_Process extends CRM_Case_XMLProcessor

Properties

static array|null $activityTypes FIXME: This does NOT belong in a static property, but we're too late in the 4.5-cycle to do the necessary cleanup. from CRM_Case_XMLProcessor
protected $defaultAssigneeOptionsValues

Methods

retrieve($caseType)

No description

static string
mungeCaseType(string $caseType) deprecated

This function was previously used to convert a case-type's machine-name to a file-name. However, it's mind-boggling that the file-name might be a munged version of the machine-name (which is itself a munged version of the display-name), and naming is now a more visible issue (since the overhaul of CaseType admin UI).

array
allActivityTypes(bool $indexName = TRUE, bool $all = FALSE)

No description

array
allRelationshipTypes(bool $fromXML = FALSE)

Get all relationship type display labels (not machine names)

static 
flushStaticCaches()

FIXME: This should not exist

bool
run(string $caseType, array $params)

Run.

array|bool|mixed
get($caseType, $fieldSet, bool $isLabel = FALSE, bool $maskAction = FALSE)

No description

process($xml, array $params)

No description

processStandardTimeline($activitySetXML, array $params)

No description

processActivitySet($activitySetXML, array $params)

No description

array|mixed
caseRoles($caseRolesXML, bool $isCaseManager = FALSE)

No description

bool
createRelationships(SimpleXMLElement $relationshipTypeXML, array $params)

No description

bool
createRelationship(array $params)

No description

array
activityTypes($activityTypesXML, bool $maxInst = FALSE, bool $isLabel = FALSE, bool $maskAction = FALSE)

No description

array
getDeclaredActivityTypes(SimpleXMLElement $caseTypeXML)

No description

array
getDeclaredRelationshipTypes(SimpleXMLElement $caseTypeXML)

Relationships are straight from XML, described from perspective of non-client

deleteEmptyActivity(array $params)

No description

bool
isActivityPresent(array $params)

No description

bool
createActivity($activityTypeXML, array $params)

No description

int|null
getDefaultAssigneeForActivity(array $activityParams, object $activityTypeXML)

Return the default assignee contact for the activity.

array
getDefaultAssigneeOptionValues()

Fetches and caches the activity's default assignee options.

int|null
getDefaultAssigneeByRelationship(array $activityParams, object $activityTypeXML)

Returns the default assignee for the activity by searching for the target's contact relationship type defined in the activity's details.

bool
isBidirectionalRelationshipType($relationshipTypeId)

Determines if the given relationship type is bidirectional or not by comparing their labels.

int|null
getDefaultAssigneeBySpecificContact(object $activityTypeXML)

Returns the activity's default assignee for a specific contact if the contact exists, otherwise returns null.

static array
activitySets($activitySetsXML)

No description

array|bool|mixed
getMaxInstance($caseType, null $activityTypeName = NULL)

No description

array|mixed
getCaseManagerRoleId($caseType)

No description

CaseChangeListener>
getListeners(string $caseType)

No description

int
getRedactActivityEmail()

No description

string
getAllowMultipleCaseClients()

Retrieves AllowMultipleCaseClients setting.

string
getNaturalActivityTypeSort()

Retrieves NaturalActivityTypeSort setting.

array[bool|string,string]
locateNameOrLabel(SimpleXMLElement $xml)

At some point name and label got mixed up for case roles.

Details

in CRM_Case_XMLProcessor at line 50
FALSE|SimpleXMLElement retrieve($caseType)

Parameters

$caseType

Return Value

FALSE|SimpleXMLElement

in CRM_Case_XMLProcessor at line 73
static string mungeCaseType(string $caseType) deprecated

deprecated

This function was previously used to convert a case-type's machine-name to a file-name. However, it's mind-boggling that the file-name might be a munged version of the machine-name (which is itself a munged version of the display-name), and naming is now a more visible issue (since the overhaul of CaseType admin UI).

Usage note: This is called externally by civix stubs as a sort of side-ways validation of the case-type's name (validation which was needed because of the unintuitive double-munge). We should update civix templates and then remove this function in Civi 4.6 or 5.0.

Parameters

string $caseType

Return Value

string

See also

CRM_Case_BAO_CaseType::isValidName

in CRM_Case_XMLProcessor at line 86
array allActivityTypes(bool $indexName = TRUE, bool $all = FALSE)

Parameters

bool $indexName
bool $all

Return Value

array

in CRM_Case_XMLProcessor at line 105
array allRelationshipTypes(bool $fromXML = FALSE)

Get all relationship type display labels (not machine names)

Parameters

bool $fromXML TODO: This parameter is always FALSE now so no longer needed. Is this to be used for lookup of values from XML? Relationships are recorded in XML from the perspective of the non-client while relationships in the UI and everywhere else are from the perspective of the client. Since the XML can't be expected to be switched, the direction needs to be translated.

Return Value

array

in CRM_Case_XMLProcessor at line 137
static flushStaticCaches()

FIXME: This should not exist

at line 45
bool run(string $caseType, array $params)

Run.

Parameters

string $caseType
array $params

Return Value

bool

Exceptions

Exception

at line 71
array|bool|mixed get($caseType, $fieldSet, bool $isLabel = FALSE, bool $maskAction = FALSE)

Parameters

$caseType
$fieldSet
bool $isLabel
bool $maskAction

Return Value

array|bool|mixed

Exceptions

Exception

at line 99
process($xml, array $params)

Parameters

$xml
array $params

Exceptions

Exception

at line 150
processStandardTimeline($activitySetXML, array $params)

Parameters

$activitySetXML
array $params

at line 169
processActivitySet($activitySetXML, array $params)

Parameters

$activitySetXML
array $params

at line 183
array|mixed caseRoles($caseRolesXML, bool $isCaseManager = FALSE)

Parameters

$caseRolesXML
bool $isCaseManager

Return Value

array|mixed

at line 215
bool createRelationships(SimpleXMLElement $relationshipTypeXML, array $params)

Parameters

SimpleXMLElement $relationshipTypeXML
array $params

Return Value

bool

Exceptions

Exception

at line 263
bool createRelationship(array $params)

Parameters

array $params

Return Value

bool

at line 281
array activityTypes($activityTypesXML, bool $maxInst = FALSE, bool $isLabel = FALSE, bool $maskAction = FALSE)

Parameters

$activityTypesXML
bool $maxInst
bool $isLabel
bool $maskAction

Return Value

array

at line 327
array getDeclaredActivityTypes(SimpleXMLElement $caseTypeXML)

Parameters

SimpleXMLElement $caseTypeXML

Return Value

array symbolic activity-type names

at line 358
array getDeclaredRelationshipTypes(SimpleXMLElement $caseTypeXML)

Relationships are straight from XML, described from perspective of non-client

Parameters

SimpleXMLElement $caseTypeXML

Return Value

array symbolic relationship-type names

at line 376
deleteEmptyActivity(array $params)

Parameters

array $params

at line 400
bool isActivityPresent(array $params)

Parameters

array $params

Return Value

bool

at line 431
bool createActivity($activityTypeXML, array $params)

Parameters

$activityTypeXML
array $params

Return Value

bool

Exceptions

CRM_Core_Exception
Exception

at line 593
protected int|null getDefaultAssigneeForActivity(array $activityParams, object $activityTypeXML)

Return the default assignee contact for the activity.

Parameters

array $activityParams
object $activityTypeXML

Return Value

int|null the ID of the default assignee contact or null if none.

at line 624
protected array getDefaultAssigneeOptionValues()

Fetches and caches the activity's default assignee options.

Return Value

array

at line 650
protected int|null getDefaultAssigneeByRelationship(array $activityParams, object $activityTypeXML)

Returns the default assignee for the activity by searching for the target's contact relationship type defined in the activity's details.

Parameters

array $activityParams
object $activityTypeXML

Return Value

int|null the ID of the default assignee contact or null if none.

at line 695
protected bool isBidirectionalRelationshipType($relationshipTypeId)

Determines if the given relationship type is bidirectional or not by comparing their labels.

Parameters

$relationshipTypeId

Return Value

bool

at line 718
protected int|null getDefaultAssigneeBySpecificContact(object $activityTypeXML)

Returns the activity's default assignee for a specific contact if the contact exists, otherwise returns null.

Parameters

object $activityTypeXML

Return Value

int|null

at line 739
static array activitySets($activitySetsXML)

Parameters

$activitySetsXML

Return Value

array

at line 759
array|bool|mixed getMaxInstance($caseType, null $activityTypeName = NULL)

Parameters

$caseType
null $activityTypeName

Return Value

array|bool|mixed

Exceptions

Exception

at line 776
array|mixed getCaseManagerRoleId($caseType)

Parameters

$caseType

Return Value

array|mixed

at line 786
CaseChangeListener> getListeners(string $caseType)

Parameters

string $caseType

Return Value

CaseChangeListener>

at line 801
int getRedactActivityEmail()

Return Value

int

at line 811
string getAllowMultipleCaseClients()

Retrieves AllowMultipleCaseClients setting.

Return Value

string 1 if allowed, 0 if not

at line 821
string getNaturalActivityTypeSort()

Retrieves NaturalActivityTypeSort setting.

Return Value

string 1 if natural, 0 if alphabetic

at line 856
array[bool|string,string] locateNameOrLabel(SimpleXMLElement $xml)

At some point name and label got mixed up for case roles.

Check against known machine name values, and then if no match check against labels. This is subject to some edge cases, but we catch those with a system status check. We do this to avoid requiring people to update their xml files which can be stored in external files we can't/don't want to edit.

Parameters

SimpleXMLElement $xml

Return Value

array[bool|string,string]