Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | {* |
2 | +--------------------------------------------------------------------+ | |
34cd78e1 | 3 | | CiviCRM version 4.5 | |
6a488035 | 4 | +--------------------------------------------------------------------+ |
34cd78e1 | 5 | | Copyright CiviCRM LLC (c) 2004-2014 | |
6a488035 TO |
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 "Sample" custom search component. *} | |
27 | <div class="crm-form-block crm-search-form-block"> | |
28 | <div class="crm-accordion-wrapper crm-activity_search-accordion {if $rows}crm-accordion-closed{else}crm-accordion-open{/if}"> | |
29 | <div class="crm-accordion-header crm-master-accordion-header"> | |
30 | <div class="icon crm-accordion-pointer"></div> | |
31 | {ts}Edit Search Criteria{/ts} | |
32 | </div><!-- /.crm-accordion-header --> | |
33 | <div class="crm-accordion-body"> | |
34 | <div id="searchForm" class="crm-block crm-form-block crm-contact-custom-search-activity-search-form-block"> | |
35 | <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div> | |
36 | <table class="form-layout-compressed"> | |
37 | {* Loop through all defined search criteria fields (defined in the buildForm() function). *} | |
38 | {foreach from=$elements item=element} | |
39 | <tr class="crm-contact-custom-search-activity-search-form-block-{$element}"> | |
40 | <td class="label">{$form.$element.label}</td> | |
41 | <td> | |
42 | {if $element eq 'start_date' OR $element eq 'end_date'} | |
43 | {include file="CRM/common/jcalendar.tpl" elementName=$element} | |
44 | {else} | |
45 | {$form.$element.html} | |
46 | {/if} | |
47 | </td> | |
48 | </tr> | |
49 | {/foreach} | |
50 | </table> | |
51 | <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div> | |
52 | </table> | |
53 | </div> | |
54 | </div><!-- /.crm-accordion-body --> | |
55 | </div><!-- /.crm-accordion-wrapper --> | |
56 | </div><!-- /.crm-form-block --> | |
57 | ||
58 | {if $rowsEmpty || $rows} | |
59 | ||
60 | <div class="crm-content-block"> | |
61 | {if $rowsEmpty} | |
62 | <div class="crm-results-block crm-results-block-empty"> | |
63 | {include file="CRM/Contact/Form/Search/Custom/EmptyResults.tpl"} | |
64 | </div> | |
65 | {/if} | |
66 | ||
67 | {if $rows} | |
68 | <div class="crm-results-block"> | |
69 | {* Search request has returned 1 or more matching rows. Display results and collapse the search criteria fieldset. *} | |
70 | ||
71 | {* This section handles form elements for action task select and submit *} | |
72 | <div class="crm-search-tasks"> | |
73 | {include file="CRM/Contact/Form/Search/ResultTasks.tpl"} | |
74 | </div> | |
75 | {* This section displays the rows along and includes the paging controls *} | |
76 | <div class="crm-search-results"> | |
77 | ||
78 | {include file="CRM/common/pager.tpl" location="top"} | |
79 | ||
80 | {include file="CRM/common/pagerAToZ.tpl"} | |
81 | ||
82 | {strip} | |
83 | <table summary="{ts}Search results listings.{/ts}"> | |
84 | <thead class="sticky"> | |
85 | <th scope="col" title="Select All Rows">{$form.toggleSelect.html}</th> | |
86 | {foreach from=$columnHeaders item=header} | |
87 | {if ($header.sort eq 'activity_id') or ($header.sort eq 'activity_type_id') or ($header.sort eq 'case_id') } | |
88 | {elseif ($header.sort eq 'sort_name') or ($header.sort eq 'activity_status') or ($header.sort eq 'activity_type') or ($header.sort eq 'activity_subject') or ($header.sort eq 'source_contact') or ($header.SORT eq 'activity_date') or ($header.name eq null) } | |
89 | <th scope="col"> | |
90 | {if $header.sort} | |
91 | {assign var='key' value=$header.sort} | |
92 | {$sort->_response.$key.link} | |
93 | {else} | |
94 | {$header.name} | |
95 | {/if} | |
96 | </th> | |
97 | {/if} | |
98 | </th> | |
99 | {/foreach} | |
100 | <th> </th> | |
101 | </thead> | |
102 | ||
103 | {counter start=0 skip=1 print=false} | |
104 | {foreach from=$rows item=row} | |
105 | <tr id='rowid{counter}' class="{cycle values="odd-row,even-row"}"> | |
106 | {assign var=cbName value=$row.checkbox} | |
107 | <td>{$form.$cbName.html}</td> | |
108 | {foreach from=$columnHeaders item=header} | |
109 | {if ($header.sort eq 'sort_name') or ($header.sort eq 'activity_status') or ($header.sort eq 'activity_type') or ($header.sort eq 'activity_subject') or ($header.sort eq 'source_contact') or ($header.SORT eq 'activity_date') or ($header.name eq null) } | |
110 | {assign var=fName value=$header.sort} | |
111 | {if $fName eq 'sort_name'} | |
112 | <td><a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=`$row.contact_id`"}">{$row.sort_name}</a></td> | |
113 | {elseif $fName eq 'activity_subject'} | |
114 | <td> | |
115 | {if $row.case_id } | |
116 | <a href="{crmURL p='civicrm/case/activity/view' q="reset=1&aid=`$row.activity_id`&cid=`$row.contact_id`&caseID=`$row.case_id`"}" title="{ts}View activity details{/ts}"> | |
117 | {else} | |
118 | <a href="{crmURL p='civicrm/contact/view/activity' q="atype=`$row.activity_type_id`&action=view&reset=1&id=`$row.activity_id`&cid=`$row.contact_id`"}" title="{ts}View activity details{/ts}"> | |
119 | {/if} | |
120 | {if isset($row.activity_subject) AND $row.activity_subject NEQ 'NULL'}{$row.activity_subject}{else}{ts}(no subject){/ts}{/if}</a> | |
121 | </td> | |
122 | {elseif ($fName eq 'activity_id') or ($fName eq 'activity_type_id') or ($fName eq 'case_id')} | |
123 | {else} | |
124 | <td>{$row.$fName}</td> | |
125 | {/if} | |
126 | {/if} | |
127 | {/foreach} | |
128 | <td>{$row.action}</td> | |
129 | </tr> | |
130 | {/foreach} | |
131 | </table> | |
132 | {/strip} | |
133 | ||
6a488035 TO |
134 | {include file="CRM/common/pager.tpl" location="bottom"} |
135 | ||
136 | ||
137 | </div> | |
138 | {* END Actions/Results section *} | |
139 | </div> | |
140 | {/if} | |
141 | </div> | |
142 | {/if} |