Commit c43665cc authored by eileen's avatar eileen

Convert filter field to datepicker

parent e04e6d91
......@@ -2429,7 +2429,7 @@ INNER JOIN civicrm_option_group grp ON (grp.id = option_group_id AND grp.name =
$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);
......
......@@ -42,12 +42,7 @@ class CRM_Activity_Form_ActivityFilter extends CRM_Core_Form {
$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 -'))
);
......
......@@ -90,7 +90,7 @@
<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>
......
......@@ -29,6 +29,7 @@
{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">
......@@ -37,12 +38,15 @@
<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%;">
......
......@@ -25,6 +25,8 @@
*}
{*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 />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment