CRM-17116 fix advanced search to support custom dates
[civicrm-core.git] / templates / CRM / Custom / Form / Search.tpl
CommitLineData
6a488035
TO
1{*
2 +--------------------------------------------------------------------+
2c4c49ca 3 | CiviCRM version 4.7 |
6a488035 4 +--------------------------------------------------------------------+
e7112fa7 5 | Copyright CiviCRM LLC (c) 2004-2015 |
6a488035
TO
6 +--------------------------------------------------------------------+
7 | This file is a part of CiviCRM. |
8 | |
9 | CiviCRM is free software; you can copy, modify, and distribute it |
10 | under the terms of the GNU Affero General Public License |
11 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
12 | |
13 | CiviCRM is distributed in the hope that it will be useful, but |
14 | WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
16 | See the GNU Affero General Public License for more details. |
17 | |
18 | You should have received a copy of the GNU Affero General Public |
19 | License and the CiviCRM Licensing Exception along |
20 | with this program; if not, contact CiviCRM LLC |
21 | at info[AT]civicrm[DOT]org. If you have questions about the |
22 | GNU Affero General Public License or the licensing of CiviCRM, |
23 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
24 +--------------------------------------------------------------------+
25*}
26{if $groupTree}
27{foreach from=$groupTree item=cd_edit key=group_id}
28
29 <div class="crm-accordion-wrapper crm-contactDetails-accordion {if $form.formName eq 'Advanced' AND $cd_edit.collapse_adv_display eq 1}collapsed{/if}" id="{$cd_edit.name}" >
30 <div class="crm-accordion-header">
31 {$cd_edit.title}
32 </div>
33 <div class="crm-accordion-body">
34 <table class="form-layout-compressed">
35 {foreach from=$cd_edit.fields item=element key=field_id}
6a488035
TO
36 {assign var="type" value=`$element.html_type`}
37 {assign var="element_name" value='custom_'|cat:$field_id}
3130209f 38 {assign var="operator_name" value='custom_'|cat:$field_id|cat:'_operator'}
6a488035
TO
39 {if $element.is_search_range}
40 {assign var="element_name_from" value=$element_name|cat:"_from"}
41 {assign var="element_name_to" value=$element_name|cat:"_to"}
42 <tr>
43 {if $element.data_type neq 'Date'}
44 <td class="label">{$form.$element_name_from.label}</td><td>
45 {$form.$element_name_from.html|crmAddClass:six}
46 &nbsp;&nbsp;{$form.$element_name_to.label}&nbsp;&nbsp;{$form.$element_name_to.html|crmAddClass:six}
47 {elseif $element.skip_calendar NEQ true }
bb05da0c 48 <td class="label"><label for='{$element_name}'>{$element.label}</label>
49 {include file="CRM/Core/DateRange.tpl" fieldName=$element_name from='_from' to='_to'}</td><td>
6a488035
TO
50 {/if}
51 {else}
52 <td class="label">{$form.$element_name.label}</td><td>
53 {if $element.data_type neq 'Date'}
54 {$form.$element_name.html}
55 {elseif $element.skip_calendar NEQ true }
56 {include file="CRM/common/jcalendar.tpl" elementName=$element_name}
57 {/if}
3130209f 58 {if !empty($form.$operator_name)}
9091c2a1
CW
59 <span class="crm-multivalue-search-op" for="{$element_name}">{$form.$operator_name.html}</span>
60 {assign var="add_multivalue_js" value=true}
3130209f 61 {/if}
6a488035 62 {/if}
4a143c04 63 {if $element.html_type eq 'Autocomplete-Select'}
6a488035
TO
64 {if $element.data_type eq 'ContactReference'}
65 {include file="CRM/Custom/Form/ContactReference.tpl"}
6a488035
TO
66 {/if}
67 {/if}
68 </td>
69 </tr>
6a488035
TO
70 {/foreach}
71 </table>
72 </div><!-- /.crm-accordion-body -->
73 </div><!-- /.crm-accordion-wrapper -->
74
75{/foreach}
9091c2a1
CW
76 {if !empty($add_multivalue_js)}
77 {include file="CRM/Custom/Form/MultiValueSearch.js.tpl"}
78 {/if}
6a488035
TO
79{/if}
80