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) »
  • custom search with relative date ranges
Pages: [1]

Author Topic: custom search with relative date ranges  (Read 4979 times)

civi5

  • I post occasionally
  • **
  • Posts: 39
  • Karma: 3
  • CiviCRM version: 4.1
  • CMS version: Drupal 7
  • MySQL version: MySQL 5
  • PHP version: 5.3.6
custom search with relative date ranges
June 05, 2013, 11:33:13 am
I am trying to modify a current search to use the new 4.3 relative date ranges.  I modified the search to include

$form->addDateRange()

Previously I was using 2 independent addDate() fields. 

however the addDateRange() field only outputs the <tr> and class html but does not make any input tags.  This is the output I get from the addDateRange function.

<tr class="crm-contact-custom-search-form-row-date_range">
                    <td class="label">test</td>
                                            <td></td>
                                    </tr>


I looked over the function in CRM/Core/Form.php and I see the function and supplied arguments to all the parameters that were defined but nothing made a difference.
Does anyone have a sample custom search that uses the new relative dates?  I am sure its a simple point I am missing but I cant seem to locate it.

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: custom search with relative date ranges
June 05, 2013, 09:58:14 pm
I would recommend reading:

http://wiki.civicrm.org/confluence/display/CRMDOC43/Developer+Resources
http://book.civicrm.org/developer/

Hth
Kurund
Found this reply helpful? Support CiviCRM

civi5

  • I post occasionally
  • **
  • Posts: 39
  • Karma: 3
  • CiviCRM version: 4.1
  • CMS version: Drupal 7
  • MySQL version: MySQL 5
  • PHP version: 5.3.6
Re: custom search with relative date ranges
June 06, 2013, 07:54:17 am
Thanks for the leads.  I have read these links but I am stuck on the specific of setting up the form with regard to the addDateRange. I have looked in the PHP files to get the function call and I have tried it a few different ways but everytime I just get an empty HTML table row returned.  I was wondering if anyone had any examples specifically with addDateRange that I could look at.  I will just continue to dig into the files and see what I can find out. 

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • custom search with relative date ranges

This forum was archived on 2017-11-26.