bf0a2ebe125d04201005056e01ee0f88b15c27ec
[civicrm-core.git] / templates / CRM / Contact / Form / Search / Custom / EventDetails.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 5 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2018 |
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 "EventAggregate" custom search component. *}
27 {assign var="showBlock" value="'searchForm'"}
28 {assign var="hideBlock" value="'searchForm_show','searchForm_hide'"}
29 <div class="crm-block crm-form-block crm-search-form-block">
30 <div id="searchForm_show" class="form-item">
31 <a href="#" onclick="cj('#searchForm_show').hide(); cj('#searchForm').show(); return false;"><img src="{$config->resourceBase}i/TreePlus.gif" class="action-icon" alt="{ts}open section{/ts}" /></a>
32 <label>{ts}Edit Search Criteria{/ts}</label>
33 </div>
34
35 <div id="searchForm" class="crm-block crm-form-block crm-contact-custom-search-eventDetails-form-block">
36 <fieldset>
37 <legend><span id="searchForm_hide"><a href="#" onclick="cj('#searchForm').hide(); cj('#searchForm_show').show(); return false;"><img src="{$config->resourceBase}i/TreeMinus.gif" class="action-icon" alt="{ts}close section{/ts}" /></a></span>{ts}Search Criteria{/ts}</legend>
38 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
39 <table class="form-layout-compressed">
40 {* Loop through all defined search criteria fields (defined in the buildForm() function). *}
41 {foreach from=$elements item=element}
42 <tr class="crm-contact-custom-search-eventDetails-form-block-{$element}">
43 <td class="label">{$form.$element.label}</td>
44 {if $element eq 'start_date'}
45 <td>{include file="CRM/common/jcalendar.tpl" elementName=start_date}</td>
46 {elseif $element eq 'end_date'}
47 <td>{include file="CRM/common/jcalendar.tpl" elementName=end_date}</td>
48 {else}
49 <td>{$form.$element.html}</td>
50 {/if}
51 </tr>
52 {/foreach}
53 <tr class="crm-contact-custom-search-eventDetails-form-block-event_type">
54 <td class="label">{ts}Event Type{/ts}</td>
55 <td>
56 <div class="listing-box">
57 {foreach from=$form.event_type_id item="event_val"}
58 <div class="{cycle values="odd-row,even-row"}">
59 {$event_val.html}
60 </div>
61 {/foreach}
62 </div>
63 <div class="spacer"></div>
64 </td>
65 </tr>
66 </table>
67 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
68 </fieldset>
69 </div>
70
71 {if $rowsEmpty}
72 {include file="CRM/Contact/Form/Search/Custom/EmptyResults.tpl"}
73 {/if}
74
75 {if $rows}
76 {* Search request has returned 1 or more matching rows. Display results and collapse the search criteria fieldset. *}
77 {assign var="showBlock" value="'searchForm_show'"}
78 {assign var="hideBlock" value="'searchForm'"}
79
80 <fieldset>
81 {* The action task select and submit has been removed from this custom search because we're not dealing with contact records (so it won't work). *}
82
83 {* This section displays the rows along and includes the paging controls *}
84 <p>
85
86 {include file="CRM/common/pager.tpl" location="top"}
87
88 {include file="CRM/common/pagerAToZ.tpl"}
89
90 {strip}
91 <table summary="{ts}Search results listings.{/ts}">
92 <thead class="sticky">
93 {foreach from=$columnHeaders item=header}
94 <th scope="col">
95 {if $header.sort}
96 {assign var='key' value=$header.sort}
97 {$sort->_response.$key.link}
98 {else}
99 {$header.name}
100 {/if}
101 </th>
102 {/foreach}
103 </thead>
104
105 {counter start=0 skip=1 print=false}
106 {foreach from=$rows item=row}
107 <tr id='rowid{$row.contact_id}' class="{cycle values="odd-row,even-row"}">
108
109 {foreach from=$columnHeaders item=header}
110 {assign var=fName value=$header.sort}
111 {if $fName eq 'sort_name'}
112 <td>{$row.sort_name}</a></td>
113 {elseif $fName eq 'payment_amount' || $fName eq 'fee' || $fName eq 'net_payment'}
114 <td>{$row.$fName|crmMoney}</td>
115 {elseif $fName eq 'participant_count'}
116 <td>{$row.$fName}</td>
117 {else}
118 <td>{$row.$fName}</td>
119 {/if}
120 {/foreach}
121 </tr>
122 {/foreach}
123
124 {if $summary}
125 <tr class="columnheader">
126 <td>&nbsp;</td>
127 <td>Totals &nbsp; &nbsp;</td>
128 <td>{$summary.participant_count}</td>
129 <td>{$summary.payment_amount|crmMoney}</td>
130 <td>{$summary.fee|crmMoney}</td>
131 <td colspan=2>{$summary.net_payment|crmMoney}</td>
132 </tr>
133 {/if}
134 </table>
135 {/strip}
136
137 {include file="CRM/common/pager.tpl" location="bottom"}
138
139 </p>
140 </fieldset>
141 {* END Actions/Results section *}
142 {/if}
143
144 <script type="text/javascript">
145 var showBlock = new Array({$showBlock});
146 var hideBlock = new Array({$hideBlock});
147
148 {* hide and display the appropriate blocks *}
149 on_load_init_blocks( showBlock, hideBlock );
150 </script>
151 </div>