Merge pull request #5499 from colemanw/CRM-16155
[civicrm-core.git] / templates / CRM / Event / Form / Search / Common.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.6 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2015 |
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>{$form.participant_status_id.label}</label>
41 <br />
42 {$form.participant_status_id.html}
43 </td>
44 <td class="crm-event-form-block-participant_role_id"><label>{$form.participant_role_id.label}</label>
45 <br />
46 {$form.participant_role_id.html}
47 </td>
48 </tr>
49 <tr>
50 <td class="crm-event-form-block-participant_test">
51 {$form.participant_test.label} {help id="is-test" file="CRM/Contact/Form/Search/Advanced"}
52 &nbsp; {$form.participant_test.html}
53 </td>
54 <td class="crm-event-form-block-participant_pay_later">
55 {$form.participant_is_pay_later.label} {$form.participant_is_pay_later.html}
56 </td>
57 </tr>
58 <tr>
59 <td class="crm-event-form-block-participant_fee_id">
60 {$form.participant_fee_id.label}<br />{$form.participant_fee_id.html}
61 </td>
62 <td class="crm-event-form-block-participant_fee_amount">
63 <label>{ts}Fee Amount{/ts}</label><br />
64 {$form.participant_fee_amount_low.label} &nbsp; {$form.participant_fee_amount_low.html} &nbsp;&nbsp;
65 {$form.participant_fee_amount_high.label} &nbsp; {$form.participant_fee_amount_high.html}
66 </td>
67 </tr>
68
69 {* campaign in contribution search *}
70 {include file="CRM/Campaign/Form/addCampaignToComponent.tpl" campaignContext="componentSearch"
71 campaignTrClass='' campaignTdClass='crm-event-form-block-participant_campaign_id'}
72
73 {if $participantGroupTree }
74 <tr>
75 <td colspan="4">
76 {include file="CRM/Custom/Form/Search.tpl" groupTree=$participantGroupTree showHideLinks=false}
77 </td>
78 </tr>
79 {/if}
80
81 {literal}
82 <script type="text/javascript">
83 CRM.$(function($) {
84 // FIXME: This could be much simpler as an entityRef field but the priceFieldValue api doesn't currently support the filters we need
85 $('#participant_fee_id').crmSelect2({
86 placeholder: {/literal}'{ts escape="js"}- any -{/ts}'{literal},
87 minimumInputLength: 1,
88 allowClear: true,
89 ajax: {
90 url: "{/literal}{$dataURLEventFee}{literal}",
91 data: function(term) {
92 return {term: term};
93 },
94 results: function(response) {
95 return {results: response};
96 }
97 },
98 initSelection: function(el, callback) {
99 CRM.api3('price_field_value', 'getsingle', {id: $(el).val()}).done(function(data) {
100 callback({id: data.id, text: data.label});
101 });
102 }
103 });
104 });
105 </script>
106 {/literal}