2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.6 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2015 |
6 +--------------------------------------------------------------------+
7 | This file is a part of CiviCRM. |
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. |
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. |
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 +--------------------------------------------------------------------+
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}collapsed{/if}">
29 <div class="crm-accordion-header crm-master-accordion-header">
30 {ts}Edit Search Criteria{/ts}
31 </div><!-- /.crm-accordion-header -->
32 <div class="crm-accordion-body">
33 <div id="searchForm" class="crm-block crm-form-block crm-contact-custom-search-activity-search-form-block">
34 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
35 <table class="form-layout-compressed">
36 {* Loop through all defined search criteria fields (defined in the buildForm() function). *}
37 {foreach from=$elements item=element}
38 <tr class="crm-contact-custom-search-activity-search-form-block-{$element}">
39 <td class="label">{$form.$element.label}</td>
41 {if $element eq 'start_date' OR $element eq 'end_date'}
42 {include file="CRM/common/jcalendar.tpl" elementName=$element}
50 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
52 </div><!-- /.crm-accordion-body -->
53 </div><!-- /.crm-accordion-wrapper -->
54 </div><!-- /.crm-form-block -->
56 {if $rowsEmpty || $rows}
58 <div class="crm-content-block">
60 <div class="crm-results-block crm-results-block-empty">
61 {include file="CRM/Contact/Form/Search/Custom/EmptyResults.tpl"}
66 <div class="crm-results-block">
67 {* Search request has returned 1 or more matching rows. Display results and collapse the search criteria fieldset. *}
69 {* This section handles form elements for action task select and submit *}
70 <div class="crm-search-tasks">
71 {include file="CRM/Contact/Form/Search/ResultTasks.tpl"}
73 {* This section displays the rows along and includes the paging controls *}
74 <div class="crm-search-results">
76 {include file="CRM/common/pager.tpl" location="top"}
78 {include file="CRM/common/pagerAToZ.tpl"}
81 <table summary="{ts}Search results listings.{/ts}">
82 <thead class="sticky">
83 <th scope="col" title="Select All Rows">{$form.toggleSelect.html}</th>
84 {foreach from=$columnHeaders item=header}
85 {if ($header.sort eq 'activity_id') or ($header.sort eq 'activity_type_id') or ($header.sort eq 'case_id') }
86 {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 {assign var='key' value=$header.sort}
90 {$sort->_response.$key.link}
101 {counter start=0 skip=1 print=false}
102 {foreach from=$rows item=row}
103 <tr id='rowid{counter}' class="{cycle values="odd-row,even-row"}">
104 {assign var=cbName value=$row.checkbox}
105 <td>{$form.$cbName.html}</td>
106 {foreach from=$columnHeaders item=header}
107 {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) }
108 {assign var=fName value=$header.sort}
109 {if $fName eq 'sort_name'}
110 <td><a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=`$row.contact_id`&key=`$qfKey`"}">{$row.sort_name}</a></td>
111 {elseif $fName eq 'activity_subject'}
114 <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}">
116 <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}">
118 {if isset($row.activity_subject) AND $row.activity_subject NEQ 'NULL'}{$row.activity_subject}{else}{ts}(no subject){/ts}{/if}</a>
120 {elseif ($fName eq 'activity_id') or ($fName eq 'activity_type_id') or ($fName eq 'case_id')}
122 <td>{$row.$fName}</td>
126 <td>{$row.action}</td>
132 {include file="CRM/common/pager.tpl" location="bottom"}
136 {* END Actions/Results section *}