if (isset($xml->ActivityAsgmtGrps)) {
$definition['activityAsgmtGrps'] = (array) $xml->ActivityAsgmtGrps->Group;
+ // Backwards compat - convert group ids to group names if ids are supplied
+ if (array_filter($definition['activityAsgmtGrps'], ['\CRM_Utils_Rule', 'integer']) === $definition['activityAsgmtGrps']) {
+ foreach ($definition['activityAsgmtGrps'] as $idx => $group) {
+ $definition['activityAsgmtGrps'][$idx] = CRM_Core_DAO::getFieldValue('CRM_Contact_BAO_Group', $group);
+ }
+ }
}
// set activity types
<input
name="activityAsgmtGrps"
crm-ui-id="caseTypeDetailForm.activityAsgmtGrps"
- crm-entityref="{entity: 'Group', api: {params: {is_hidden: 0, is_active: 1}}, select: {allowClear: true, multiple: true, placeholder: ts('Select Group')}}"
+ crm-entityref="{entity: 'Group', api: {id_field: 'name', params: {is_hidden: 0, is_active: 1}}, select: {allowClear: true, multiple: true, placeholder: ts('Select Group')}}"
ng-model="caseType.definition.activityAsgmtGrps"
/>
</div>