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 CiviContribute (Moderator: Donald Lobo) »
  • Hide Contributions from Activities list?
Pages: [1]

Author Topic: Hide Contributions from Activities list?  (Read 484 times)

artfulrobot.com

  • I post occasionally
  • **
  • Posts: 81
  • Karma: 4
Hide Contributions from Activities list?
September 04, 2012, 03:36:07 am
Hi

Contributions added through the Contributions Tab on a Contact's record get listed twice, once as a Contribution and once as an Activity.

According to the CiviCRM Book, this is likely because "Contributions are activities" http://en.flossmanuals.net/civicrm/ch010_how-data-is-organised/

But I've heard before (IRC, I think, but have searched logs and can't find it now) that contributions are separate from activities.

Would there be a way to hide contributions from the Activities tab? e.g. a hook? Or would I have to hack core and change the SQL somewhere (don't want to do this!).

Thanks all.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Hide Contributions from Activities list?
September 04, 2012, 04:00:04 pm
The Activities tab is meant to provide a unified view of each constituents interaction history. Hence each time a constituent makes a contribution, attends an event, signs up /renews a membership, get's a bulk email, etc.... an activity record is created and inserted into the "story". Most CiviCRM users (and in general most CRM users) find this a useful feature - since it makes it much easier to understand how "one thing leads to another" (or doesn't).

That said, if this is not compelling to your client / users - the activity records are separate rows in their own table (civicrm_activities) - distinct from the actual contribution records (civicrm_contribution table). Activities inserted on receipt of a contribution have a specific activity type as well ('Contribution'). I think you could use the pageRun hook to suppress activities of this type.
Protect your investment in CiviCRM by  becoming a Member!

artfulrobot.com

  • I post occasionally
  • **
  • Posts: 81
  • Karma: 4
Re: Hide Contributions from Activities list?
September 05, 2012, 08:10:17 am
Thanks for reply. I agree, useful to have a full log of things the person has done, although don't think that's quite how CiviCRM has implemented? e.g. person joins a group would not be recorded/shown in activities. So some things are and some things are not.

I'm not sure how I'd use the $page object (below) provided to hook pageRun() to alter the rows?

CRM_Activity_Page_Tab Object
(
    [_name:protected] => CRM_Activity_Page_Tab
    [_title:protected] => Activities
    [_mode:protected] => null
    [_embedded:protected] =>
    [_print:protected] => 2
    [_id] =>
    [_contactId] => 295
    [_permission] => 1
    [_action] => 16
)


For now I've hacked the BAO object that lists activities by prepending an ORDER BY clause to shift the less interesting activities to the bottom of the list. This is OK, but obviously difficult to maintain. I'd definitely be grateful for any pointers on how to do it in a more sustainable way.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Hide Contributions from Activities list?
September 05, 2012, 10:43:30 am
Sorry for misdirect on pageRun hook. Since the table is retrieved via ajax that's not possible. Lobo and I discussed this - and we think the right approach is to change the activity type filter to a multi-select field, AND add a Display Preference and use that as the default for the filter.

Another community member posted an issue with patches which "partially" addresses this (but in a different way - which we don't think will be as useful / flexible): http://issues.civicrm.org/jira/browse/CRM-10706

If you agree with the approach we've described - it would be awesome if you could pick up that issue and modify / extend the patches for 4.3 to do the needful. (Ping back here if you have other thoughts on how best to address this requirement.)
Protect your investment in CiviCRM by  becoming a Member!

artfulrobot.com

  • I post occasionally
  • **
  • Posts: 81
  • Karma: 4
Re: Hide Contributions from Activities list?
September 05, 2012, 01:29:18 pm
Yeah, that would be good. I did look into that a while back, but decided I could not afford the coding time. Found it difficult to understand quite where that little widget was coded, and then it would have meant completely rewriting it = hard to maintain code.

I'll put it on my wishful do-list; I'd like to contribute in this way, just need someone to pay my bills while I do it :-)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Hide Contributions from Activities list?

This forum was archived on 2017-11-26.