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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Groups save and search
Pages: [1]

Author Topic: Groups save and search  (Read 551 times)

jcopperman

  • I’m new here
  • *
  • Posts: 1
  • Karma: 0
  • CiviCRM version: 3.4.0
  • CMS version: Drupal 6
  • MySQL version: 5.1.41
  • PHP version: 3.3.2deb1ubuntu1
Groups save and search
February 29, 2012, 12:20:35 am
Hi

How can I set the group that a contact belongs to automatically based on the group that the user belongs to. Also for a custom search, where the query will only return contacts belonging to the same group as the user. Hope this makes sense. :)

Iv been looking at the group.php for custom searches(CRM/Contact/Form/Search/Custom/group.php) but that is all defined by what group the user has selected. I would think it could be easier to modify that search to default to the user's group.

On the creating/editing of a contact Im not sure how I could default the group to the user.

Any help would be greatly appreciated.

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: Groups save and search
February 29, 2012, 12:31:01 am
Would love to help, but you will have to explain a little more.... ;D
Quote
How can I set the group that a contact belongs to automatically based on the group that the user belongs to. Also for a custom search, where the query will only return contacts belonging to the same group as the user.
What are you trying to achieve?
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

Tony Horrocks

  • I post occasionally
  • **
  • Posts: 110
  • Karma: 7
    • Fabriko Limited
  • CiviCRM version: 4.5.x
  • CMS version: Drupal 7
Re: Groups save and search
March 04, 2012, 11:03:10 am
DO you mean organic groups? What CMS are you using?
Tony Horrocks
Author of the CiviCRM CookBook https://www.packtpub.com/web-development/civicrm-cookbook

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Groups save and search

This forum was archived on 2017-11-26.