Skip to content
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

CRM-19754 CiviCase role relationships reversed -- Case UI and Send Copy label change #9975

Closed
wants to merge 2 commits into from

Conversation

ltaliano
Copy link

https://issues.civicrm.org/jira/browse/CRM-19754

see Lisa Taliano's comments

Thanks for this fix. There are still a few problems with labels.
In the Case UI, the Roles drop-down, it shows only the labels in the opposite direction.
so for example, one can only pick "Case Manager for". I should be able to pick "Case Manager is".
This causes a problem when Case is initially opened, if role hasen't been assigned, the label is wrong. note: if you actually assign role, it is in the correct direction and the label changes.

Also in Case Activity "Send a copy" the role is correct but the label is wrong. It list the Case Manager, as "Case Manager is" instead of "Case Manager for", even when the direction and label is correct.

To fix Case UI must change the following files

CRM/Case/XMLProcessor.php
line 59 const REL_TYPE_CNAME = 'label_a_b';

civicrm/ang/crmCaseType.js
line 139 return
{id: type[REL_TYPE_CNAME], text: type.label_a_b}

;

To fix "Send a copy" must change:

Case/BAO/Case.php
line 1217 SELECT cc.display_name as name, cc.sort_name as sort_name, cc.id, crt.label_a_b as role, ce.email

in each case you must change the direction from b_a to a_b

@civicrm-builder
Copy link

Can one of the admins verify this patch?

@eileenmcnaughton
Copy link
Contributor

@aydun any chance you can confirm this. The code looks fine, I just need more of an analysis confirmation that it is correct to make this change

@eileenmcnaughton
Copy link
Contributor

@lcdservices @colemanw are either of you able to confirm the change is correct? Code looks fine but I have no idea what should look like what in civicase

@lcdservices
Copy link
Contributor

I was able to reproduce the stated issue and agree the labels were switched. After applying the PR I confirmed the labels were presented correctly for existing case records.

However -- when creating a new case, it errored with "Relationship type Homeless Services Coordinator, found in case configuration file, is not present in the database". This is because the existing case config is using the reverse label. The case config tool role dropdown now displays the correct label -- the problem is that the case has already been configure using the incorrect value.

So I think if we do this we also need to:

  1. fix the sample case config setup that is installed when the case component is enabled
  2. have a fixup script to repair any existing case configurations -- otherwise users will get errors creating cases post-upgrade.

one other observation --
when in the case management page, the add new role > relationship type dropdown displays both label directions -- it probably should only show one (a_b)

@eileenmcnaughton
Copy link
Contributor

This is going to be one year old tomorrow - Happy birthday PR #9975

Sadly I think I have to conclude the work required to get this over the line was a bit too much & close it. I note also it's stale. It's a good change but I don't feel like I could quickly make the extra changes & I note no-one else has done so in a year. The JIRA issue will still track this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants