Merge remote-tracking branch 'upstream/4.3' into 4.3-master-2013-08-21-20-13-45
[civicrm-core.git] / templates / CRM / Custom / Form / Search.tpl
CommitLineData
6a488035
TO
1{*
2 +--------------------------------------------------------------------+
232624b1 3 | CiviCRM version 4.4 |
6a488035
TO
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2013 |
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}
36 {assign var="element_name" value='custom_'|cat:$field_id}
37 {if $element.options_per_line != 0}
38 <tr>
39 <td class="label">{$form.$element_name.label}</td>
40 <td>
41 {assign var="count" value="1"}
42 {strip}
43 <table class="form-layout-compressed">
44 <tr>
45 {* sort by fails for option per line. Added a variable to iterate through the element array*}
46 {assign var="index" value="1"}
47 {foreach name=outer key=key item=item from=$form.$element_name}
48 {if $index < 10} {* Hack to skip QF field properties that are not checkbox elements. *}
49 {assign var="index" value=`$index+1`}
50 {else}
51 {if $element.html_type EQ 'CheckBox' AND $smarty.foreach.outer.last EQ 1} {* Put 'match ANY / match ALL' checkbox in separate row. *}
52 </tr>
53 <tr>
54 <td class="op-checkbox" colspan="{$element.options_per_line}" style="padding-top: 0px;">{$form.$element_name.$key.html}</td>
55 {else}
56 <td class="labels font-light">{$form.$element_name.$key.html}</td>
57 {if $count EQ $element.options_per_line}
58 </tr>
59 <tr>
60 {assign var="count" value="1"}
61 {else}
62 {assign var="count" value=`$count+1`}
63 {/if}
64 {/if}
65 {/if}
66 {/foreach}
67 </tr>
68 {if $element.html_type eq 'Radio'}
69 <tr style="line-height: .75em; margin-top: 1px;">
70 <td> <span class="crm-clear-link">(<a href="#" title="{ts}unselect{/ts}" onclick="unselectRadio('{$element_name}', '{$form.formName}'); return false;">{ts}clear{/ts}</a>)</span></td>
71 </tr>
72 {/if}
73 </table>
74 {/strip}
75 </td>
76 </tr>
77 {else}
78 {assign var="type" value=`$element.html_type`}
79 {assign var="element_name" value='custom_'|cat:$field_id}
80 {if $element.is_search_range}
81 {assign var="element_name_from" value=$element_name|cat:"_from"}
82 {assign var="element_name_to" value=$element_name|cat:"_to"}
83 <tr>
84 {if $element.data_type neq 'Date'}
85 <td class="label">{$form.$element_name_from.label}</td><td>
86 {$form.$element_name_from.html|crmAddClass:six}
87 &nbsp;&nbsp;{$form.$element_name_to.label}&nbsp;&nbsp;{$form.$element_name_to.html|crmAddClass:six}
88 {elseif $element.skip_calendar NEQ true }
89 <td class="label">{$form.$element_name_from.label}</td><td>
90 {include file="CRM/common/jcalendar.tpl" elementName=$element_name_from}
91 &nbsp;&nbsp;{$form.$element_name_to.label}&nbsp;&nbsp;
92 {include file="CRM/common/jcalendar.tpl" elementName=$element_name_to}
93 {/if}
94 {else}
95 <td class="label">{$form.$element_name.label}</td><td>
96 {if $element.data_type neq 'Date'}
97 {$form.$element_name.html}
98 {elseif $element.skip_calendar NEQ true }
99 {include file="CRM/common/jcalendar.tpl" elementName=$element_name}
100 {/if}
101 {/if}
102 {if $element.html_type eq 'Radio'}
103 &nbsp; <span class="crm-clear-link">(<a href="#" title="{ts}unselect{/ts}" onclick="unselectRadio('{$element_name}', '{$form.formName}'); return false;">{ts}clear{/ts}</a>)</span>
104 {elseif $element.html_type eq 'Autocomplete-Select'}
105 {if $element.data_type eq 'ContactReference'}
106 {include file="CRM/Custom/Form/ContactReference.tpl"}
107 {else}
108 {include file="CRM/Custom/Form/AutoComplete.tpl"}
109 {/if}
110 {/if}
111 </td>
112 </tr>
113 {/if}
114 {/foreach}
115 </table>
116 </div><!-- /.crm-accordion-body -->
117 </div><!-- /.crm-accordion-wrapper -->
118
119{/foreach}
120{/if}
121