Merge remote-tracking branch 'upstream/4.4' into 4.4-master-2014-08-04-22-25-32
[civicrm-core.git] / templates / CRM / Event / Form / ManageEvent / Registration.tpl
index f5cb13bbd1415cb93043105015e64fc6bd0667f0..cbc515ae9ae271c686c4047c4663469f2a0f724e 100644 (file)
 {if $addProfileBottomAdd OR $addProfileBottom}
   <td scope="row" class="label"
       width="20%">{if $addProfileBottomAdd }{$form.additional_custom_post_id_multiple[$profileBottomNumAdd].label}
-    {else}{$form.custom_post_id[$profileBottomNum].label}{/if}</td>
+    {else}{$form.custom_post_id_multiple[$profileBottomNum].label}{/if}</td>
   <td>{if $addProfileBottomAdd }{$form.additional_custom_post_id_multiple[$profileBottomNumAdd].html}{else}{$form.custom_post_id_multiple[$profileBottomNum].html}{/if}
     &nbsp;<span class='profile_bottom_link_remove'><a href="#" class="crm-hover-button crm-button-rem-profile"
                                                       data-addtlPartc="{$addProfileBottomAdd}"><span
           class="icon ui-icon-trash"></span>{ts}remove profile{/ts}</a></span>&nbsp;&nbsp;<span
       class='profile_bottom_link'>&nbsp;<a href="#" class="crm-hover-button crm-button-add-profile"><span
-          class="icon ui-icon-plus"></span>{ts}add profile{/ts}</a></span>
-    <br/>
+          class="icon ui-icon-plus"></span>{ts}add another profile (bottom of page){/ts}</a></span>
     {if $addProfileBottomAdd }
-      <span
-        class="description">{ts}Change this if you want to use a different profile for additional participants.{/ts}</span>
+      <div
+        class="description">{ts}Change this if you want to use a different profile for additional participants.{/ts}</div>
     {else}
-      <span
-        class="description">{ts}Include additional fields on this registration form by configuring and selecting a CiviCRM Profile to be included at the bottom of the page.{/ts}</span>
+      <div
+        class="description">{ts}Include additional fields on this registration form by selecting and configuring a CiviCRM Profile to be included at the bottom of the page.{/ts}</div>
     {/if}
     <br/><span class="profile-links"></span>
   </td>
     <table class="form-layout-compressed">
       <tr class="crm-event-manage-registration-form-block-custom_pre_id">
         <td scope="row" class="label" width="20%">{$form.custom_pre_id.label}</td>
-        <td>{$form.custom_pre_id.html}<br/>
-          <span
-            class="description">{ts}Include additional fields on this registration form by configuring and selecting a CiviCRM Profile to be included at the top of the page (immediately after the introductory message).{/ts}{help id="event-profile"}</span><br/>
+        <td>{$form.custom_pre_id.html}
+          <div
+            class="description">{ts}Include additional fields on this registration form by selecting and configuring a CiviCRM Profile to be included at the top of the page (immediately after the introductory message).{/ts}{help id="event-profile"}</div>
         </td>
       </tr>
       <tr id="profile_post" class="crm-event-manage-registration-form-block-custom_post_id">
         <td scope="row" class="label" width="20%">{$form.custom_post_id.label}</td>
         <td>{$form.custom_post_id.html}
-          &nbsp;<span class='profile_bottom_link_main {if $profilePostMultiple}hiddenElement{/if}'>&nbsp;<a href="#"
-                                                                                                            class="crm-hover-button crm-button-add-profile"><span
-                class="icon ui-icon-plus"></span>{ts}add profile{/ts}</a></span>
+          <div
+            class="description">{ts}Include additional fields on this registration form by selecting and configuring a CiviCRM Profile to be included at the bottom of the page.{/ts}</div>
+          &nbsp;<span class='profile_bottom_link_main {if $profilePostMultiple}hiddenElement{/if}'>&nbsp;<a href="#" 
+class="crm-hover-button crm-button-add-profile"><span
+                class="icon ui-icon-plus"></span>{ts}add another profile (bottom of page){/ts}</a></span>
           <br/>
-          <span
-            class="description">{ts}Include additional fields on this registration form by configuring and selecting a CiviCRM Profile to be included at the bottom of the page.{/ts}</span>
         </td>
       </tr>
 
               {if $smarty.foreach.profilePostIdName.last}
                 &nbsp;&nbsp;
                 <span class='profile_bottom_link'><a href="#" class="crm-hover-button crm-button-add-profile"><span
-                      class="icon ui-icon-plus"></span>{ts}add profile{/ts}</a></span>
+                      class="icon ui-icon-plus"></span>{ts}add another profile (bottom of page){/ts}</a></span>
               {/if}
               <br/><span class="profile-links"></span>
             </td>
     <table class="form-layout-compressed">
       <tr id="additional_profile_pre" class="crm-event-manage-registration-form-block-additional_custom_pre_id">
         <td scope="row" class="label" width="20%">{$form.additional_custom_pre_id.label}</td>
-        <td>{$form.additional_custom_pre_id.html}<br/>
-              <span
-                class="description">{ts}Change this if you want to use a different profile for additional participants.{/ts}</span>
+        <td>{$form.additional_custom_pre_id.html}
+              <div
+                class="description">{ts}Change this if you want to use a different profile for additional participants.{/ts}</div>
           <br/><span class="profile-links"></span>
         </td>
       </tr>
       <tr id="additional_profile_post" class="crm-event-manage-registration-form-block-additional_custom_post_id">
         <td scope="row" class="label" width="20%">{$form.additional_custom_post_id.label}</td>
         <td>{$form.additional_custom_post_id.html}
-          &nbsp;<span class='profile_bottom_add_link_main {if $profilePostMultipleAdd}hiddenElement{/if}'><a
+          <div
+            class="description">{ts}Change this if you want to use a different profile for additional participants.{/ts}
+                                       </div>
+          &nbsp;<span class='profile_bottom_add_link_main{if $profilePostMultipleAdd} hiddenElement{/if}'><a
               href="#" class="crm-hover-button crm-button-add-profile"><span
-                class="icon ui-icon-plus"></span>{ts}add profile{/ts}</a></span>
-          <br/>
-              <span
-                class="description">{ts}Change this if you want to use a different profile for additional participants.{/ts}</span>
+                class="icon ui-icon-plus"></span>{ts}add another profile (bottom of page){/ts}</a></span>
           <br/><span class="profile-links"></span>
         </td>
       </tr>
                 &nbsp;&nbsp;
                 <span class='profile_bottom_add_link'><a href="#"
                                                          class="crm-hover-button crm-button-add-profile"><span
-                      class="icon ui-icon-plus"></span>{ts}add profile{/ts}</a></span>
+                      class="icon ui-icon-plus"></span>{ts}add another profile (bottom of page){/ts}</a></span>
               {/if}
               <br/><span class="profile-links"></span>
             </td>
 {*Confirmation Block*}
 <fieldset id="confirm" class="crm-collapsible {if $defaultsEmpty}collapsed{/if}">
   <legend class="collapsible-title">{ts}Confirmation Screen{/ts}</legend>
-  <table class="form-layout-compressed">
-    <tr class="crm-event-manage-registration-form-block-is_confirm_enabled">
-      <td scope="row" class="label" width="20%">{$form.is_confirm_enabled.label}</td>
-      <td>{$form.is_confirm_enabled.html}
-        <div class="description">{ts}Optionally hide the confirmation screen for free events.{/ts}</div>
-      </td>
-    </tr>
-  </table>
+  {if !$is_monetary}
+    <table class="form-layout-compressed">
+      <tr class="crm-event-manage-registration-form-block-is_confirm_enabled">
+        <td scope="row" class="label" width="20%">{$form.is_confirm_enabled.label}</td>
+        <td>{$form.is_confirm_enabled.html}
+          <div class="description">{ts}Optionally hide the confirmation screen for free events.{/ts}</div>
+        </td>
+      </tr>
+    </table>
+  {/if}
 
   <div id="confirm_screen_settings">
     <table class="form-layout-compressed">
@@ -364,7 +365,7 @@ target_element_type ="block"
 field_type          ="radio"
 invert              = 0
 }
-
+{if !$is_monetary}
 {include file="CRM/common/showHideByFieldValue.tpl"
 trigger_field_id    ="is_confirm_enabled"
 trigger_value       =""
@@ -373,7 +374,7 @@ target_element_type ="block"
 field_type          ="radio"
 invert              = 0
 }
-
+{/if}
 {include file="CRM/common/showHideByFieldValue.tpl"
 trigger_field_id    ="is_email_confirm"
 trigger_value       =""
@@ -419,17 +420,19 @@ invert              = 0
 
         var addtlPartc = $(this).data('addtlPartc');
 
-        if (addtlPartc) {
-            profileBottomCount++;
+        if ($(this).closest("td").children("input").attr("name").indexOf("additional_custom_post") > -1 || addtlPartc) {
+            profileBottomCountAdd++
             urlPath = CRM.url('civicrm/event/manage/registration', { addProfileBottomAdd: 1, addProfileNumAdd: profileBottomCountAdd, snippet: 4 } ) ;
         } else {
-            profileBottomCountAdd++;
+            profileBottomCount++;
             urlPath = CRM.url('civicrm/event/manage/registration', { addProfileBottom: 1 , addProfileNum : profileBottomCount, snippet: 4 } ) ;
         }
 
         $(this).closest('tbody').append('<tr class="additional_profile"></tr>');
         var $el = $(this).closest('tbody').find('tr:last');
         $el.load(urlPath, function() { $(this).trigger('crmLoad') });
+        $(this).closest(".profile_bottom_link_main, .profile_bottom_link, .profile_bottom_add_link_main").hide();
+        $el.find(".profile_bottom_link_main, .profile_bottom_link, .profile_bottom_add_link_main").show();
     }
 
     function removeBottomProfile( e ) {
@@ -437,6 +440,7 @@ invert              = 0
 
         $(e.target).parents('tr').find('.crm-profile-selector').val('');
         $(e.target).parents('tr').hide();
+        $(e.target).parents('tbody').find('tr:visible:last .profile_bottom_link_main, tr:visible:last .profile_bottom_link, tr:visible:last .profile_bottom_add_link_main').show();
     }
 
     var strSameAs = ' - '+ts('same as for main contact')+' - ';