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 Count Search
Pages: [1]

Author Topic: Activity Count Search  (Read 311 times)

JohnFF

  • I post frequently
  • ***
  • Posts: 235
  • Karma: 6
  • CiviCRM version: 4.4.13
  • CMS version: Drupal 7.28
  • MySQL version: 5.5.31-1
  • PHP version: 5.3.27
Activity Count Search
January 19, 2015, 09:20:58 am
Hi guys,

I came across a use case where we need to be able to get contacts who have a certain number of activities in a certain time period.

Naturally, the optimal solution is to upgrade Advanced Search. But equally naturally we came across this need in an "urgent" fashion, and the Advanced Search function is complex to maintain, and I am in no hurry to break it.

I've made a fledgling Activity Count Search as a custom search (and attached it here, in case it's of use to others).

Does anyone know
1) If there are plans to add "count" to the activity section of Advanced Search?
2) How to add "datetime" as an option on the search options screen?
3) Please can you tell me (I've tried unsuccessfully) how I can automatically include a select field for Groups (currently I allow you to enter a group id).
4) Please can you tell me (I've tried unsuccessfully) how I can include a "source, target, assigned to" selector to the options screen?

Thank you gang!
If you like empowering charities in a free and open way, then you're going to love Civi.

Email Amender: https://civicrm.org/extensions/email-amender
UK Phone Validator: https://civicrm.org/extensions/uk-phone-number-validator
http://civifirst.com
https://twitter.com/civifirst

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Activity Count Search
January 19, 2015, 09:48:49 am
If you are still using 4.4 this is slightly tricky because the form code has slightly changed in the meantime.

  • No afaik.
  • See http://wiki.civicrm.org/confluence/display/CRMDOC/QuickForm+Reference#QuickFormReference-ExtendedTypes
  • In 4.5 you can just do $this->addSelect('group_id') and it will do #3 for you automatically. In 4.4 it takes a bit more effort - see the Basic search code for an example.
  • Not exactly sure what you mean. Just a select dropdown with those 3 options?
Try asking your question on the new CiviCRM help site.

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

This forum was archived on 2017-11-26.