foreach ($group['fields'] as $field) {
$fieldId = $field['id'];
$elementName = 'custom_' . $fieldId;
- CRM_Core_BAO_CustomField::addQuickFormElement($form, $elementName, $fieldId, FALSE, TRUE);
+ if ($field['data_type'] == 'Date' && $field['is_search_range']) {
+ CRM_Core_Form_Date::buildDateRange($form, $elementName, 1, '_from', '_to', ts('From:'), FALSE);
+ }
+ else {
+ CRM_Core_BAO_CustomField::addQuickFormElement($form, $elementName, $fieldId, FALSE, TRUE);
+ }
}
}
}
{assign var="element_name_from" value=$element_name|cat:"_from"}
{assign var="element_name_to" value=$element_name|cat:"_to"}
<tr>
+ {if $element.data_type neq 'Date'}
<td class="label">{$form.$element_name_from.label}</td><td>
{$form.$element_name_from.html|crmAddClass:six}
{$form.$element_name_to.label} {$form.$element_name_to.html|crmAddClass:six}
+ {elseif $element.skip_calendar NEQ true }
+ <td class="label"><label for='{$element_name}'>{$element.label}</label>
+ {include file="CRM/Core/DateRange.tpl" fieldName=$element_name from='_from' to='_to'}</td><td>
+ {/if}
{else}
<td class="label">{$form.$element_name.label}</td><td>
{$form.$element_name.html}