-
-
Notifications
You must be signed in to change notification settings - Fork 814
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP dev/core#542 - case manager not displayed for closed cases #13144
Conversation
(Standard links)
|
ping @ray-wright |
@jitendrapurohit This does work - roles now show up in the roles section of the manage case screen - thanks again! I failed to include in my original post that this also affects case listings. If you're willing - I'm posting a question on a separate commit that I've tracked it down to. |
So if I understand correctly, when a case gets closed, case relationships are automatically made inactive? That seems odd to me. |
@colemanw I'm not sure if it was truly making them inactive - as there are two criteria in that $activeOnly statement (active and end date in the past). I'm assuming the 'end date in the past' was triggering the $activeOnly parameter to fail and the Case Manager to no longer be 'shown' on the manage case screen. However, I do still have an issue with Case Managers not showing on Case listings when they are inactive - CRM-19890 so if one affects the other or they can both be solved similarly, that would help in referencing closed cases. |
@jitendrapurohit @colemanw So turns out this is somewhat problematic. With this change, if you try and edit a case role (case manager for instance) to a different contact. The manage case screen will then show both - because it doesn't delete the previous role, it merely expires and disables it. (To note: same with the 'delete' action on a case role, doesn't delete it, just expires and disables.) I think a better behavior would be to DELETE the previous role (at least for case manager, since that is also displayed as a single contact in case listings) - then this patch would be effective in showing a *single * roles on closed cases. I understand I now have to hunt down where the functionality is for changing case roles and swap out or add a true delete option - I wanted to point out that this change alone is a little awkward. |
@ray-wright @jitendrapurohit to summarize:
The solution to delete rather than end relationships is not advisable because records will be lost. Another potential solution would be to make this patch conditional on the case being closed. So open cases will continue to behave as they do now; closed cases will show roles that are ended. |
a56aac7
to
fb8c7af
Compare
Thanks @colemanw @ray-wright. This PR acts only on the retrieval part of the process so the 1 & 2 point from the above comment is still working as before. Agree that this change raises a problem for open case as it also gets the inactive relationship while displaying roles on the Manage Case screen. The change is now modified to display all roles for closed cases as per the above suggestion. For us, we only wanted managers to be shown for closed cases. So maybe, if the current implementation doesn't satisfy everyone, we could add more filters to load only managers in the roles tab? |
@colemanw @jitendrapurohit now that I've had more time to poke around I do agree that deleting a previous case role - not when you close a case just when you change a role on a case - isn't ideal (but that was the previous behavior before 4.7). I've actually spent some time on this and have a fuller solution I'd like to present back to the community. The solution I'm proposing would benefit both the manage case screen and case listings and performs logic to show the active case manager or if there isn't one, show the most recently closed case manager. ( I have the code worked out and almost ready to place here.) |
@jitendrapurohit @colemanw If either of you are around on mattermost, I can share screenshots of my proposal for your thoughts. |
Let's close this as #13510 is more recent. |
Overview
Fix case manager to be displayed for closed cases.
Before
Closed Cases do not display case manager in
Manage Case
screen. More Details on the SE post - https://civicrm.stackexchange.com/questions/27215/case-roles-on-closed-casesAfter
Case Manager is displayed on Manage Case Screen.
Technical Details
4.7 included the refactoring of case roles via #6806 which added a query to only load active relationship from getCaseRole function. This was made flexible by adding an extra param
$activeOnly
in #11736. The changes made here uses that variable and load case manager for closed cases.Comments
Gitlab - https://lab.civicrm.org/dev/core/issues/542