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