Merge remote-tracking branch 'upstream/4.5' into 4.5-master-2014-11-14-11-21-50
[civicrm-core.git] / templates / CRM / Profile / Form / Search.tpl
CommitLineData
6a488035
TO
1{*
2 +--------------------------------------------------------------------+
819d0d41 3 | CiviCRM version 4.5 |
6a488035 4 +--------------------------------------------------------------------+
819d0d41 5 | Copyright CiviCRM LLC (c) 2004-2014 |
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 ! 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}
3130209f 43 {assign var="operator_name" value=$n|cat:'_operator'}
6a488035
TO
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}
6a488035
TO
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}
3130209f
CW
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)}
9091c2a1
CW
92 <span class="crm-multivalue-search-op" for="{$n}">{$form.$operator_name.html}</span>
93 {assign var="add_multivalue_js" value=true}
6a488035
TO
94 {/if}
95 </td>
96 {/if}
97 </tr>
98 {/if}
99 {/foreach}
100
101 {if $proximity_search}
102 <tr><td colspan="2">{include file="CRM/Contact/Form/Task/ProximityCommon.tpl"}</td></tr>
103 {/if}
104
105 <tr><td></td><td>{include file="CRM/common/formButtons.tpl"}</td></tr>
106 </table>
107
108 {if $groupId}
109 </div><!-- /.crm-accordion-body -->
110 </div><!-- /.crm-accordion-wrapper -->
6a488035
TO
111 {/if}
112
113{elseif $statusMessage}
114 <div class="messages status no-popup">
115 <div class="icon inform-icon"></div>
116 {$statusMessage}
117 </div>
118{else} {* empty fields *}
119 <div class="messages status no-popup">
120 <div class="icon inform-icon"></div>
121 {ts}No fields in this Profile have been configured as searchable. Ask the site administrator to check the Profile setup.{/ts}
122 </div>
123{/if}
124{literal}
125 <script type="text/javascript">
3cc60a06 126 CRM.$(function($) {
ae8f569f
CW
127 $('#selector tr:even').addClass('odd-row ');
128 $('#selector tr:odd ').addClass('even-row');
6a488035
TO
129 });
130 </script>
131{/literal}
9091c2a1
CW
132
133{if !empty($add_multivalue_js)}
134 {include file="CRM/Custom/Form/MultiValueSearch.js.tpl"}
135{/if}