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 CiviReport (Moderator: Dave Greenberg) »
  • How do I add custom activity types to a report?
Pages: [1]

Author Topic: How do I add custom activity types to a report?  (Read 1092 times)

theMusician

  • I post occasionally
  • **
  • Posts: 48
  • Karma: 3
  • CiviCRM version: 4.0 and 4.0.1
  • CMS version: Drupal 7.0
  • MySQL version: MySQL 5.x
  • PHP version: 5.2
How do I add custom activity types to a report?
June 01, 2011, 11:47:56 am
Hi Folks,

Civi projects are continuing to progress but I have ran into the same issue in two separate projects. How does one populate the select box of activities in the filter section of a report?

The select box appears to be populated by the following code block.
Code: [Select]
 
array( 'title'        => ts( 'Activity Type' ),
          'operatorType' => CRM_Report_Form::OP_MULTISELECT,
          'options'      => CRM_Core_PseudoConstant::activityType(), ),

Looking at the database I can find no flag that would indicate which activities are added to the above array. This post, http://forum.civicrm.org/index.php/topic,6531.msg28793.html#msg28793 indicates that the filter field in the civicrm_option_value table makes this feat happen but on the current version there appears to be nothing special about it.

This post http://forum.civicrm.org/index.php/topic,6565.msg28936.html#msg28936 offers a clue showing that the activity search shows custom activities but offers no solution but to upgrade.

So, how does one get a custom activity to appear in the report?

Thank you  ;D

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: How do I add custom activity types to a report?
June 02, 2011, 08:12:17 am
This might help: http://wiki.civicrm.org/confluence/display/CRMDOC40/CiviReport+structure+and+customization

Kurund
Found this reply helpful? Support CiviCRM

theMusician

  • I post occasionally
  • **
  • Posts: 48
  • Karma: 3
  • CiviCRM version: 4.0 and 4.0.1
  • CMS version: Drupal 7.0
  • MySQL version: MySQL 5.x
  • PHP version: 5.2
Re: How do I add custom activity types to a report?
June 02, 2011, 08:52:06 am
Thanks for the link Kurund. I followed that documentation to create my custom report from which my problem stems. Adding custom fields populates the columns that I can select for the report, but the activities do not get added to the select box.

Thanks again.

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: How do I add custom activity types to a report?
June 03, 2011, 06:53:00 am
Sorry to state the obvious, but what about this line at the top:
Code: [Select]
    protected $_customGroupExtends

Have you added "activites" to the list?
Try CiviTeacher: the online video tutorial CiviCRM learning library.

theMusician

  • I post occasionally
  • **
  • Posts: 48
  • Karma: 3
  • CiviCRM version: 4.0 and 4.0.1
  • CMS version: Drupal 7.0
  • MySQL version: MySQL 5.x
  • PHP version: 5.2
Re: How do I add custom activity types to a report?
June 03, 2011, 08:22:30 am
Stoob: No reason not to state the obvious. Sometimes that is the key. I am using the $_customGroupExtends with Activity.

Code: [Select]
protected $_customGroupExtends = array( 'Individual', 'Activity'  );
Should I instead be using the word, 'Activities'? I forget who it was on the IRC channel, but they helped me get the customGroupExtends working.

If I print_r($this->_columns); I get a listing of all returned fields. No custom activities though. So, maybe I am just asking for the wrong set of data when I use the word 'Activity'.


CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: How do I add custom activity types to a report?
June 04, 2011, 04:07:36 pm
I don't know, but there is no harm in trying "Activities" to see what happens.
Try CiviTeacher: the online video tutorial CiviCRM learning library.

theMusician

  • I post occasionally
  • **
  • Posts: 48
  • Karma: 3
  • CiviCRM version: 4.0 and 4.0.1
  • CMS version: Drupal 7.0
  • MySQL version: MySQL 5.x
  • PHP version: 5.2
Re: How do I add custom activity types to a report?
June 06, 2011, 09:32:14 am
Activity is the proper key to use. This allows me to filter and select all of the options which are a part of my custom activity named "Leave Hours." However, you cannot filter by the activity "Leave Hours" because it is not populated in the Activity Type select box.

I am sure I will be able to create the reports I need with the activities added as they are now, but it seems improper for custom activities not to be added to the main activity filter.

Thanks Stoob.

theMusician

  • I post occasionally
  • **
  • Posts: 48
  • Karma: 3
  • CiviCRM version: 4.0 and 4.0.1
  • CMS version: Drupal 7.0
  • MySQL version: MySQL 5.x
  • PHP version: 5.2
Re: How do I add custom activity types to a report?
June 27, 2011, 01:01:56 pm
Quote
...but it seems improper for custom activities not to be added to the main activity filter.

This was fixed with the following patch. http://issues.civicrm.org/jira/browse/CRM-8314?page=com.atlassian.jira.ext.fisheye%3Afisheye-issuepanel

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviReport (Moderator: Dave Greenberg) »
  • How do I add custom activity types to a report?

This forum was archived on 2017-11-26.