- // List of relationship types
- $baoRel = new CRM_Contact_BAO_Relationship();
- $relType = $baoRel->getRelationType('Individual');
- $roleTypes = array();
- foreach ($relType as $k => $v) {
- $roleTypes[substr($k, 0, strpos($k, '_'))] = $v;
- }
- $this->add('select', 'role_type', ts('Relationship Type'), array('' => ts('- select type -')) + $roleTypes, FALSE, array('class' => 'crm-select2 twenty'));
+ // List relationship types for adding an arbitrary new role to the case
+ $this->add('select',
+ 'role_type',
+ ts('Relationship Type'),
+ array('' => ts('- select type -')) + $allowedRelationshipTypes,
+ FALSE,
+ array('class' => 'crm-select2 twenty', 'data-select-params' => '{"allowClear": false}')
+ );