CRM-15061 - Standardize custom field options search widget to always be multiselect
[civicrm-core.git] / templates / CRM / Profile / Form / Search.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.5 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2014 |
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 ! empty( $fields )}
27 {if $groupId }
28 <div class="crm-accordion-wrapper crm-group-{$groupId}-accordion {if $rows}collapsed{/if}">
29 <div class="crm-accordion-header crm-master-accordion-header">
30 {ts}Edit Search Criteria{/ts}
31 </div>
32 <div class="crm-accordion-body">
33 {else}
34 <div>
35 {/if}
36
37 <table class="form-layout-compressed" id="profile">
38 {foreach from=$fields item=field key=fieldName}
39 {if $field.skipDisplay}
40 {continue}
41 {/if}
42 {assign var=n value=$field.name}
43 {assign var="operator_name" value=$n|cat:'_operator'}
44 {if $field.is_search_range}
45 {assign var=from value=$field.name|cat:'_from'}
46 {assign var=to value=$field.name|cat:'_to'}
47 {if $field.data_type neq 'Date'}
48 <tr>
49 <td class="label">{$form.$from.label}</td>
50 <td class="description">{$form.$from.html}&nbsp;&nbsp;{$form.$to.label}&nbsp;&nbsp;{$form.$to.html}</td>
51 </tr>
52 {else}
53 <tr>
54 <td class="label">{$form.$from.label}</td>
55 <td class="description">{include file="CRM/common/jcalendar.tpl" elementName=$from}
56 &nbsp;&nbsp;{$form.$to.label}&nbsp;&nbsp;{include file="CRM/common/jcalendar.tpl" elementName=$to}</td>
57 </tr>
58 {/if}
59 {else}
60 <tr>
61 <td class="label">
62 {$form.$n.label}
63 </td>
64 {if $n eq 'addressee' or $n eq 'email_greeting' or $n eq 'postal_greeting'}
65 <td class="description">
66 {include file="CRM/Profile/Form/GreetingType.tpl"}
67 </td>
68 {elseif $n eq 'group'}
69 <td>
70 <table id="selector" class="selector" style="width:auto;">
71 <tr><td>{$form.$n.html}{* quickform add closing </td> </tr>*}
72 </table>
73 </td>
74 {else}
75 <td class="description">
76 {if ( $field.data_type eq 'Date' or
77 ( ( ( $n eq 'birth_date' ) or ( $n eq 'deceased_date' ) ) ) ) }
78 {include file="CRM/common/jcalendar.tpl" elementName=$n}
79 {elseif $n|substr:0:5 eq 'phone'}
80 {assign var="phone_ext_field" value=$n|replace:'phone':'phone_ext'}
81 {$form.$n.html}
82 {if $form.$phone_ext_field.html}
83 &nbsp;{$form.$phone_ext_field.html}
84 {/if}
85 {else}
86 {$form.$n.html}
87 {/if}
88 {if $field.html_type eq 'Autocomplete-Select' and $field.data_type eq 'ContactReference'}
89 {include file="CRM/Custom/Form/ContactReference.tpl" element_name = $n}
90 {/if}
91 {if !empty($form.$operator_name)}
92 {$form.$operator_name.html}
93 {/if}
94 </td>
95 {/if}
96 </tr>
97 {/if}
98 {/foreach}
99
100 {if $proximity_search}
101 <tr><td colspan="2">{include file="CRM/Contact/Form/Task/ProximityCommon.tpl"}</td></tr>
102 {/if}
103
104 <tr><td></td><td>{include file="CRM/common/formButtons.tpl"}</td></tr>
105 </table>
106
107 {if $groupId}
108 </div><!-- /.crm-accordion-body -->
109 </div><!-- /.crm-accordion-wrapper -->
110 {/if}
111
112 {elseif $statusMessage}
113 <div class="messages status no-popup">
114 <div class="icon inform-icon"></div>
115 {$statusMessage}
116 </div>
117 {else} {* empty fields *}
118 <div class="messages status no-popup">
119 <div class="icon inform-icon"></div>
120 {ts}No fields in this Profile have been configured as searchable. Ask the site administrator to check the Profile setup.{/ts}
121 </div>
122 {/if}
123 {literal}
124 <script type="text/javascript">
125 CRM.$(function($) {
126 $('#selector tr:even').addClass('odd-row ');
127 $('#selector tr:odd ').addClass('even-row');
128 });
129 </script>
130 {/literal}