$activityIcons[$type['value']] = $type['icon'];
}
}
- CRM_Utils_Date::convertFormDateToApiFormat($params, 'activity_date_time', FALSE);
+ CRM_Utils_Date::convertFormDateToApiFormat($params, 'activity_date_time');
// Get contact activities.
$activities = CRM_Activity_BAO_Activity::getActivities($params);
$this->add('select', 'activity_type_filter_id', ts('Include'), array('' => ts('- all activity type(s) -')) + $activityOptions);
$this->add('select', 'activity_type_exclude_filter_id', ts('Exclude'), array('' => ts('- select activity type -')) + $activityOptions);
- CRM_Core_Form_Date::buildDateRange(
- $this, 'activity_date_time', 1,
- '_low', '_high', ts('From:'),
- FALSE, array(), 'searchDate',
- FALSE, array('class' => 'crm-select2 medium')
- );
+ $this->addDatePickerRange('activity_date_time', ts('Date'));
$this->addSelect('status_id',
array('entity' => 'activity', 'multiple' => 'multiple', 'option_url' => NULL, 'placeholder' => ts('- any -'))
);
<tr>
<td>
- {include file="CRM/Core/DatePickerRange.tpl" fieldName="activity_date_time" from='_low' to='_high'}
+ {include file="CRM/Core/DatePickerRange.tpl" fieldName="activity_date_time"}
</td>
</tr>
<tr>
{ts}Filter by Activity{/ts}</a>
</div><!-- /.crm-accordion-header -->
<div class="crm-accordion-body">
+ <form><!-- form element is here to fool the datepicker widget -->
<table class="no-border form-layout-compressed activity-search-options">
<tr>
<td class="crm-contact-form-block-activity_type_filter_id crm-inline-edit-field">
<td class="crm-contact-form-block-activity_type_exclude_filter_id crm-inline-edit-field">
{$form.activity_type_exclude_filter_id.label}<br /> {$form.activity_type_exclude_filter_id.html|crmAddClass:medium}
</td>
- {include file="CRM/Core/DateRange.tpl" fieldName="activity_date_time" from='_low' to='_high' label='<label>Date</label>'}
+ <td>
+ {include file="CRM/Core/DatePickerRange.tpl" fieldName="activity_date_time"}
+ </td>
<td class="crm-contact-form-block-activity_status_filter_id crm-inline-edit-field">
<label>{ts}Status{/ts}</label><br /> {$form.status_id.html|crmAddClass:medium}
</td>
</tr>
</table>
+ </form>
</div><!-- /.crm-accordion-body -->
</div><!-- /.crm-accordion-wrapper -->
<table class="contact-activity-selector-{$context} crm-ajax-table" style="width: 100%;">
*}
{*this is included inside a table row*}
{assign var=relativeName value=$fieldName|cat:"_relative"}
+{assign var='from' value=$from|default:'_low'}
+{assign var='to' value=$to|default:'_high'}
{$form.$relativeName.label}<br />
{$form.$relativeName.html}<br />