$result = [];
if (!isset(Civi::$statics[__CLASS__]['reltypes'])) {
- $relationshipInfo = CRM_Core_PseudoConstant::relationshipType('label', TRUE, NULL);
+ $relationshipInfo = CRM_Core_PseudoConstant::relationshipType('name', TRUE, NULL);
foreach ($relationshipInfo as $id => $relTypeDetails) {
- Civi::$statics[__CLASS__]['reltypes']["{$id}_a_b"] = $relTypeDetails['label_a_b'];
- if ($relTypeDetails['label_a_b'] != $relTypeDetails['label_b_a']) {
- Civi::$statics[__CLASS__]['reltypes']["{$id}_b_a"] = $relTypeDetails['label_b_a'];
+ Civi::$statics[__CLASS__]['reltypes']["{$id}_a_b"] = $relTypeDetails['name_a_b'];
+ if ($relTypeDetails['name_a_b'] != $relTypeDetails['name_b_a']) {
+ Civi::$statics[__CLASS__]['reltypes']["{$id}_b_a"] = $relTypeDetails['name_b_a'];
}
}
}
$relTypes = $xmlRepo->getAllDeclaredRelationshipTypes();
foreach ($relTypes as $relType) {
+ // Making assumption that client is the A side of the relationship.
+ // Relationship label coming from XML, meaning from perspective of
+ // non-client.
+
+ // These assumptions only apply if a case type is introduced without the
+ // relationship types already existing.
$managed = [
'module' => 'civicrm',
'name' => "civicase:rel:$relType",
'label_a_b' => "$relType is",
'label_b_a' => $relType,
'description' => $relType,
- 'contact_type_a' => 'Individual',
- 'contact_type_b' => 'Individual',
+ 'contact_type_a' => NULL,
+ 'contact_type_b' => NULL,
'contact_sub_type_a' => NULL,
'contact_sub_type_b' => NULL,
],