Merge pull request #18706 from civicrm/5.30
[civicrm-core.git] / templates / CRM / Profile / Form / Search.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | Copyright CiviCRM LLC. All rights reserved. |
4 | |
5 | This work is published under the GNU AGPLv3 license with some |
6 | permitted exceptions and without any warranty. For full license |
7 | and copyright information, see https://civicrm.org/licensing |
8 +--------------------------------------------------------------------+
9 *}
10 {if ! empty( $fields )}
11 {if $groupId }
12 <div class="crm-accordion-wrapper crm-group-{$groupId}-accordion {if $rows}collapsed{/if}">
13 <div class="crm-accordion-header crm-master-accordion-header">
14 {ts}Edit Search Criteria{/ts}
15 </div>
16 <div class="crm-accordion-body">
17 {else}
18 <div>
19 {/if}
20
21 <table class="form-layout-compressed" id="profile">
22 {foreach from=$fields item=field key=fieldName}
23 {if $field.skipDisplay}
24 {continue}
25 {/if}
26 {assign var=n value=$field.name}
27 {assign var="operator_name" value=$n|cat:'_operator'}
28 {if $field.is_search_range}
29 {assign var=from value=$field.name|cat:'_from'}
30 {assign var=to value=$field.name|cat:'_to'}
31 <tr>
32 <td class="label">{$form.$from.label}</td>
33 <td class="description">{$form.$from.html}&nbsp;&nbsp;{$form.$to.label}&nbsp;&nbsp;{$form.$to.html}</td>
34 </tr>
35 {else}
36 <tr>
37 <td class="label">
38 {$form.$n.label}
39 </td>
40 {if $n eq 'addressee' or $n eq 'email_greeting' or $n eq 'postal_greeting'}
41 <td class="description">
42 {include file="CRM/Profile/Form/GreetingType.tpl"}
43 </td>
44 {elseif $n eq 'group'}
45 <td>
46 <table id="selector" class="selector" style="width:auto;">
47 <tr><td>{$form.$n.html}{* quickform add closing </td> </tr>*}
48 </table>
49 </td>
50 {else}
51 <td class="description">
52 {if $n|substr:0:5 eq 'phone'}
53 {assign var="phone_ext_field" value=$n|replace:'phone':'phone_ext'}
54 {$form.$n.html}
55 {if $form.$phone_ext_field.html}
56 &nbsp;{$form.$phone_ext_field.html}
57 {/if}
58 {else}
59 {$form.$n.html}
60 {/if}
61 {if $field.html_type eq 'Autocomplete-Select' and $field.data_type eq 'ContactReference'}
62 {include file="CRM/Custom/Form/ContactReference.tpl" element_name = $n}
63 {/if}
64 {if !empty($form.$operator_name)}
65 <span class="crm-multivalue-search-op" for="{$n}">{$form.$operator_name.html}</span>
66 {assign var="add_multivalue_js" value=true}
67 {/if}
68 </td>
69 {/if}
70 </tr>
71 {/if}
72 {/foreach}
73
74 {if $proximity_search}
75 <tr><td colspan="2">{include file="CRM/Contact/Form/Task/ProximityCommon.tpl"}</td></tr>
76 {/if}
77
78 <tr><td></td><td>{include file="CRM/common/formButtons.tpl"}</td></tr>
79 </table>
80
81 {if $groupId}
82 </div><!-- /.crm-accordion-body -->
83 </div><!-- /.crm-accordion-wrapper -->
84 {/if}
85
86 {elseif $statusMessage}
87 <div class="messages status no-popup">
88 {icon icon="fa-info-circle"}{/icon}
89 {$statusMessage}
90 </div>
91 {else} {* empty fields *}
92 <div class="messages status no-popup">
93 {icon icon="fa-info-circle"}{/icon}
94 {ts}No fields in this Profile have been configured as searchable. Ask the site administrator to check the Profile setup.{/ts}
95 </div>
96 {/if}
97 {literal}
98 <script type="text/javascript">
99 CRM.$(function($) {
100 $('#selector tr:even').addClass('odd-row ');
101 $('#selector tr:odd ').addClass('even-row');
102 });
103 </script>
104 {/literal}
105
106 {if !empty($add_multivalue_js)}
107 {include file="CRM/Custom/Form/MultiValueSearch.js.tpl"}
108 {/if}