Merge pull request #4871 from eileenmcnaughton/CRM-15795
[civicrm-core.git] / templates / CRM / Event / Form / Participant.tpl
index f04d976a2f9543be14eb3ec68c74641c239583c1..a933b98efdaadfc51954e843767eb3f4f10d9438 100644 (file)
@@ -1,6 +1,6 @@
 {*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
           }
 
         if ( showError ) {
-          cj('#validate_pricefield').show().html("<span class='icon red-icon alert-icon'></span>{/literal}{ts escape='js'}This Option is already full for this event.{/ts}{literal}");
+          cj('#validate_pricefield').show().html("<span class='icon red-icon ui-icon-alert'></span>{/literal}{ts escape='js'}This Option is already full for this event.{/ts}{literal}");
         }
         else {
           cj('#validate_pricefield').hide( ).html('');
          </table>
         {/if}
       {* Fee block (EventFees.tpl) is injected here when an event is selected. *}
-        <div id="feeBlock"></div>
+        <div class="crm-event-form-fee-block"></div>
         <fieldset>
           <table class="form-layout">
             <tr class="crm-participant-form-block-note">
 
         var $form = $('form.{/literal}{$form.formClass}{literal}');
 
-        // don't show cart related statuses if it's disabled
-        {/literal}{if !$enableCart}{literal}
-          var pendingInCartStatusId = {/literal}{$pendingInCartStatusId}{literal};
-          $("#status_id option[value='" + pendingInCartStatusId + "']").remove();
-        {/literal}{/if}{literal}
-
-        {/literal}{if $action eq 1}{literal}
-          var pendingRefundStatusId = {/literal}{$pendingRefundStatusId}{literal};
-          $("#status_id option[value='" + pendingRefundStatusId + "']").remove();
-        {/literal}{/if}{literal}
-
         // Handle event selection
         $('#event_id', $form).change(function() {
           var eventId = $(this).val();
           {/if}
 
           {literal}
-          var eventId = $('#event_id').val();
-
-          {/literal}{if $action eq 2}{literal}
-            if (typeof eventId == 'undefined') {
-              var eventId = $('[name=event_id]').val();
-            }
-          {/literal}{/if}{literal}
+          var eventId = $('[name=event_id], #event_id', $form).val();
 
           if (eventId) {
             dataUrl += '&eventId=' + eventId;
           }
           else {
-            $('#eventFullMsg').hide( );
-            $('#feeBlock').html('');
+            $('#eventFullMsg', $form).hide( );
+            $('.crm-event-form-fee-block', $form).html('');
             return;
           }
 
           $.ajax({
             url: dataUrl,
             success: function ( html ) {
-              $("#feeBlock").html( html ).trigger('crmLoad');
+              $(".crm-event-form-fee-block", $form).html( html ).trigger('crmLoad');
+              //show event real full as well as waiting list message.
+              if ( $("#hidden_eventFullMsg", $form).val( ) ) {
+                $( "#eventFullMsg", $form).show( ).html( $("#hidden_eventFullMsg", $form).val( ) );
+              }
+              else {
+                $( "#eventFullMsg", $form ).hide( );
+              }
             }
           });
-
-          $("#feeBlock").ajaxStart(function(){
-            $(".disable-buttons input").prop('disabled', true);
-          });
-
-          $("#feeBlock").ajaxStop(function(){
-            $(".disable-buttons input").prop('disabled', false);
-          });
-
-          //show event real full as well as waiting list message.
-          if ( $("#hidden_eventFullMsg").val( ) ) {
-            $( "#eventFullMsg" ).show( ).html( $("#hidden_eventFullMsg" ).val( ) );
-          }
-          else {
-            $( "#eventFullMsg" ).hide( );
-          }
         }
 
         {/literal}