--fixes
authorDivya Jose <divya@divya.(none)>
Fri, 6 Jun 2014 10:17:48 +0000 (15:47 +0530)
committerDivya Jose <divya@divya.(none)>
Fri, 6 Jun 2014 10:18:31 +0000 (15:48 +0530)
CRM/Case/XMLProcessor/Process.php

index 744e746c74d4e0639b799845ed7fa1914fe0164a..c7cf7b78ee2a26481fb83e70dfaa20da40d8a1ac 100644 (file)
@@ -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;