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