From 83151a3fa4c16c3e44bc7db247f2c9936b1cc857 Mon Sep 17 00:00:00 2001 From: Divya Jose Date: Fri, 6 Jun 2014 15:47:48 +0530 Subject: [PATCH] --fixes --- CRM/Case/XMLProcessor/Process.php | 32 +++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) 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; -- 2.25.1