7bd688cfabaf29112602f1fbfeaafc1af0b6e43a
[civicrm-core.git] / templates / CRM / Event / Form / Search / Common.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 <tr>
27 <td class="crm-event-form-block-event_id">
28 {$form.event_id.label} <br />{$form.event_id.html|crmAddClass:huge} <br/>
29 {$form.event_include_repeating_events.label}&nbsp;&nbsp;{$form.event_include_repeating_events.html}
30 </td>
31 <td class="crm-event-form-block-event_type_id"> {$form.event_type_id.label}<br />{$form.event_type_id.html} </td>
32 </tr>
33 <tr>
34 <td colspan="2"><label>{ts}Event Dates{/ts}</label></td>
35 </tr>
36 <tr>
37 {include file="CRM/Core/DateRange.tpl" fieldName="event" from='_start_date_low' to='_end_date_high'}
38 </tr>
39 <tr>
40 <td class="crm-event-form-block-participant_status"><label>{ts}Participant Status{/ts}</label>
41 <br />
42 <div class="listing-box" style="width: auto; height: 120px">
43 {foreach from=$form.participant_status_id item="participant_status_val"}
44 <div class="{cycle values="odd-row,even-row"}">
45 {$participant_status_val.html}
46 </div>
47 {/foreach}
48 </div>
49 </td>
50 <td class="crm-event-form-block-participant_role_id"><label>{ts}Participant Role{/ts}</label>
51 <br />
52 <div class="listing-box" style="width: auto; height: 120px">
53 {foreach from=$form.participant_role_id item="participant_role_id_val"}
54 <div class="{cycle values="odd-row,even-row"}">
55 {$participant_role_id_val.html}
56 </div>
57 {/foreach}
58 </div><br />
59 </td>
60 </tr>
61 <tr>
62 <td class="crm-event-form-block-participant_test">
63 {$form.participant_test.label} {help id="is-test" file="CRM/Contact/Form/Search/Advanced"}
64 &nbsp; {$form.participant_test.html}
65 </td>
66 <td class="crm-event-form-block-participant_pay_later">
67 {$form.participant_pay_later.label} {$form.participant_pay_later.html}
68 </td>
69 </tr>
70 <tr>
71 <td class="crm-event-form-block-participant_fee_id">
72 {$form.participant_fee_id.label}<br />{$form.participant_fee_id.html}
73 </td>
74 <td class="crm-event-form-block-participant_fee_amount">
75 <label>{ts}Fee Amount{/ts}</label><br />
76 {$form.participant_fee_amount_low.label} &nbsp; {$form.participant_fee_amount_low.html} &nbsp;&nbsp;
77 {$form.participant_fee_amount_high.label} &nbsp; {$form.participant_fee_amount_high.html}
78 </td>
79 </tr>
80
81 {* campaign in contribution search *}
82 {include file="CRM/Campaign/Form/addCampaignToComponent.tpl" campaignContext="componentSearch"
83 campaignTrClass='' campaignTdClass='crm-event-form-block-participant_campaign_id'}
84
85 {if $participantGroupTree }
86 <tr>
87 <td colspan="4">
88 {include file="CRM/Custom/Form/Search.tpl" groupTree=$participantGroupTree showHideLinks=false}
89 </td>
90 </tr>
91 {/if}
92
93 {literal}
94 <script type="text/javascript">
95 CRM.$(function($) {
96 // FIXME: This could be much simpler as an entityRef field but the priceFieldValue api doesn't currently support the filters we need
97 $('#participant_fee_id').crmSelect2({
98 placeholder: {/literal}'{ts escape="js"}- any -{/ts}'{literal},
99 minimumInputLength: 1,
100 allowClear: true,
101 ajax: {
102 url: "{/literal}{$dataURLEventFee}{literal}",
103 data: function(term) {
104 return {term: term};
105 },
106 results: function(response) {
107 return {results: response};
108 }
109 },
110 initSelection: function(el, callback) {
111 CRM.api3('price_field_value', 'getsingle', {id: $(el).val()}).done(function(data) {
112 callback({id: data.id, text: data.label});
113 });
114 }
115 });
116 });
117 </script>
118 {/literal}