From: Divya Jose Date: Fri, 6 Jun 2014 10:17:48 +0000 (+0530) Subject: --fixes X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=83151a3fa4c16c3e44bc7db247f2c9936b1cc857;p=civicrm-core.git --fixes --- diff --git a/CRM/Case/XMLProcessor/Process.php b/CRM/Case/XMLProcessor/Process.php index 744e746c74..c7cf7b78ee 100644 --- a/CRM/Case/XMLProcessor/Process.php +++ b/CRM/Case/XMLProcessor/Process.php @@ -314,23 +314,23 @@ class CRM_Case_XMLProcessor_Process extends CRM_Case_XMLProcessor { */ function getDeclaredActivityTypes($caseTypeXML) { $result = array(); - if (!empty($caseTypeXML)) { - if ($caseTypeXML->ActivityTypes && $caseTypeXML->ActivityTypes->ActivityType) { - foreach ($caseTypeXML->ActivityTypes->ActivityType as $activityTypeXML) { - $result[] = (string) $activityTypeXML->name; - } + + if (!empty($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 (!empty($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; @@ -342,13 +342,13 @@ class CRM_Case_XMLProcessor_Process extends CRM_Case_XMLProcessor { */ function getDeclaredRelationshipTypes($caseTypeXML) { $result = array(); - if (!empty($caseTypeXML)) { - if ($caseTypeXML->CaseRoles && $caseTypeXML->CaseRoles->RelationshipType) { - foreach ($caseTypeXML->CaseRoles->RelationshipType as $relTypeXML) { - $result[] = (string) $relTypeXML->name; - } + + if (!empty($caseTypeXML->CaseRoles) && $caseTypeXML->CaseRoles->RelationshipType) { + foreach ($caseTypeXML->CaseRoles->RelationshipType as $relTypeXML) { + $result[] = (string) $relTypeXML->name; } } + $result = array_unique($result); sort($result); return $result;