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 Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • How to change activity search 'status' defaults
Pages: [1]

Author Topic: How to change activity search 'status' defaults  (Read 5312 times)

clarkac

  • Administrator
  • Ask me questions
  • *****
  • Posts: 399
  • Karma: 11
  • CiviCRM version: 4.4.11 & 4.5.5
  • CMS version: Drupal 7
  • MySQL version: 5.1.61-cll
  • PHP version: 5.3.27
How to change activity search 'status' defaults
May 10, 2013, 11:02:20 am
In activity search the activity status items that are checked by default are are 'scheduled' and 'completed'.   For my client I've added the activity status of 'Reported' which is now checked in activity search, as well as 'scheduled' - but 'completed' is no longer checked.    There seems to be no way to have 'scheduled' unchecked. I can't figure out how these search defaults are set... as I'd like 'completed' to be the only one checked.  Does anyone now how these status search fields are set?
Andy Clark

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: How to change activity search 'status' defaults
May 10, 2013, 05:39:23 pm
Andy - defaults are set where the activity search form is built: CRM/Activity/BAO/Query.php - in 4.3 check line 513:

    $form->setDefaults(array('activity_status[1]' => 1, 'activity_status[2]' => 1));

It's using the index of the checkbox elements which is why it's 'switched'. If you add another item to that array for completed, that should fix it.

That said - you might want to explore using the buildForm hook in a simple extension to do this so you're not hacking on a core file.
Protect your investment in CiviCRM by  becoming a Member!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • How to change activity search 'status' defaults

This forum was archived on 2017-11-26.