1 {include file="CRM/common/TrackingFields.tpl"}
3 <div class="crm-block crm-form-block crm-eventcart-participantsandprices">
6 <div class="messages status no-popup">
7 {ts 1=$contact.display_name}Welcome %1{/ts}. (<a href="{crmURL p='civicrm/event/cart_checkout' q="cid=0&reset=1"}" title="{ts}Click here to register a different person for this event.{/ts}">{ts 1=$contact.display_name}Not %1, or want to register a different person{/ts}</a>?)</div>
10 {foreach from=$events_in_carts key=index item=event_in_cart}
11 {if !$event_in_cart.main_conference_event_id}
12 {assign var=event_id value=$event_in_cart->event_id}
13 <h3 class="event-title">
14 {$event_in_cart->event->title} ({$event_in_cart->event->start_date|date_format:"%m/%d/%Y %l:%M%p"})
16 <fieldset class="event_form">
17 <div class="participants crm-section" id="event_{$event_in_cart->event_id}_participants">
18 {foreach from=$event_in_cart->participants item=participant}
19 {include file="CRM/Event/Cart/Form/Checkout/Participant.tpl"}
21 <a class="link-add" href="#" onclick="add_participant({$event_in_cart->event_cart->id}, {$event_in_cart->event_id}); return false;">{ts}Add Another Participant{/ts}</a>
23 {if $event_in_cart->event->is_monetary}
24 <div class="price_choices crm-section">
25 {foreach from=$price_fields_for_event.$event_id key=price_index item=price_field_name}
27 {$form.$price_field_name.label}
30 {$form.$price_field_name.html|replace:'/label> ':'/label><br>'}
35 <p>{ts}There is no charge for this event.{/ts}</p>
41 <div id="crm-submit-buttons" class="crm-submit-buttons">
42 {include file="CRM/common/formButtons.tpl" location="bottom"}
45 {include file="CRM/Event/Cart/Form/viewCartLink.tpl"}
49 <script type="text/javascript">
51 function add_participant( cart_id, event_id ) {
53 var matcher = new RegExp("event_" + event_id + "_participant_(\\d+)");
55 cj('#event_' + event_id + '_participants .participant').each(
57 matches = matcher.exec(cj(this).attr('id'));
58 index = parseInt(matches[1]);
59 if (index > max_index)
66 // FIXME: this get should be a post according to restful standards
67 cj.get(CRM.url("civicrm/ajax/event/add_participant_to_cart?snippet=1", {cart_id: cart_id, event_id: event_id}),
69 cj('#event_' + event_id + '_participants').append(data).trigger('crmLoad');
74 function delete_participant( event_id, participant_id )
76 // FIXME: this get should be a post according to restful standards
77 cj('#event_' + event_id + '_participant_' + participant_id).remove();
78 cj.get(CRM.url("civicrm/ajax/event/remove_participant_from_cart", {id: participant_id}));
83 cj('#ajax_error').ajaxError(
84 function( e, xrh, settings, exception ) {
85 cj(this).append('<div class="error">{/literal}{ts escape='js'}Error adding a participant at{/ts}{literal} ' + settings.url + ': ' + exception);