Merge pull request #10602 from agileware/CIVICRM-167
[civicrm-core.git] / templates / CRM / Contact / Form / Search / Custom.tpl
CommitLineData
6a488035
TO
1{*
2 +--------------------------------------------------------------------+
2c4c49ca 3 | CiviCRM version 4.7 |
6a488035 4 +--------------------------------------------------------------------+
8c9251b3 5 | Copyright CiviCRM LLC (c) 2004-2018 |
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{* Default template custom searches. This template is used automatically if templateFile() function not defined in
27 custom search .php file. If you want a different layout, clone and customize this file and point to new file using
28 templateFile() function.*}
29<div class="crm-block crm-form-block crm-contact-custom-search-form-block">
30<div class="crm-accordion-wrapper crm-custom_search_form-accordion {if $rows}collapsed{/if}">
31 <div class="crm-accordion-header crm-master-accordion-header">
32 {ts}Edit Search Criteria{/ts}
33 </div><!-- /.crm-accordion-header -->
34 <div class="crm-accordion-body">
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-form-row-{$element}">
40 <td class="label">{$form.$element.label}</td>
28977896
MW
41 {if $element|strstr:'_date'}
42 <td>{include file="CRM/common/jcalendar.tpl" elementName=$element}</td>
6a488035
TO
43 {else}
44 <td>{$form.$element.html}</td>
45 {/if}
46 </tr>
47 {/foreach}
48 </table>
49 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
50 </div><!-- /.crm-accordion-body -->
51</div><!-- /.crm-accordion-wrapper -->
52</div><!-- /.crm-form-block -->
53
54{if $rowsEmpty || $rows}
55<div class="crm-content-block">
56{if $rowsEmpty}
57 {include file="CRM/Contact/Form/Search/Custom/EmptyResults.tpl"}
58{/if}
59
60{if $summary}
61 {$summary.summary}: {$summary.total}
62{/if}
63
64{if $rows}
65 <div class="crm-results-block">
66 {* Search request has returned 1 or more matching rows. Display results and collapse the search criteria fieldset. *}
67 {* This section handles form elements for action task select and submit *}
68 <div class="crm-search-tasks">
69 {include file="CRM/Contact/Form/Search/ResultTasks.tpl"}
70 </div>
71 {* This section displays the rows along and includes the paging controls *}
72 <div class="crm-search-results">
73
74 {include file="CRM/common/pager.tpl" location="top"}
75
76 {* Include alpha pager if defined. *}
77 {if $atoZ}
78 {include file="CRM/common/pagerAToZ.tpl"}
79 {/if}
80
81 {strip}
16850d34 82 <table class="selector row-highlight" summary="{ts}Search results listings.{/ts}">
6a488035
TO
83 <thead class="sticky">
84 <tr>
85 <th scope="col" title="Select All Rows">{$form.toggleSelect.html}</th>
86 {foreach from=$columnHeaders item=header}
87 <th scope="col">
88 {if $header.sort}
89 {assign var='key' value=$header.sort}
90 {$sort->_response.$key.link}
91 {else}
92 {$header.name}
93 {/if}
94 </th>
95 {/foreach}
96 <th>&nbsp;</th>
97 </tr>
98 </thead>
99
100 {counter start=0 skip=1 print=false}
101 {foreach from=$rows item=row}
102 <tr id='rowid{$row.contact_id}' class="{cycle values="odd-row,even-row"}">
103 {assign var=cbName value=$row.checkbox}
104 <td>{$form.$cbName.html}</td>
105 {foreach from=$columnHeaders item=header}
106 {assign var=fName value=$header.sort}
107 {if $fName eq 'sort_name'}
bd4a9036 108 <td><a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=`$row.contact_id`&key=`$qfKey`&context=custom"}">{$row.sort_name}</a></td>
6a488035
TO
109 {else}
110 <td>{$row.$fName}</td>
111 {/if}
112 {/foreach}
113 <td>{$row.action}</td>
114 </tr>
115 {/foreach}
116 </table>
117 {/strip}
118
6a488035
TO
119 {include file="CRM/common/pager.tpl" location="bottom"}
120
121 </p>
122 {* END Actions/Results section *}
123 </div>
124 </div>
125{/if}
126
127
128
129</div>
130{/if}