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 »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Possible to skip the search criteria step?
Pages: [1]

Author Topic: Possible to skip the search criteria step?  (Read 573 times)

robinhood

  • I post frequently
  • ***
  • Posts: 153
  • Karma: 6
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.34
  • MySQL version: 5.1.56
  • PHP version: 5.3.5
Possible to skip the search criteria step?
January 22, 2013, 04:48:57 am
I am experimenting with my first extension with a custom search.  In the search examples the user is taken to a form to select a group or other criteria.  For example in Sample.php you have
Code: [Select]
$form->assign('elements', array('household_name', 'state_province_id'));to select household name or state/province.  If I remove these elements of the buildForm function, then I get an empty form with 2 Search buttons - see attached screenshot.  Since my search is entirely contained in the SQL, I don't need this step.  Is there any way to go directly to the search output?

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: Possible to skip the search criteria step?
January 22, 2013, 07:19:04 am

1. So i'm assuming your search code has an implicit "force=1" to do an automatic search when the page is rendered

2. I suspect it an easy patch to hide the search buttons when no elements are present. We never hit the case, and hence did not code for it

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

robinhood

  • I post frequently
  • ***
  • Posts: 153
  • Karma: 6
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.34
  • MySQL version: 5.1.56
  • PHP version: 5.3.5
[Solved] Re: Possible to skip the search criteria step?
January 22, 2013, 05:58:34 pm
Ok, that was easy.  I added "&force=1" to the url in the menu link and that did it.  Good to know, thanks for the tip.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Possible to skip the search criteria step?

This forum was archived on 2017-11-26.