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 Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Current Employee showing in Relationship Details
Pages: [1]

Author Topic: Current Employee showing in Relationship Details  (Read 1285 times)

pbarmak

  • I post occasionally
  • **
  • Posts: 111
  • Karma: 3
  • CiviCRM version: 3.3.5
  • CMS version: Pressflow 6.19
  • MySQL version: 5.1
  • PHP version: 5.2.10
Current Employee showing in Relationship Details
August 17, 2010, 11:40:07 am
I'm not sure why I'm seeing "Current Employee?" showing up when I click on the relationship details for a particular contact.  It seems that information has nothing to do with the relationship I set up.  What triggers that info to show up?

See this example on the demo: http://drupal.demo.civicrm.org/civicrm/contact/view/rel?action=view&reset=1&selectedChild=rel&cid=119&id=157&rtype=a_b

Thanks.

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Current Employee showing in Relationship Details
August 17, 2010, 12:29:28 pm
That's normal, a current employer has a employee-employer relationship indeed, and it's automatically set up when you save the contact.

It has some cool features: if you go the the employer and see the relationship tab, you get the list of all of your contacts that works for that company. Neat, isn't it ?

Same goes with the household.

-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

pbarmak

  • I post occasionally
  • **
  • Posts: 111
  • Karma: 3
  • CiviCRM version: 3.3.5
  • CMS version: Pressflow 6.19
  • MySQL version: 5.1
  • PHP version: 5.2.10
Re: Current Employee showing in Relationship Details
August 17, 2010, 12:40:10 pm
Quote from: xavier on August 17, 2010, 12:29:28 pm
That's normal, a current employer has a employee-employer relationship indeed, and it's automatically set up when you save the contact.

It has some cool features: if you go the the employer and see the relationship tab, you get the list of all of your contacts that works for that company. Neat, isn't it ?

Same goes with the household.


Yeah, is it neat for that specific type of relationship (I do like it).  However, I'm not looking at an employer/employee relationship here.  I'm looking at other relationship types (like "Senior Services Coordinator is" in the demo example or "Child Sponsor is" in our implementation).  I'm trying to figure out why I see employer info on these relationship types when there is no real reason for that information.

Do you know what triggers that field to show up in the details?  What data in the relationship type causes that field to show up?  I'm guessing I have some flag set in the db which causes this info to show up.

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: Current Employee showing in Relationship Details
August 17, 2010, 11:36:34 pm
Did you take a look at the table civicrm_relationship_type to see if the data there was correct? You might accidently have changed some labels there?
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

pbarmak

  • I post occasionally
  • **
  • Posts: 111
  • Karma: 3
  • CiviCRM version: 3.3.5
  • CMS version: Pressflow 6.19
  • MySQL version: 5.1
  • PHP version: 5.2.10
Re: Current Employee showing in Relationship Details
August 18, 2010, 08:36:22 am
Yes, the table looks good.  I've been playing around with it more, and I'm seeing a pattern.

If an individual contact has the "Current Employer" field set to something (to some organization contact), then *all* the relationship details for that individual show the "Current Employee?" field, even for relationships that have nothing to do with employer/employee.

To me, it seems like a bug on the display side.  It's setting the "isCurrentEmployer" variable to TRUE regardless of the relationship type, and the template is then displaying it because the flag is set.

Can anyone else confirm this is happening on their end?  I don't want to write up a bug report if it's just on my end.

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Current Employee showing in Relationship Details
August 18, 2010, 03:47:33 pm
Best if you can replicate on Demo
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

pbarmak

  • I post occasionally
  • **
  • Posts: 111
  • Karma: 3
  • CiviCRM version: 3.3.5
  • CMS version: Pressflow 6.19
  • MySQL version: 5.1
  • PHP version: 5.2.10
Re: Current Employee showing in Relationship Details
August 18, 2010, 04:26:21 pm
I believe the link in my original post is a good example: try it as-is and you'll see "Current Employee?" in the details.  Then, edit the contact and remove the Current Employer field (make it blank) then go back to the relationship details and you will no longer see that field in the set.  Hope that helps.

For now, I put a quick hack in the relationship template to only show that field if the relationship is "Employee of".

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Current Employee showing in Relationship Details
August 18, 2010, 04:51:24 pm
I agree with pbarmak that this looks like a bug.

pbarmack your patch sounds like it makes sense (I'm not 100% sure what the 'current employee' adds anyway but perhaps it's a common sense check that the employment relationship is still valid.) I certainly don't think it makes sense having it on non-employment relationships as pbarmak posted on the drupal demo site.

Do you want to paste your patch?
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

pbarmak

  • I post occasionally
  • **
  • Posts: 111
  • Karma: 3
  • CiviCRM version: 3.3.5
  • CMS version: Pressflow 6.19
  • MySQL version: 5.1
  • PHP version: 5.2.10
Re: Current Employee showing in Relationship Details
August 18, 2010, 04:58:04 pm
Sure, here is the diff right after the foreach line (sorry, it was a quick fix, may not be the best method):
Code: [Select]
35,37d34
<             {if $row.relation == "Employee of"}
<               {assign var=isEmploy value=1}
<             {/if}
43,45c40
<               {if $isEmploy}
<                   <tr><td class="label">{ts}Current Employee?{/ts}</td><td>{ts}Yes{/ts}</td></tr>
<                 {/if}
---
>                 <tr><td class="label">{ts}Current Employee?{/ts}</td><td>{ts}Yes{/ts}</td></tr>

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Current Employee showing in Relationship Details

This forum was archived on 2017-11-26.