Merge pull request #5101 from agh1/context-abbrev
[civicrm-core.git] / templates / CRM / Event / Form / EventFees.tpl
index bb272a025534103910b6bd9d42192d5cffac7fb3..c18a0ac5679b7555885a3dd5e7fa43baea2423aa 100644 (file)
@@ -1,6 +1,6 @@
 {*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
@@ -41,7 +41,7 @@
                 <tr>
                   <td></td>
                   <td>
-                    <a class="button" href='{crmURL p="civicrm/event/participant/feeselection" q="reset=1&id=`$participantId`&cid=`$contactId`&action=update"}' title="{ts}Change Selections{/ts}"><span><div class="icon edit-icon"></div> {ts}Change Selections{/ts}</span></a>
+                    <a class="action-item crm-hover-button" href='{crmURL p="civicrm/event/participant/feeselection" q="reset=1&id=`$participantId`&cid=`$contactId`&action=update"}'><span class="icon ui-icon-pencil"></span {ts}Change Selections{/ts}</a>
                   </td>
                 </tr>
             {else}
 {if $context eq 'standalone' and $outBound_option != 2 }
 <script type="text/javascript">
 {literal}
-CRM.$(function($) {
-    cj("#contact_1").blur( function( ) {
-        checkEmail( );
-    } );
-    checkEmail( );
-});
-function checkEmail( ) {
-    var contactID =  cj("input[name='contact_select_id[1]']").val();
-    if ( contactID ) {
-        var postUrl = "{/literal}{crmURL p='civicrm/ajax/checkemail' h=0}{literal}";
-        cj.post( postUrl, {contact_id: contactID},
-            function ( response ) {
-                if ( response ) {
-                    cj("#email-receipt").show( );
-                    if ( cj("#send_receipt").is(':checked') ) {
-                        cj("#notice").show( );
-                    }
+  CRM.$(function($) {
+    var $form = $("form.{/literal}{$form.formClass}{literal}");
+    $("#contact_id", $form).change(checkEmail);
+    checkEmail();
 
-                    cj("#email-address").html( response );
-                } else {
-                    cj("#email-receipt").hide( );
-                    cj("#notice").hide( );
-                }
-            }
-        );
+    function checkEmail( ) {
+      var data = $("#contact_id", $form).select2('data');
+      if (data && data.extra && data.extra.email && data.extra.email.length) {
+        $("#email-receipt", $form).show();
+        if ($("#send_receipt", $form).is(':checked')) {
+          $("#notice", $form).show();
+        }
+        $("#email-address", $form).html(data.extra.email);
+      }
+      else {
+        $("#email-receipt, #notice", $form).hide();
+      }
     }
-}
+  });
 {/literal}
 </script>
 {/if}