CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviCase (Moderator: Dave Greenberg) »
  • [Solved] Case Role Disfunction
Pages: [1]

Author Topic: [Solved] Case Role Disfunction  (Read 2442 times)

FatherShawn

  • Ask me questions
  • ****
  • Posts: 372
  • Karma: 25
    • C3 Design
  • CiviCRM version: 4.2.11
  • CMS version: Drupal 7.23
  • MySQL version: 5.5.32
  • PHP version: 5.3.10
[Solved] Case Role Disfunction
April 08, 2010, 06:34:56 pm
I'm starting to work my way through understanding how to define and use CiviCase.  I'm having a problem with the Case Roles function.  That section of the xml file reads:
Code: [Select]
 <CaseRoles>
    <RelationshipType>
        <name>shepherd</name>
        <manager>1</manager>
    </RelationshipType>
    <RelationshipType>
        <name>phone_interview</name>
    </RelationshipType>
    <RelationshipType>
        <name>visit</name>
    </RelationshipType>
    <RelationshipType>
        <name>interview_host</name>  
    </RelationshipType>  
 </CaseRoles>

There are two problems.  One is that when I click "Add new role" in the Case Roles section, the drop down list in the pop-up has 5 relationships on the list - the last 5 in the civicrm_relationship_type table - but I've only used 4 of these in the xml file.  Also, choosing a relationship (role) doesn't cause the role to be assigned/relationship to be created.
« Last Edit: April 09, 2010, 12:53:25 pm by FatherShawn »
Lead Developer, C3 Design.
Twitter: @FatherShawn

demeritcowboy

  • Ask me questions
  • ****
  • Posts: 570
  • Karma: 42
  • CiviCRM version: Always the latest!
  • CMS version: Drupal 6 mostly, still evaluating 7.
  • MySQL version: Mix of 5.0 / 5.1 / 5.5
  • PHP version: 5.3, usually on Windows
Re: Case Role Disfunction
April 08, 2010, 07:57:24 pm
> One is that when I click "Add new role" in the Case Roles section, the drop down list in the pop-up has 5 relationships on the list - the last 5 in the civicrm_relationship_type table - but I've only used 4 of these in the xml file.

That's by design. The ones listed in the xml are prepopulated for that case type, and the add new role is to allow you to add others that aren't in the xml on the fly. To assign the role to a contact, click the icon in the right-hand column of the roles table.

> Also, choosing a relationship (role) doesn't cause the role to be assigned/relationship to be created.

That might be a bug. If it isn't appearing in the roles table after choosing it then it probably is. My first guess would be it's contact-type related. The initial civicase release only supported Individual-Individual and maybe this needs updating.

FatherShawn

  • Ask me questions
  • ****
  • Posts: 372
  • Karma: 25
    • C3 Design
  • CiviCRM version: 4.2.11
  • CMS version: Drupal 7.23
  • MySQL version: 5.5.32
  • PHP version: 5.3.10
Re: Case Role Disfunction
April 09, 2010, 06:08:31 am
Great clues!  I'll load the sample into an empty sandbox to see what's expected.  I don't have anything in my custom case's role table but the client...

Lead Developer, C3 Design.
Twitter: @FatherShawn

FatherShawn

  • Ask me questions
  • ****
  • Posts: 372
  • Karma: 25
    • C3 Design
  • CiviCRM version: 4.2.11
  • CMS version: Drupal 7.23
  • MySQL version: 5.5.32
  • PHP version: 5.3.10
Re: Case Role Disfunction
April 09, 2010, 10:11:00 am
Well, some progress.  I can add a role using the button.  The roles table does not load the defined roles on a new case, though.  I notice a couple of things.  First, the configuration documentation says that the value in xml defined by <name> should be the name_a_b but I notice the the Adult Day Care sample xml that name_b_a is used.  I've gone into the database and set both of these fields to the same value for the CiviCase roles  - didn't help.  I've checked that all the names match the db as well.

Any tips?
Lead Developer, C3 Design.
Twitter: @FatherShawn

demeritcowboy

  • Ask me questions
  • ****
  • Posts: 570
  • Karma: 42
  • CiviCRM version: Always the latest!
  • CMS version: Drupal 6 mostly, still evaluating 7.
  • MySQL version: Mix of 5.0 / 5.1 / 5.5
  • PHP version: 5.3, usually on Windows
Re: Case Role Disfunction
April 09, 2010, 10:55:03 am
Maybe related to this http://issues.civicrm.org/jira/browse/CRM-6065 ? What version are you using?

FatherShawn

  • Ask me questions
  • ****
  • Posts: 372
  • Karma: 25
    • C3 Design
  • CiviCRM version: 4.2.11
  • CMS version: Drupal 7.23
  • MySQL version: 5.5.32
  • PHP version: 5.3.10
Re: Case Role Disfunction
April 09, 2010, 11:22:49 am
Using version 3.1.3.  I am using contact sub-types.  Changing the relationships to just "individual" types enabled "add role" button.  I can repeat the issue you referenced with the sample case on my sandbox though...
« Last Edit: April 09, 2010, 12:29:23 pm by FatherShawn »
Lead Developer, C3 Design.
Twitter: @FatherShawn

demeritcowboy

  • Ask me questions
  • ****
  • Posts: 570
  • Karma: 42
  • CiviCRM version: Always the latest!
  • CMS version: Drupal 6 mostly, still evaluating 7.
  • MySQL version: Mix of 5.0 / 5.1 / 5.5
  • PHP version: 5.3, usually on Windows
Re: Case Role Disfunction
April 09, 2010, 12:10:44 pm
I checked our 3.1 site. We have the name_b_a value in our xml and it's all working. We aren't using contact sub-types.

There is a page reload when you add new role that sometimes takes a few seconds. Doubt that's your problem but I'm out of ideas.

FatherShawn

  • Ask me questions
  • ****
  • Posts: 372
  • Karma: 25
    • C3 Design
  • CiviCRM version: 4.2.11
  • CMS version: Drupal 7.23
  • MySQL version: 5.5.32
  • PHP version: 5.3.10
Re: Case Role Disfunction
April 09, 2010, 12:30:09 pm
Thanks for the help - I'll start digging into the code while we see if anyone else has ideas...
Lead Developer, C3 Design.
Twitter: @FatherShawn

FatherShawn

  • Ask me questions
  • ****
  • Posts: 372
  • Karma: 25
    • C3 Design
  • CiviCRM version: 4.2.11
  • CMS version: Drupal 7.23
  • MySQL version: 5.5.32
  • PHP version: 5.3.10
Re: [Solved] Case Role Disfunction
April 09, 2010, 12:54:25 pm
The xml name needs to match label_b_a, not name_a_b or name_b_a.  Table now appears properly.
Lead Developer, C3 Design.
Twitter: @FatherShawn

demeritcowboy

  • Ask me questions
  • ****
  • Posts: 570
  • Karma: 42
  • CiviCRM version: Always the latest!
  • CMS version: Drupal 6 mostly, still evaluating 7.
  • MySQL version: Mix of 5.0 / 5.1 / 5.5
  • PHP version: 5.3, usually on Windows
Re: [Solved] Case Role Disfunction
April 09, 2010, 03:38:45 pm
Good catch. Sounds like a bug. My guess is it was introduced when the label column was added which I think happened in 3.1 or maybe 3.0, and a name reference that should have stayed name got changed to label.

Did you find where in the code this is? I'll file in jira.

FatherShawn

  • Ask me questions
  • ****
  • Posts: 372
  • Karma: 25
    • C3 Design
  • CiviCRM version: 4.2.11
  • CMS version: Drupal 7.23
  • MySQL version: 5.5.32
  • PHP version: 5.3.10
Re: [Solved] Case Role Disfunction
April 09, 2010, 06:02:39 pm
It's all through the logic in CRM > Case.  I don't think it's a bug.  I think it was the documentation not keeping up with the code.  I just changed the documentation instead.
Lead Developer, C3 Design.
Twitter: @FatherShawn

demeritcowboy

  • Ask me questions
  • ****
  • Posts: 570
  • Karma: 42
  • CiviCRM version: Always the latest!
  • CMS version: Drupal 6 mostly, still evaluating 7.
  • MySQL version: Mix of 5.0 / 5.1 / 5.5
  • PHP version: 5.3, usually on Windows
Re: [Solved] Case Role Disfunction
April 09, 2010, 10:34:52 pm
Thanks but typically that's not the intended behavior throughout civicrm.  "name" is like the key field that does not change, and is therefore used for lookups, whereas "label" is what end users see and can change as desired as thus is not a good candidate for lookups.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviCase (Moderator: Dave Greenberg) »
  • [Solved] Case Role Disfunction

This forum was archived on 2017-11-26.