get action fixes for activitysets, CRM-14725
authorkurund <kurund@civicrm.org>
Tue, 27 May 2014 18:06:53 +0000 (23:36 +0530)
committerkurund <kurund@civicrm.org>
Tue, 27 May 2014 18:06:53 +0000 (23:36 +0530)
----------------------------------------
* CRM-14725: Edit Case Type - Use AJAX load/save
  https://issues.civicrm.org/jira/browse/CRM-14725

CRM/Case/BAO/CaseType.php

index 55cdf5ae85fe1dcc6b30573879ff66bd4f57de45..ea0cc995a226806e93808eb231d67963e6645d95 100644 (file)
@@ -166,9 +166,11 @@ class CRM_Case_BAO_CaseType extends CRM_Case_DAO_CaseType {
 
     // set activity sets
     $activitySets = json_decode(json_encode($xml->ActivitySets), TRUE);
-    $caseType['values'][0]['definition']['activitySets'] = $activitySets['ActivitySet'];
-    $caseType['values'][0]['definition']['activitySets']['activityTypes'] = $activitySets['ActivitySet']['ActivityTypes']['ActivityType'];
-    unset($caseType['values'][0]['definition']['activitySets']['ActivityTypes']);
+    foreach($activitySets as $key => $value) {
+      $caseType['values'][0]['definition']['activitySets'] = array($key => $value);
+      $caseType['values'][0]['definition']['activitySets'][$key]['activityTypes'] = $activitySets['ActivitySet']['ActivityTypes']['ActivityType'];
+      unset($caseType['values'][0]['definition']['activitySets'][$key]['ActivityTypes']);
+    }
 
     // set case roles
     $caseRoles = json_decode(json_encode($xml->CaseRoles), TRUE);