Merge pull request #17981 from eileenmcnaughton/merge_form
[civicrm-core.git] / templates / CRM / Contact / Form / Search / Custom / FullText.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 {* Template for Full-text search component. *}
11 <div class="crm-block crm-form-block crm-search-form-block">
12 <div id="searchForm">
13 <div class="form-item">
14 <table class="form-layout-compressed">
15 <tr>
16 <td class="label">{$form.text.label}</td>
17 <td>{$form.text.html}</td>
18 <td class="label">{ts}in...{/ts}</td>
19 <td>{$form.table.html}</td>
20 <td>{$form.buttons.html} {help id="id-fullText"}</td>
21 </tr>
22 </table>
23 </div>
24 </div>
25 </div>
26 <div class="crm-block crm-content-block">
27 {if !$table}{include file="CRM/common/pager.tpl" location="top"}{/if}
28 {include file="CRM/common/jsortable.tpl"}
29 {if $rowsEmpty}
30 {include file="CRM/Contact/Form/Search/Custom/EmptyResults.tpl"}
31 {/if}
32
33 {assign var=table value=$form.table.value.0}
34 {assign var=text value=$form.text.value}
35 {if !empty($summary.Contact) }
36 <div class="section">
37 {* Search request has returned 1 or more matching rows. Display results. *}
38 <h3>{ts}Contacts{/ts}
39 : {if !$table}{if $summary.Count.Contact <= $limit}{$summary.Count.Contact}{else}{ts 1=$limit}%1 or more{/ts}{/if}{else}{$summary.Count.Contact}{/if}</h3>
40 {if $table}{include file="CRM/common/pager.tpl" location="top"}{/if}
41 {* This section displays the rows along and includes the paging controls *}
42 <table id="contact_listing" class="display" class="selector" summary="{ts}Contact listings.{/ts}">
43 <thead>
44 <tr>
45 <th class='link'>{ts}Name{/ts}</th>
46 {if $allowFileSearch}<th>{ts}File{/ts}</th>{/if}
47 <th></th>
48 </tr>
49 </thead>
50 {foreach from=$summary.Contact item=row}
51 <tr class="{cycle values="odd-row,even-row"}">
52 <td><a
53 href="{crmURL p='civicrm/contact/view' q="reset=1&cid=`$row.contact_id`&context=fulltext&key=`$qfKey`"}"
54 title="{ts}View Contact Details{/ts}">{$row.sort_name}</a></td>
55 {if $allowFileSearch}<td>{$row.fileHtml}</td>{/if}
56 <td><a
57 href="{crmURL p='civicrm/contact/view' q="reset=1&cid=`$row.contact_id`&context=fulltext&key=`$qfKey`"}">{ts}View{/ts}</a>
58 </td>
59 </tr>
60 {/foreach}
61 </table>
62 {if !$table and $summary.addShowAllLink.Contact}
63 <div class="crm-section full-text-view-all-section">
64 <a href="{crmURL p='civicrm/contact/search/custom' q="csid=`$csID`&reset=1&force=1&table=Contact&text=$text"}"
65 title="{ts}View all results for contacts{/ts}"><i class="crm-i fa-chevron-right" aria-hidden="true"></i> {ts}View all results for contacts{/ts}</a>
66 </div>{/if}
67 {* note we using location="below" because we don't want to use rows per page for now. And therefore don't put location="bottom" for now. *}
68 {if $table}{include file="CRM/common/pager.tpl" location="below"}{/if}
69 {* END Actions/Results section *}
70 </div>
71 {/if}
72
73 {if !empty($summary.Activity) }
74 <div class="section">
75 {* Search request has returned 1 or more matching rows. Display results. *}
76
77 <h3>{ts}Activities{/ts}
78 : {if !$table}{if $summary.Count.Activity <= $limit}{$summary.Count.Activity}{else}{ts 1=$limit}%1 or more{/ts}{/if}{else}{$summary.Count.Activity}{/if}</h3>
79 {if $table}{include file="CRM/common/pager.tpl" location="top"}{/if}
80 {* This section displays the rows along and includes the paging controls *}
81 <table id="activity_listing" class="display" summary="{ts}Activity listings.{/ts}">
82 <thead>
83 <tr>
84 <th>{ts}Type{/ts}</th>
85 <th>{ts}Subject{/ts}</th>
86 <th>{ts}Details{/ts}</th>
87 <th class='link'>{ts}Added by{/ts}</th>
88 <th class='link'>{ts}With{/ts}</th>
89 <th class='link'>{ts}Assignee{/ts}</th>
90 {if $allowFileSearch}<th>{ts}File{/ts}</th>{/if}
91 <th></th>
92 </tr>
93 </thead>
94 {foreach from=$summary.Activity item=row}
95 <tr class="{cycle values="odd-row,even-row"}">
96 <td>{$row.activity_type}</td>
97 <td>{$row.subject|mb_truncate:40}</td>
98 <td>{$row.details|escape}</td>
99 <td>
100 <a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=`$row.contact_id`&context=fulltext&key=`$qfKey`"}"
101 title="{ts}View Contact Details{/ts}">{$row.sort_name}</a>
102 </td>
103 <td>
104 <a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=`$row.target_contact_id`&context=fulltext&key=`$qfKey`"}"
105 title="{ts}View Contact Details{/ts}">{$row.target_sort_name}</a>
106 </td>
107 <td>
108 <a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=`$row.assignee_contact_id`&context=fulltext&key=`$qfKey`"}"
109 title="{ts}View Contact Details{/ts}">{$row.assignee_sort_name}</a>
110 </td>
111 {if $allowFileSearch}<td>{$row.fileHtml}</td>{/if}
112 <td>
113 {if $row.case_id }
114 <a href="{crmURL p='civicrm/case/activity/view'
115 q="reset=1&aid=`$row.activity_id`&cid=`$row.client_id`&caseID=`$row.case_id`&context=fulltext&key=`$qfKey`"}">
116 {else}
117 <a href="{crmURL p='civicrm/contact/view/activity'
118 q="atype=`$row.activity_type_id`&action=view&reset=1&id=`$row.activity_id`&cid=`$row.contact_id`&context=fulltext&key=`$qfKey`"}">
119 {/if}
120 {ts}View{/ts}</a>
121 </td>
122 </tr>
123 {/foreach}
124 </table>
125 {if !$table and $summary.addShowAllLink.Activity}
126 <div class="crm-section full-text-view-all-section">
127 <a href="{crmURL p='civicrm/contact/search/custom' q="csid=`$csID`&reset=1&force=1&table=Activity&text=$text"}"
128 title="{ts}View all results for activities{/ts}"><i class="crm-i fa-chevron-right" aria-hidden="true"></i> {ts}View all results for activities{/ts}</a>
129 </div>
130 {/if}
131 {if $table}{include file="CRM/common/pager.tpl" location="below"}{/if}
132 {* END Actions/Results section *}
133 </div>
134 {/if}
135
136 {if !empty($summary.Case) }
137 <div class="section">
138 {* Search request has returned 1 or more matching rows. Display results. *}
139 <h3>{ts}Cases{/ts}
140 : {if !$table}{if $summary.Count.Case <= $limit}{$summary.Count.Case}{else}{ts 1=$limit}%1 or more{/ts}{/if}{else}{$summary.Count.Case}{/if}</h3>
141 {if $table}{include file="CRM/common/pager.tpl" location="top"}{/if}
142 {* This section displays the rows along and includes the paging controls *}
143 <table id="case_listing" class="display" summary="{ts}Case listings.{/ts}">
144 <thead>
145 <tr>
146 <th class='link'>{ts}Client Name{/ts}</th>
147 <th class="start_date">{ts}Start Date{/ts}</th>
148 <th class="end_date">{ts}End Date{/ts}</th>
149 <th>{ts}Case ID{/ts}</th>
150 {if $allowFileSearch}<th>{ts}File{/ts}</th>{/if}
151 <th></th>
152 <th class="hiddenElement"></th>
153 <th class="hiddenElement"></th>
154 </tr>
155 </thead>
156 {foreach from=$summary.Case item=row}
157 <tr class="{cycle values="odd-row,even-row"}">
158 <td>
159 <a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=`$row.contact_id`&context=fulltext&key=`$qfKey`"}"
160 title="{ts}View Contact Details{/ts}">{$row.sort_name}</a>
161 </td>
162 <td>{$row.case_start_date|crmDate:"%b %d, %Y %l:%M %P"}</td>
163 <td>{$row.case_end_date|crmDate:"%b %d, %Y %l:%M %P"}</td>
164 <td>{$row.case_id}</td>
165 {if $allowFileSearch}<td>{$row.fileHtml}</td>{/if}
166 {if $row.case_is_deleted}
167 <td>
168 <a href="{crmURL p='civicrm/contact/view/case'
169 q="reset=1&id=`$row.case_id`&cid=`$row.contact_id`&action=renew&context=fulltext&key=`$qfKey`"}">{ts}Restore Case{/ts}</a>
170 </td>
171 {else}
172 <td>
173 <a href="{crmURL p='civicrm/contact/view/case'
174 q="reset=1&id=`$row.case_id`&cid=`$row.contact_id`&action=view&context=fulltext&key=`$qfKey`"}">{ts}Manage{/ts}</a>
175 </td>
176 {/if}
177 <td class="start_date hiddenElement">{$row.case_start_date|crmDate}</td>
178 <td class="end_date hiddenElement">{$row.case_end_date|crmDate}</td>
179 </tr>
180 {/foreach}
181 </table>
182 {if !$table and $summary.addShowAllLink.Case}
183 <div class="crm-section full-text-view-all-section">
184 <a href="{crmURL p='civicrm/contact/search/custom' q="csid=`$csID`&reset=1&force=1&table=Case&text=$text"}"
185 title="{ts}View all results for cases{/ts}"><i class="crm-i fa-chevron-right" aria-hidden="true"></i> {ts}View all results for cases{/ts}</a>
186 </div>
187 {/if}
188 {if $table}{include file="CRM/common/pager.tpl" location="below"}{/if}
189 {* END Actions/Results section *}
190 </div>
191 {/if}
192
193 {if !empty($summary.Contribution) }
194 <div class="section">
195 {* Search request has returned 1 or more matching rows. Display results. *}
196
197 <h3>{ts}Contributions{/ts}
198 : {if !$table}{if $summary.Count.Contribution <= $limit}{$summary.Count.Contribution}{else}{ts 1=$limit}%1 or more{/ts}{/if}{else}{$summary.Count.Contribution}{/if}</h3>
199 {if $table}{include file="CRM/common/pager.tpl" location="top"}{/if}
200 {* This section displays the rows along and includes the paging controls *}
201 <table id="contribute_listing" class="display" summary="{ts}Contribution listings.{/ts}">
202 <thead>
203 <tr>
204 <th class='link'>{ts}Contributor's Name{/ts}</th>
205 <th class="currency">{ts}Amount{/ts}</th>
206 <th>{ts}Financial Type{/ts}</th>
207 <th>{ts}Source{/ts}</th>
208 <th class="received_date">{ts}Received{/ts}</th>
209 <th>{ts}Status{/ts}</th>
210 {if $allowFileSearch}<th>{ts}File{/ts}</th>{/if}
211 <th></th>
212 <th class="hiddenElement"></th>
213 </tr>
214 </thead>
215 {foreach from=$summary.Contribution item=row}
216 <tr class="{cycle values="odd-row,even-row"}">
217 <td>
218 <a href="{crmURL p='civicrm/contact/view'
219 q="reset=1&cid=`$row.contact_id`&context=fulltext&key=`$qfKey`"}"
220 title="{ts}View Contact Details{/ts}">{$row.sort_name}</a>
221 </td>
222 <td>{$row.contribution_total_amount|crmMoney}</td>
223 <td>{$row.financial_type}</td>
224 <td>{$row.contribution_source}</td>
225 <td>{$row.contribution_receive_date|crmDate:"%b %d, %Y %l:%M %P"}</td>
226 <td>{$row.contribution_status}</td>
227 {if $allowFileSearch}<td>{$row.fileHtml}</td>{/if}
228 <td>
229 <a href="{crmURL p='civicrm/contact/view/contribution'
230 q="reset=1&id=`$row.contribution_id`&cid=`$row.contact_id`&action=view&context=fulltext&key=`$qfKey`"}">{ts}View{/ts}</a>
231 </td>
232 <td class="received_date hiddenElement">{$row.contribution_receive_date|crmDate}</td>
233 </tr>
234 {/foreach}
235 </table>
236 {if !$table and $summary.addShowAllLink.Contribution}
237 <div class="crm-section full-text-view-all-section">
238 <a href="{crmURL p='civicrm/contact/search/custom' q="csid=`$csID`&reset=1&force=1&table=Contribution&text=$text"}"
239 title="{ts}View all results for contributions{/ts}"><i class="crm-i fa-chevron-right" aria-hidden="true"></i> {ts}View all results for contributions{/ts}</a>
240 </div>
241 {/if}
242 {if $table}{include file="CRM/common/pager.tpl" location="below"}{/if}
243 {* END Actions/Results section *}
244 </div>
245 {/if}
246
247 {if !empty($summary.Participant) }
248 <div class="section">
249 {* Search request has returned 1 or more matching rows. *}
250
251 <h3>{ts}Event Participants{/ts}
252 : {if !$table}{if $summary.Count.Participant <= $limit}{$summary.Count.Participant}{else}{ts 1=$limit}%1 or more{/ts}{/if}{else}{$summary.Count.Participant}{/if}</h3>
253 {if $table}{include file="CRM/common/pager.tpl" location="top"}{/if}
254 {* This section displays the rows along and includes the paging controls *}
255 <table id="participant_listing" class="display" summary="{ts}Participant listings.{/ts}">
256 <thead>
257 <tr>
258 <th class='link'>{ts}Participant's Name{/ts}</th>
259 <th>{ts}Event{/ts}</th>
260 <th>{ts}Fee Level{/ts}</th>
261 <th class="currency">{ts}Fee Amount{/ts}</th>
262 <th class="register_date">{ts}Register Date{/ts}</th>
263 <th>{ts}Source{/ts}</th>
264 <th>{ts}Status{/ts}</th>
265 <th>{ts}Role{/ts}</th>
266 {if $allowFileSearch}<th>{ts}File{/ts}</th>{/if}
267 <th></th>
268 <th class="hiddenElement"></th>
269 </tr>
270 </thead>
271 {foreach from=$summary.Participant item=row}
272 <tr class="{cycle values="odd-row,even-row"}">
273 <td>
274 <a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=`$row.contact_id`&context=fulltext&key=`$qfKey`"}"
275 title="{ts}View Contact Details{/ts}">{$row.sort_name}</a>
276 </td>
277 <td>{$row.event_title}</td>
278 <td>{$row.participant_fee_level}</td>
279 <td>{$row.participant_fee_amount|crmMoney}</td>
280 <td>{$row.participant_register_date|crmDate:"%b %d, %Y %l:%M %P"}</td>
281 <td>{$row.participant_source}</td>
282 <td>{$row.participant_status}</td>
283 <td>{$row.participant_role}</td>
284 {if $allowFileSearch}<td>{$row.fileHtml}</td>{/if}
285 <td>
286 <a href="{crmURL p='civicrm/contact/view/participant'
287 q="reset=1&id=`$row.participant_id`&cid=`$row.contact_id`&action=view&context=fulltext&key=`$qfKey`"}">{ts}View{/ts}</a>
288 </td>
289 <td class="register_date hiddenElement">{$row.participant_register_date|crmDate}</td>
290 </tr>
291 {/foreach}
292 </table>
293 {if !$table and $summary.addShowAllLink.Participant}
294 <div class="crm-section full-text-view-all-section"><a
295 href="{crmURL p='civicrm/contact/search/custom' q="csid=`$csID`&reset=1&force=1&table=Participant&text=$text"}"
296 title="{ts}View all results for participants{/ts}"><i class="crm-i fa-chevron-right" aria-hidden="true"></i> {ts}View all results for participants{/ts}</a>
297 </div>{/if}
298 {if $table}{include file="CRM/common/pager.tpl" location="below"}{/if}
299 {* END Actions/Results section *}
300 </div>
301 {/if}
302
303 {if !empty($summary.Membership) }
304 <div class="section">
305 {* Search request has returned 1 or more matching rows. *}
306
307 <h3>{ts}Memberships{/ts}
308 : {if !$table}{if $summary.Count.Membership <= $limit}{$summary.Count.Membership}{else}{ts 1=$limit}%1 or more{/ts}{/if}{else}{$summary.Count.Membership}{/if}</h3>
309 {if $table}{include file="CRM/common/pager.tpl" location="top"}{/if}
310 {* This section displays the rows along and includes the paging controls *}
311 <table id="membership_listing" class="display" summary="{ts}Membership listings.{/ts}">
312 <thead>
313 <tr>
314 <th class='link'>{ts}Member's Name{/ts}</th>
315 <th>{ts}Membership Type{/ts}</th>
316 <th class="currency">{ts}Membership Fee{/ts}</th>
317 <th class="start_date">{ts}Membership Start Date{/ts}</th>
318 <th class="end_date">{ts}Membership End Date{/ts}</th>
319 <th>{ts}Source{/ts}</th>
320 <th>{ts}Status{/ts}</th>
321 {if $allowFileSearch}<th>{ts}File{/ts}</th>{/if}
322 <th></th>
323 <th class="hiddenElement"></th>
324 <th class="hiddenElement"></th>
325 </tr>
326 </thead>
327 {foreach from=$summary.Membership item=row}
328 <tr class="{cycle values="odd-row,even-row"}">
329 <td>
330 <a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=`$row.contact_id`&context=fulltext&key=`$qfKey`"}"
331 title="{ts}View Contact Details{/ts}">{$row.sort_name}</a>
332 </td>
333 <td>{$row.membership_type}</td>
334 <td>{$row.membership_fee|crmMoney}</td>
335 <td>{$row.membership_start_date|crmDate:"%b %d, %Y %l:%M %P"}</td>
336 <td>{$row.membership_end_date|crmDate:"%b %d, %Y %l:%M %P"}</td>
337 <td>{$row.membership_source}</td>
338 <td>{$row.membership_status}</td>
339 {if $allowFileSearch}<td>{$row.fileHtml}</td>{/if}
340 <td>
341 <a href="{crmURL p='civicrm/contact/view/membership'
342 q="reset=1&id=`$row.membership_id`&cid=`$row.contact_id`&action=view&context=fulltext&key=`$qfKey`"}">{ts}View{/ts}</a>
343 </td>
344 <td class="start_date hiddenElement">{$row.membership_start_date|crmDate}</td>
345 <td class="end_date hiddenElement">{$row.membership_end_date|crmDate}</td>
346 </tr>
347 {/foreach}
348 </table>
349 {if !$table and $summary.addShowAllLink.Membership}
350 <div class="crm-section full-text-view-all-section">
351 <a href="{crmURL p='civicrm/contact/search/custom' q="csid=`$csID`&reset=1&force=1&table=Membership&text=$text"}"
352 title="{ts}View all results for memberships{/ts}"><i class="crm-i fa-chevron-right" aria-hidden="true"></i> {ts}View all results for memberships{/ts}</a>
353 </div>
354 {/if}
355 {if $table}{include file="CRM/common/pager.tpl" location="below"}{/if}
356 {* END Actions/Results section *}
357 </div>
358 {/if}
359
360 {if !empty($summary.File) }
361 <div class="section">
362 {* Search request has returned 1 or more matching rows. *}
363
364 <h3>{ts}Files{/ts}:
365 {if !$table}
366 {if $summary.Count.File <= $limit}{$summary.Count.File}{else}{ts 1=$limit}%1 or more{/ts}{/if}
367 {else}
368 {$summary.Count.File}
369 {/if}</h3>
370 {if $table}{include file="CRM/common/pager.tpl" location="top"}{/if}
371
372 {* This section displays the rows along and includes the paging controls *}
373 <table id="file_listing" class="display" summary="{ts}File listings.{/ts}">
374 <thead>
375 <tr>
376 <th class='link'>{ts}File Name{/ts}</th>
377 <th>{ts}Type{/ts}</th>
378 <th>{ts}Attached To{/ts}</th>
379 <th></th>
380 </tr>
381 </thead>
382 <tbody>
383 {foreach from=$summary.File item=row}
384 <tr class="{cycle values="odd-row,even-row"}">
385 <td><a href="{$row.file_url}">{$row.file_name}</a></td>
386 <td>{$row.file_mime_type}</td>
387 <td>{crmCrudLink action=VIEW table=$row.file_entity_table id=$row.file_entity_id}</td>
388 <td>
389 <a href="{$row.file_url}">{ts}View{/ts}</a>
390 </td>
391 </tr>
392 {/foreach}
393 </tbody>
394 </table>
395 {if !$table and $summary.addShowAllLink.File}
396 <div class="crm-section full-text-view-all-section">
397 <a href="{crmURL p='civicrm/contact/search/custom' q="csid=`$csID`&reset=1&force=1&table=File&text=$text"}"
398 title="{ts}View all results for files{/ts}"><i class="crm-i fa-chevron-right" aria-hidden="true"></i> {ts}View all results for files{/ts}</a>
399 </div>{/if}
400 {if $table}{include file="CRM/common/pager.tpl" location="below"}{/if}
401 {* END Actions/Results section *}
402 </div>
403 {/if}
404
405 {if !$table}{include file="CRM/common/pager.tpl" location="bottom"}{/if}
406 </div>