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) »
  • Discussion (deprecated) »
  • Alpha and Beta Release Testing »
  • 2.2 Release Testing »
  • Adding a "mass action" on a search result
Pages: [1]

Author Topic: Adding a "mass action" on a search result  (Read 1603 times)

torenware

  • I post frequently
  • ***
  • Posts: 153
  • Karma: 4
Adding a "mass action" on a search result
February 07, 2009, 04:36:21 pm
Is there a clean way in 2.2 to add an operation to the actions popup in search result windows (i.e. the popup that has items like "Remove From Group" and "Delete Contacts")?

Generally speaking, I see there are some very nice new hooks in 2.x generally and 2.2 specifically.  But this is one I've wanted for a while.  I'd be willing to contribute a patch if there's interest.

torenware

  • I post frequently
  • ***
  • Posts: 153
  • Karma: 4
Re: Adding a "mass action" on a search result
February 07, 2009, 05:08:47 pm
This appears to be an easy hook to add, although not an easy hook to implement.

Creating a hook that added an entry to the tasks table in CRM_Contact_Task that looks like this would be pretty easy:

Code: [Select]
15    => array( 'title'  => ts( 'Print Contacts'                ),
                     'class'  => 'CRM_Contact_Form_Task_Print',
                     'result' => false ),

The subtlety here is making sure the needed class is loaded when the item is chosen in the menu.  But once it was, it would call the custom subclass of CRM_Contact_Form_Task, unless I added a generic task class that delegated the handling of the custom page.

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: Adding a "mass action" on a search result
February 07, 2009, 05:50:54 pm

i dont think its too hard. file an issue and we'll add it for 2.2 :) we'll even try to get it in before the next beta :) Contributing a patch with the issue would be even more awesome

We've basically taken the "easy" route of, class name and file / directory name are related. We derive file name from class name and do an automatic require (which we expect to succeed, else a fatal abort)

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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Alpha and Beta Release Testing »
  • 2.2 Release Testing »
  • Adding a "mass action" on a search result

This forum was archived on 2017-11-26.