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 Drupal Modules (Moderator: Donald Lobo) »
  • Arguments and Relationships to output users' company and co-workers
Pages: [1]

Author Topic: Arguments and Relationships to output users' company and co-workers  (Read 2787 times)

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
Arguments and Relationships to output users' company and co-workers
September 09, 2009, 10:58:50 pm
Anyone got a quick recipe for getting the final bit of this jigsaw - currently have pages that show list of Companies, and of Contacts, and if you click on the Company you get a view of that single company and its various employees (recipe pasted below)

What I now need to add is the configuration so that if any user clicks on a 'my company' link they go to their 'own' view (as per above) of the Company and the other Employees of that Company - ie the view needs to be conditional on the User.

Seems like I just need one extra bit of logic in here but not getting it.

Quote
This is recipe to provide a View with Search function for Employees and Companies, Views that display the results as a list, and if you click on Company it shows the Company and also lists the Contacts who are Employees of.

Blocks for both Contacts View and Companies View are inserted on separate page to provide Search functions (using 'name contains')

View type = CiviCRM Contacts

Contacts (page display)
- Argument = CiviCRM Contacts: Contact ID
- Filters = CiviCRM Member status (X, Y, Z), CiviCRM Contacts: Contact Type = Individual, CiviCRM Contacts: Display Name (exposed - shows in Block)

Company (page display)
- Argument = CiviCRM Contacts: Contact ID
- Filters = CiviCRM Member status (X, Y, Z), CiviCRM Contacts: Contact Type = Organization, CiviCRM Contacts: Display Name (exposed - shows in Block)

Company Contacts (as an attached view to the above so it appeares on same Page Display but underneath)
- Relationship = CiviCRM Relationships: Contact ID B
- Argument = CiviCRM Contacts: Contact ID
- Filters = CiviCRM Member status (X, Y, Z), CiviCRM Contacts: Contact Type = Individual,
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

RealMark

  • I’m new here
  • *
  • Posts: 17
  • Karma: 1
  • CiviCRM version: 3.4.4
  • CMS version: Drupal 6.22
  • MySQL version: 5.0.91
  • PHP version: 5.2.17
Re: Arguments and Relationships to output users' company and co-workers
September 04, 2010, 04:02:05 pm
Sorry that I cannot help complete your puzzle but I am trying to understand what you did here.

I am trying to show companies and their employees so this looks this would help, but I do not understand how to implement your recipe.  Any help would be appreciated.

Mark

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: Arguments and Relationships to output users' company and co-workers
September 04, 2010, 04:26:27 pm
If you aren't familiar with Drupal Views - then you will need to familiarise yourself with that module first
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

Traveler777

  • I post occasionally
  • **
  • Posts: 43
  • Karma: 0
  • CiviCRM version: 3.3.2
  • CMS version: Drupal 6.2
Re: Arguments and Relationships to output users' company and co-workers
March 15, 2011, 03:26:21 pm
Hi Pete, have you ever found the solution for showing the view depending on user? It seems I am following in your foot steps, but two years behind :-)

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: Arguments and Relationships to output users' company and co-workers
March 15, 2011, 03:39:05 pm
Hi time traveller

Let me have a dig - I shared the View we used on here somewhere - try this - maybe you could share the love and find a good place in wiki to put this for others?
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

Traveler777

  • I post occasionally
  • **
  • Posts: 43
  • Karma: 0
  • CiviCRM version: 3.3.2
  • CMS version: Drupal 6.2
Re: Arguments and Relationships to output users' company and co-workers
March 15, 2011, 04:43:04 pm
Yeah, I think this is a very good idea. We are trying to link the APK with CiviCRM and hopefully get this going this week. We are close to be done with our website relaunch, but there are some details missing. Drupal and CiviCRM is new to us, so there is a learning curve.

Once we have things in place and working I would love to create a wiki with our solution of a member directory (Drupal) using CiviCRM data and views, etc, etc

P.S.  Is the - try this - supposed to be linked?

Cheers

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: Arguments and Relationships to output users' company and co-workers
March 15, 2011, 09:59:05 pm
yes the 'this' was meant to be a link - damn sorry - http://forum.civicrm.org/index.php/topic,14376.0.html
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

ccsfdave

  • I’m new here
  • *
  • Posts: 4
  • Karma: 0
  • CiviCRM version: 3.3.3
  • CMS version: Drupal 6.20
  • MySQL version: 5.0.45
  • PHP version: 5.2.6
Re: Arguments and Relationships to output users' company and co-workers
August 20, 2011, 04:38:47 am
petednz: In your views - as per the recipes above...how do you pass the contact ID into a URL so each CiviCRM contact has its own page.  I tried a few combos eg orgview/%1 but no luck.  If I test an argument in the "Preview with contextual filters" works like a charm.  Now I just need it appearing in a unique URL.

Thanks much -

Dave

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: Arguments and Relationships to output users' company and co-workers
August 20, 2011, 03:14:58 pm
If i understand your question

For individuals
path is members/contactdetails
which returns as members/contactdetails/2212

For companies
members/companydetails
which returns as eg members/companydetails/196

so yes looks like we had some code kicking in here

there were a number of custom modules so would have to do some digging (just spent 10 mins and didn't spot it) and if you needed me to share it it may need some anonymising as this client did not want their name/acronym revealed and i expect it is throughout the code

Let me know if the above is enough for you to go on

actually it may have just been a views handler that was allowing us to push the civicrm ID on to the url. Will have another look in a couple of days if the above doesn't help, which i kind of think it won't
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

ccsfdave

  • I’m new here
  • *
  • Posts: 4
  • Karma: 0
  • CiviCRM version: 3.3.3
  • CMS version: Drupal 6.20
  • MySQL version: 5.0.45
  • PHP version: 5.2.6
Re: Arguments and Relationships to output users' company and co-workers
August 23, 2011, 11:31:27 am
Quote from: petednz on August 20, 2011, 03:14:58 pm
If i understand your question

For individuals
path is members/contactdetails
which returns as members/contactdetails/2212

...snip snip...

actually it may have just been a views handler that was allowing us to push the civicrm ID on to the url. Will have another look in a couple of days if the above doesn't help, which i kind of think it won't

I am thinking that there must be something else at work here, I can't just define a page (URL) in the view with a %1 argument and get either the individual or organization to show like I can with Drupal content.  I assume you used some kind of module to get this to work.  If you could check, I would greatly appreciate it.

ccsfdave

  • I’m new here
  • *
  • Posts: 4
  • Karma: 0
  • CiviCRM version: 3.3.3
  • CMS version: Drupal 6.20
  • MySQL version: 5.0.45
  • PHP version: 5.2.6
Re: Arguments and Relationships to output users' company and co-workers
August 24, 2011, 09:14:10 am
petednz:  I got it to work.  I used the path in the view as: anonview/%

I think in typical arguments with drupal it is %1 but just plain % did it

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: Arguments and Relationships to output users' company and co-workers
August 24, 2011, 11:50:22 am
good work - so this was on 3.3.x? last we saw of this project is was on 3.0 - maybe things have changed - or maybe you found a route we missed.
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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • Arguments and Relationships to output users' company and co-workers

This forum was archived on 2017-11-26.