Additional QA Fix for CRM-15427
authoratif-shaikh <shaikh388@gmail.com>
Fri, 7 Nov 2014 14:23:43 +0000 (19:53 +0530)
committeratif-shaikh <shaikh388@gmail.com>
Fri, 7 Nov 2014 14:23:43 +0000 (19:53 +0530)
----------------------------------------
* CRM-15427: Profiles using Participants (Event type), Participants (Event Name) and Participants (Role) custom fields are not available for online registration
  https://issues.civicrm.org/jira/browse/CRM-15427

CRM/Event/Form/ManageEvent/Registration.php
templates/CRM/Event/Form/ManageEvent/Registration.tpl

index a299d81223c6750fa4ee4b318d7050ac32ab5086..cdf24e26bb2c6ed9f15568c70b85b67743a0c538 100644 (file)
@@ -931,7 +931,7 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent
       if (!empty($params['additional_custom_post_id_multiple'])) {
         $additionalPostMultiple = array();
         foreach ($params['additional_custom_post_id_multiple'] as $key => $value) {
-          if (!$value && !empty($params['custom_post_id'])) {
+          if (is_null($value) && !empty($params['custom_post_id'])) {
             $additionalPostMultiple[$key] = $params['custom_post_id'];
           }
           elseif ($value == 'none') {
index 579c72a1c1063eaded3eba09f82e2fa6d4dfc616..cf7cb0757dbe654727aa782838071090212258e6 100644 (file)
@@ -161,12 +161,19 @@ class="crm-hover-button crm-button-add-profile"><span
               class='crm-event-manage-registration-form-block-custom_post_multiple'>
             <td scope="row" class="label" width="20%">{$form.custom_post_id_multiple.$profilePostNum.label}</td>
             <td>{$form.custom_post_id_multiple.$profilePostNum.html}
-              &nbsp;<span class='profile_bottom_link_remove'><a href="#"
-                                                                class="crm-hover-button crm-button-rem-profile"><span
-                    class="icon ui-icon-trash"></span>{ts}remove profile{/ts}</a></span>
-                              &nbsp;&nbsp;
-                <span class='profile_bottom_link'{if !$smarty.foreach.profilePostIdName.last} style="display: none"{/if}><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>
+              &nbsp;
+              <span class='profile_bottom_link_remove'>
+                <a href="#" class="crm-hover-button crm-button-rem-profile">
+                  <span class="icon ui-icon-trash"></span>{ts}remove profile{/ts}
+                </a>
+              </span>
+              &nbsp;&nbsp;
+              <span class='profile_bottom_link' {if !$smarty.foreach.profilePostIdName.last} style="display: none"{/if}>
+                <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="profile-links"></span>
             </td>
           </tr>
@@ -201,15 +208,18 @@ class="crm-hover-button crm-button-add-profile"><span
             <td scope="row" class="label"
                 width="20%">{$form.additional_custom_post_id_multiple.$profilePostNumA.label}</td>
             <td>{$form.additional_custom_post_id_multiple.$profilePostNumA.html}
-              &nbsp;<span class='profile_bottom_add_link_remove'><a href="#"
-                                                                    class="crm-hover-button crm-button-rem-profile"><span
-                    class="icon ui-icon-trash"></span>{ts}remove profile{/ts}</a></span>
-              {if $smarty.foreach.profilePostIdAName.last}
-                &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 another profile (bottom of page){/ts}</a></span>
-              {/if}
+              &nbsp;
+              <span class='profile_bottom_add_link_remove'>
+                <a href="#" class="crm-hover-button crm-button-rem-profile">
+                  <span class="icon ui-icon-trash"></span>{ts}remove profile{/ts}
+                </a>
+              </span>
+              <span class='profile_bottom_add_link' {if !$smarty.foreach.profilePostIdAName.last} style="display: none"{/if}>
+                <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="profile-links"></span>
             </td>
           </tr>
@@ -437,7 +447,7 @@ invert              = 0
         e.preventDefault();
 
         $(e.target).closest('tr').hide().find('.crm-profile-selector').val('');
-        $(e.target).closest('tbody').find('tr:visible:last .profile_bottom_link_main, tr:visible:last .profile_bottom_link, tr:visible:last .profile_bottom_add_link_main').show();
+        $(e.target).closest('tbody').find('tr:visible:last .profile_bottom_link_main,tr:visible:last .profile_bottom_add_link, tr:visible:last .profile_bottom_link, tr:visible:last .profile_bottom_add_link_main').show();
     }
 
     var strSameAs = ' - '+ts('same as for main contact')+' - ';