Merge pull request #11197 from agileware/CRM-21104
[civicrm-core.git] / templates / CRM / Profile / Form / Search.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 5 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2018 |
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 <tr>
48 <td class="label">{$form.$from.label}</td>
49 <td class="description">{$form.$from.html}&nbsp;&nbsp;{$form.$to.label}&nbsp;&nbsp;{$form.$to.html}</td>
50 </tr>
51 {else}
52 <tr>
53 <td class="label">
54 {$form.$n.label}
55 </td>
56 {if $n eq 'addressee' or $n eq 'email_greeting' or $n eq 'postal_greeting'}
57 <td class="description">
58 {include file="CRM/Profile/Form/GreetingType.tpl"}
59 </td>
60 {elseif $n eq 'group'}
61 <td>
62 <table id="selector" class="selector" style="width:auto;">
63 <tr><td>{$form.$n.html}{* quickform add closing </td> </tr>*}
64 </table>
65 </td>
66 {else}
67 <td class="description">
68 {if $n|substr:0:5 eq 'phone'}
69 {assign var="phone_ext_field" value=$n|replace:'phone':'phone_ext'}
70 {$form.$n.html}
71 {if $form.$phone_ext_field.html}
72 &nbsp;{$form.$phone_ext_field.html}
73 {/if}
74 {else}
75 {$form.$n.html}
76 {/if}
77 {if $field.html_type eq 'Autocomplete-Select' and $field.data_type eq 'ContactReference'}
78 {include file="CRM/Custom/Form/ContactReference.tpl" element_name = $n}
79 {/if}
80 {if !empty($form.$operator_name)}
81 <span class="crm-multivalue-search-op" for="{$n}">{$form.$operator_name.html}</span>
82 {assign var="add_multivalue_js" value=true}
83 {/if}
84 </td>
85 {/if}
86 </tr>
87 {/if}
88 {/foreach}
89
90 {if $proximity_search}
91 <tr><td colspan="2">{include file="CRM/Contact/Form/Task/ProximityCommon.tpl"}</td></tr>
92 {/if}
93
94 <tr><td></td><td>{include file="CRM/common/formButtons.tpl"}</td></tr>
95 </table>
96
97 {if $groupId}
98 </div><!-- /.crm-accordion-body -->
99 </div><!-- /.crm-accordion-wrapper -->
100 {/if}
101
102 {elseif $statusMessage}
103 <div class="messages status no-popup">
104 <div class="icon inform-icon"></div>
105 {$statusMessage}
106 </div>
107 {else} {* empty fields *}
108 <div class="messages status no-popup">
109 <div class="icon inform-icon"></div>
110 {ts}No fields in this Profile have been configured as searchable. Ask the site administrator to check the Profile setup.{/ts}
111 </div>
112 {/if}
113 {literal}
114 <script type="text/javascript">
115 CRM.$(function($) {
116 $('#selector tr:even').addClass('odd-row ');
117 $('#selector tr:odd ').addClass('even-row');
118 });
119 </script>
120 {/literal}
121
122 {if !empty($add_multivalue_js)}
123 {include file="CRM/Custom/Form/MultiValueSearch.js.tpl"}
124 {/if}