*/
function getDeclaredActivityTypes($caseTypeXML) {
$result = array();
-
- if ($caseTypeXML->ActivityTypes && $caseTypeXML->ActivityTypes->ActivityType) {
- foreach ($caseTypeXML->ActivityTypes->ActivityType as $activityTypeXML) {
- $result[] = (string) $activityTypeXML->name;
+ if (!empty($caseTypeXML)) {
+ if ($caseTypeXML->ActivityTypes && $caseTypeXML->ActivityTypes->ActivityType) {
+ foreach ($caseTypeXML->ActivityTypes->ActivityType as $activityTypeXML) {
+ $result[] = (string) $activityTypeXML->name;
+ }
}
- }
- if ($caseTypeXML->ActivitySets && $caseTypeXML->ActivitySets->ActivitySet) {
- foreach ($caseTypeXML->ActivitySets->ActivitySet as $activitySetXML) {
- if ($activitySetXML->ActivityTypes && $activitySetXML->ActivityTypes->ActivityType) {
- foreach ($activitySetXML->ActivityTypes->ActivityType as $activityTypeXML) {
- $result[] = (string) $activityTypeXML->name;
+ if ($caseTypeXML->ActivitySets && $caseTypeXML->ActivitySets->ActivitySet) {
+ foreach ($caseTypeXML->ActivitySets->ActivitySet as $activitySetXML) {
+ if ($activitySetXML->ActivityTypes && $activitySetXML->ActivityTypes->ActivityType) {
+ foreach ($activitySetXML->ActivityTypes->ActivityType as $activityTypeXML) {
+ $result[] = (string) $activityTypeXML->name;
+ }
}
}
}
}
-
$result = array_unique($result);
sort($result);
return $result;
*/
function getDeclaredRelationshipTypes($caseTypeXML) {
$result = array();
-
- if ($caseTypeXML->CaseRoles && $caseTypeXML->CaseRoles->RelationshipType) {
- foreach ($caseTypeXML->CaseRoles->RelationshipType as $relTypeXML) {
- $result[] = (string) $relTypeXML->name;
+ if (!empty($caseTypeXML)) {
+ if ($caseTypeXML->CaseRoles && $caseTypeXML->CaseRoles->RelationshipType) {
+ foreach ($caseTypeXML->CaseRoles->RelationshipType as $relTypeXML) {
+ $result[] = (string) $relTypeXML->name;
+ }
}
}
-
$result = array_unique($result);
sort($result);
return $result;
* @static
* @access public
*/
- function setUFFieldStatus($customGroupId, $is_active) {
+ static function setUFFieldStatus($customGroupId, $is_active) {
//find the profile id given custom group id
$queryString = "SELECT civicrm_custom_field.id as custom_field_id
FROM civicrm_custom_field, civicrm_custom_group