CRM-12012 CiviCase - problem assigning case roles with multiple clients

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.2.1
    • Fix Version/s: 4.3.0
    • Component/s: CiviCase
    • Labels:
      None

      Description

      In 4.3 the 'Add Client to Case' popup dialog (pencil icon displayed when AllowMultipleCaseClients is TRUE in Settings.xml) is not working at all - so I can't test the behavior below. When I click done after selecting another contact the page reloads but the contact is not added as client for the case.

      We should be adding relationships for multiple clients. Please investigate and fix both issues for 4.3.

      — Original Post —
      If a case is set up with multiple clients, and then a case role is assigned, the role is only "attached" to the client who is currently "active" in the Manage case screen.

      Example: find a Housing Support case by searching on contact (client) A. Manage the case and assign role Homeless Services Coordinator.

      Now find the same case by searching on contact (client) B. Manage the case and display Case Roles - the Homeless Services Coordinator is listed as unassigned.

      It works in reverse too: assign a role when the case is accessed via client B, and that role will not appear in the case details for client A.

      It appears as if, when a case role is assigned, the relationship is only created with whoever is the "currently active" client. Presumably what should happen is that relationships should be created between the incumbent of the case role and ALL of the clients in the case.

      The above description relates to what happens when assigning a role in a case that already has multiple clients. There is a similar problem when adding an additional client to a case that has some roles already assigned - none of the pre-existing role assignments are attached to the newly added client.

      (forum post here: http://forum.civicrm.org/index.php/topic,27891.0/topicseen.html)

        Attachments

          Activity

          [CRM-12012] CiviCase - problem assigning case roles with multiple clients
          David Greenberg added a comment -

          Might be related ... I'm seeing this jScript error in my console when CaseView.php loads:

          Timestamp: 3/4/13 3:51:52 PM
          Error: SyntaxError: missing } after property list
          Source File: http://civicrm43/civicrm/contact/view/case?action=view&reset=1&id=1&cid=86&context=case
          Line: 1455, Column: 20
          Source Code:
          title: View Activity",

          David Greenberg added a comment -

          Add Client to Case is working now. However the originally reported problem has not been fixed. When another client is added to an existing case, the existing Case Role assignments need to be cloned for the new contact (e.g. civicrm_relationship rows added with case_id contact_a being the "new" client and contact_b being the existing case role contacts.

          Example:
          1. Enable multi-client (Settings.xml)
          2. Create a Adult Day Care Referral case for Client A

          • Senior Services Coordinator role is assigned automatically (your user's contact X)
            3. Assign Benefits Specialist case role to contact D.
            4. Now add Client B to this case (click pencil icon next to existing client name)

          Current behavior:

          • New case_contact row is created for Client B (this is correct)
          • No relationships are inserted (this is incorrect) and the Case Roles pane when viewing the case via Contact B Manage Case page shows all case roles unassigned (incorrect)

          Expected:
          2 new relationships should created for Client B's contact record for all existing case roles (other than "Client" which is a pseudo role). In this example:

          • Contact B to Contact X (your user's contact) : Senior Services Coordinator
          • Contact B to Conact D : Benefits Specialist
          David Greenberg added a comment -

          The other flow that I'm pretty sure needs to be fixed is when a case role (relationship) is assigned, updated or removed AND the case has > 1 client. Need to insert, update or remove relationships rows for each client.

          Kurund Jalmi added a comment -
          David Greenberg added a comment -

          Tested both flows, looks good.

            People

            • Assignee:
              David Greenberg
              Reporter:
              Mary Morris

              Dates

              • Created:
                Updated:
                Resolved: