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) »
  • Activity Source ID
Pages: [1]

Author Topic: Activity Source ID  (Read 1071 times)

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Activity Source ID
September 07, 2011, 04:55:21 am
I have been playing with the idea of an activity having another activity as it's 'activity_source_id'.

In this case one activity is that someone has been added to a list of people to call & the second is that they were called. The intent would be to be able to report on the first activity's outcome including data from the second.

This seems useful in theory but I note that on the activity dashboard as soon as I do this the 'with' & 'assigned' are supressed on the contact dashboard for the child activity.

It would seem that the use of source_contact_id is potentially quite generic but the choice to suppress is not necessarily the same for all types of source relationships.

I may just use a custom field since I don't want to do anything complex here but it seems like it could have been a useful approach (& have resulted in a re-usable report as opposed to the one I'll have to write based on a custom field)
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

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: Activity Source ID
September 07, 2011, 05:20:57 am
I think you would use source_record_id, not source_contact_id. it looks like that is used to do things like connect a contrib activity to the originating contrib record. but the activity table doesn't have an entity_table column, as with similar implementations. it must infer the type of related record for source_record_id from the activity type.

Though and entity_table seems more transparent, maybe you can still retain the inference, since you would only use the parent/child model for contact activity types.

you would just need a UI to link the new activity with the existing, and then rework the query so that the child activities are grouped with the parent and have a visual cue (indentation).

just brainstorming with you, as it seems like a useful function
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Activity Source ID
September 07, 2011, 02:40:25 pm
Sorry, yes, source_record_id. The activity type option value holds a component id - e.g. survey, contribution, campaign.

I agree the entity_id / entity_table is more flexible.

At the moment the linking we are doing is entirely through PHP so my interest in the first instance is - if I do link them how can I leverage that link and custom reports and / or a custom tab on the contact that shows the activities in a tree link manner are the most likely uses.

However, I think I would need to find a way to get the extra contact id fields showing on the tab summary first - I'll have to figure out how they are suppressed & whether there is a sensible opt out. I think if I have to maintain that part as a customisation this will not be the right path.

To be honest I expect this to be something that we extend over time rather than a lot up front.
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

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: Activity Source ID
September 07, 2011, 02:43:52 pm
i think Lobo said the new search results hook can be used for most of the contact tabs, as they are just filtered searches. maybe you can use that?
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Activity Source ID
September 07, 2011, 03:37:11 pm

coleman went in and checked all the tabs to see which ones get invoked:

http://civicrm.org/blogs/lobo/introducing-hookcivicrmsearchcolumns-modify-search-results-meet-your-needs#comment-6103

the bug has been fixed and the right objectName is now passed in

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Activity Source ID
September 07, 2011, 04:29:44 pm
Opps - my 'problem' was data not Civi..... OK - so I can create the activity relationship in the DB - the question is just whether I can, now or later, expose that in a useful way
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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Activity Source ID

This forum was archived on 2017-11-26.