Make a_b relationships available as case roles
Currently one can only create case roles for CiviCRM Cases that are one direction (one only sees the options label_b_a). See screen shot below that shows the "New Case Type" Ui with the options for "add role" open (they are all label_b_a) as one can see by checking against the Relationship Type table next to it.
We are proposing making it so users can choose from the full list of relationships (label_a_b and label_b_a).
Rationale:
- There could be scenarios where cases should be set up to have case roles in any direction. For example.. an intergenerational case where its children taking care of parents vs a school case where its parents taking care of kids.
- Jira issue CRM-19754 suggests that the options available should be label_a_b. One pr to make this change was accepted pr 9560 a second pr 9975 was closed due to in action and incompleteness. Making the Case Types bidirectional would solve the bugs documented in pr 9975 without a fix up script.
Bugs this change fixes:
- when creating a case type, you can only select B-to-A labels
then after creating a case you see the B-to-A "Parent of" label
after picking the contact, the label becomes the A-to-B "Child of"
- When viewing a case, the Roles drop-down, only shows the labels in the B to A direction, but when one assigns the case role in the B to A direction the label displayed is in the A to B direction.
- When editing a Case Activity in the "Send a copy" the role is correct but the label is wrong.
- Currently, all relationships are showing the B contact, regardless of who the client is yet they all have the B-to-A label, regardless of who the client is for example:
In this example Rebekah is the client, and the case has her as the parent of Kathleen and the child of Carylon. In the send a copy box, she's shown as parent of Carylon and her relationship w/ Kathleen is displayed as her being parent of herself.
- when reassigning a case role that is B-to-A (where the client is on the B side of the relationship), the list of available contacts is the contact type of the B side since households and organizations are frequently on the B side of a relationship, this makes it difficult-to-impossible to manage a case where the client is a household or organization
Places in the Code that would need to be adjusted:
- CRM/Report/Form/Case/Summary.php
- CRM/Report/Form/Case/Detail.php
- CRM/Case/XMLProcessor/Process.php
- CRM/Case/XMLProcessor.php
- CRM/Case/ManagedEntities.php
- CRM/Case/BAO/Query.php
- CRM/Case/BAO/Case.php
- ang/crmCaseType.js