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) »
  • Controlling options in the "More Actions" list.
Pages: [1]

Author Topic: Controlling options in the "More Actions" list.  (Read 896 times)

dschafer

  • I post occasionally
  • **
  • Posts: 93
  • Karma: 3
    • Backoffice Thinking
  • CiviCRM version: 3.2.3 - 4.4.4
  • CMS version: Drupal 6.x, 7.x, Wordpress
  • MySQL version: 5.1.x - 5.5.x
  • PHP version: 5.2.x - 5.4.x
Controlling options in the "More Actions" list.
March 04, 2010, 01:21:48 pm
This question was posted in a 2 year old thread so I thought a new one might be more appropriate.

In our work we are trying to avoid modifying core civi code as much as possible and using hooks for all modifications.

Using a form_hook we were able to set the options in the list. This would have been a lot easier except for limitations in the PEAR HTML_QuickForm_Select class.

The class contains no method to remove options from the list. After racking my brain for a while I resigned myself to a single line change in the PEAR class. (\sites\all\modules\civicrm\packages\HTML\QuickForm\select.php).

Basically I made the option list ($_option) a public property. Then in the hook I unset the option array and used the loadArrary() method to repopulate the list.

I'm thinking of submitting a more substantive update (a real removeOption method) to PEAR team but didn't know how this would find its way back into the Civi release.

How frequently do you integrate new PEAR releases?
Also it looks like the HTML_QuickForm package is deprecated and HTML_QuickForm2 is only alpha.

What's the best option for getting this into the code base.

Thanks


Kiran Jagtap

  • Ask me questions
  • ****
  • Posts: 533
  • Karma: 51
Re: Controlling options in the "More Actions" list.
March 04, 2010, 09:46:51 pm
this thread might be helpful to modify select options.  http://forum.civicrm.org/index.php/topic,9763.msg42123.html#msg42123

kiran
You Are Designed To Choose... Defined By Choice.

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: Controlling options in the "More Actions" list.
March 04, 2010, 10:19:20 pm
Quote from: dschafer on March 04, 2010, 01:21:48 pm
Basically I made the option list ($_option) a public property. Then in the hook I unset the option array and used the loadArrary() method to repopulate the list.

I'm thinking of submitting a more substantive update (a real removeOption method) to PEAR team but didn't know how this would find its way back into the Civi release.

We are planning to move away from PEAR / QF in CiviCRM v4.0 :). Also i dont think QF is being updated any more :(

Assuming kiran's solution does not work, For now, i'd go with changing $_option to public. File an issue with the patch and we'll add it for 3.1.x

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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Controlling options in the "More Actions" list.

This forum was archived on 2017-11-26.