option to configure confirm screen
authoryashodha <yashodha.chaku@webaccess.co.in>
Fri, 2 May 2014 01:24:14 +0000 (06:54 +0530)
committeryashodha <yashodha.chaku@webaccess.co.in>
Fri, 2 May 2014 01:24:14 +0000 (06:54 +0530)
CRM/Event/Form/ManageEvent/Fee.php
CRM/Event/Form/ManageEvent/Registration.php
CRM/Event/Form/Registration/AdditionalParticipant.php
CRM/Event/Form/Registration/Confirm.php
CRM/Event/Form/Registration/Register.php
CRM/Event/StateMachine/Registration.php
CRM/Upgrade/Incremental/sql/4.5.alpha1.mysql.tpl
templates/CRM/Event/Form/ManageEvent/Registration.tpl
xml/schema/Event/Event.xml

index 56d40187b2d2bcfe5a17fd30ff279529f2194ccf..4747b045692026155bede96015f63c33064dabfe 100644 (file)
@@ -789,7 +789,7 @@ class CRM_Event_Form_ManageEvent_Fee extends CRM_Event_Form_ManageEvent {
     $params['id'] = $this->_id;
     // skip update of financial type in price set
     $params['skipFinancialType'] = TRUE;
-    
+    $params['is_confirm_enabled'] = $params['is_monetary'];
     CRM_Event_BAO_Event::add($params);
 
     // Update tab "disabled" css class
index dc7df5b96266a22a015d493dd37a81c7ad409d19..02e2b7b33725042dc13a41119abfcdeb7d35fc65 100644 (file)
@@ -379,6 +379,10 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent
    */
   function buildConfirmationBlock(&$form) {
     $attributes = CRM_Core_DAO::getAttribute('CRM_Event_DAO_Event');
+    
+    // CRM-11182 - Optional confirmation page for free events
+    $form->addYesNo('is_confirm_enabled', ts('Use a confirmation screen?'), NULL, NULL, array('onclick' => "return showHideByValue('is_confirm_enabled','','confirm_screen_settings','block','radio',false);"));
+
     $form->add('text', 'confirm_title', ts('Title'), $attributes['confirm_title']);
     $form->addWysiwyg('confirm_text', ts('Introductory Text'), $attributes['confirm_text']);
     // FIXME: This hack forces height of editor to 175px. Need to modify QF classes for editors to allow passing
@@ -695,8 +699,9 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent
 
     $params['id'] = $this->_id;
 
-    //format params
+    // format params
     $params['is_online_registration'] = CRM_Utils_Array::value('is_online_registration', $params, FALSE);
+    $params['is_confirm_enabled'] = CRM_Utils_Array::value('is_confirm_enabled', $params, FALSE); // CRM-11182
     $params['is_multiple_registrations'] = CRM_Utils_Array::value('is_multiple_registrations', $params, FALSE);
     $params['allow_same_participant_emails'] = CRM_Utils_Array::value('allow_same_participant_emails', $params, FALSE);
     $params['requires_approval'] = CRM_Utils_Array::value('requires_approval', $params, FALSE);
index f05ca0371cf70bb953b1757a663faba44e79a899..1e7e9f8633d45be8ebed21122d30662a21f0c1fc 100644 (file)
@@ -712,8 +712,11 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R
       CRM_Core_Session::setStatus($statusMsg, ts('Registration Saved'), 'success');
     }
 
-    //to check whether call processRegistration()
-    if (!$this->_values['event']['is_monetary'] && !empty($this->_params[0]['additional_participants']) && $this->isLastParticipant()
+    // Check whether to process the registration now, calling processRegistration()
+    if (
+      !$this->_values['event']['is_confirm_enabled'] // CRM-11182 - Optional confirmation screen
+      && CRM_Utils_Array::value('additional_participants', $this->_params[0])
+      && $this->isLastParticipant()
     ) {
       CRM_Event_Form_Registration_Register::processRegistration($this->_params, NULL);
     }
index 6edd554ce0da4a814d5139ac70f44b4300b22a2c..10bb2773c930a94d49cb55eab77a691eeb52f8ad 100644 (file)
@@ -225,7 +225,10 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration {
    */
   public function buildQuickForm() {
     $this->assignToTemplate();
-    if ($this->_params[0]['amount'] || $this->_params[0]['amount'] == 0) {
+
+    if ($this->_values['event']['is_monetary'] &&
+      ($this->_params[0]['amount'] || $this->_params[0]['amount'] == 0)
+    ) {
       $this->_amount = array();
 
       foreach ($this->_params as $k => $v) {
@@ -410,7 +413,9 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration {
     $cancelledIds = $this->_additionalParticipantIds;
 
     $params = $this->_params;
-    $this->set('finalAmount', $this->_amount);
+    if ($this->_values['event']['is_monetary']) {
+      $this->set('finalAmount', $this->_amount);
+    }
     $participantCount = array();
 
     //unset the skip participant from params.
@@ -607,14 +612,17 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration {
         $value['currencyID'] = $primaryCurrencyID;
       }
 
-      if (!$pending && !empty($value['is_primary']) &&
-        !$this->_allowWaitlist && !$this->_requireApproval
-      ) {
-        // transactionID & receive date required while building email template
-        $this->assign('trxn_id', $value['trxn_id']);
-        $this->assign('receive_date', CRM_Utils_Date::mysqlToIso($value['receive_date']));
-        $this->set('receiveDate', CRM_Utils_Date::mysqlToIso($value['receive_date']));
-        $this->set('trxnId', CRM_Utils_Array::value('trxn_id', $value));
+      // CRM-11182 - Confirmation page might not be monetary
+      if ($this->_values['event']['is_monetary']) {
+        if (!$pending && !empty($value['is_primary']) &&
+          !$this->_allowWaitlist && !$this->_requireApproval
+        ) {
+          // transactionID & receive date required while building email template
+          $this->assign('trxn_id', $value['trxn_id']);
+          $this->assign('receive_date', CRM_Utils_Date::mysqlToIso($value['receive_date']));
+          $this->set('receiveDate', CRM_Utils_Date::mysqlToIso($value['receive_date']));
+          $this->set('trxnId', CRM_Utils_Array::value('trxn_id', $value));
+        }
       }
 
       $value['fee_amount'] = CRM_Utils_Array::value('amount', $value);
@@ -778,7 +786,7 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration {
           $this->assign('isPrimary', 0);
           $this->assign('customProfile', NULL);
           //Additional Participant should get only it's payment information
-          if ($this->_amount) {
+          if (!empty($this->_amount)) {
             $amount = array();
             $params = $this->get('params');
             $amount[$participantNum]['label'] = preg_replace('/\ 1/', '', $params[$participantNum]['amount_level']);
index ff605d2f5a0bbdcffafaf6c537e98615d0468aa8..3cc97a84ae0aa2f450628f60abcc417952568ed5 100644 (file)
@@ -508,10 +508,22 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration {
       if (empty($this->_values['event']['is_monetary'])) {
         $js = array('onclick' => "return submitOnce(this,'" . $this->_name . "','" . ts('Processing') . "');");
       }
+      
+      // CRM-11182 - Optional confirmation screen
+      // Change button label depending on whether the next action is confirm or register
+      if (
+        !$this->_values['event']['is_multiple_registrations']
+        && !$this->_values['event']['is_confirm_enabled']
+      ) {
+        $buttonLabel = ts('Register >>');
+      } else {
+        $buttonLabel = ts('Continue >>');
+      }
+      
       $this->addButtons(array(
           array(
             'type' => 'upload',
-            'name' => ts('Continue >>'),
+            'name' => $buttonLabel,
             'spacing' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
             'isDefault' => TRUE,
             'js' => $js,
@@ -1161,7 +1173,10 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration {
       $this->_params[] = $params;
       $this->set('params', $this->_params);
 
-      if (empty($params['additional_participants'])) {
+      if (
+        empty($params['additional_participants'])
+        && !$this->_values['event']['is_confirm_enabled'] // CRM-11182 - Optional confirmation screen
+      ) {
         self::processRegistration($this->_params);
       }
     }
index e7210d81502ba0073125e30675899128b78c913f..5a946b2020a89b0b382414398b345d1ee25328e4 100644 (file)
@@ -51,6 +51,7 @@ class CRM_Event_StateMachine_Registration extends CRM_Core_StateMachine {
     parent::__construct($controller, $action);
     $id = CRM_Utils_Request::retrieve('id', 'Positive', $controller, TRUE);
     $is_monetary = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $id, 'is_monetary');
+    $is_confirm_enabled = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $id, 'is_confirm_enabled');
 
     $pages = array('CRM_Event_Form_Registration_Register' => NULL);
 
@@ -88,8 +89,9 @@ class CRM_Event_StateMachine_Registration extends CRM_Core_StateMachine {
     );
 
     $pages = array_merge($pages, $additionalPages);
-
-    if (!$is_monetary) {
+    
+    // CRM-11182 - Optional confirmation screen
+    if (!$is_confirm_enabled) {
       unset($pages['CRM_Event_Form_Registration_Confirm']);
     }
 
index a2b62b126ec39d80cc0f4300fc5ab2a5e3bb5867..cbe6623559237b912305d1775759b07f1df19a9e 100644 (file)
@@ -368,3 +368,14 @@ DELETE FROM civicrm_option_group WHERE id = @option_group_id_case_type;
   ALTER TABLE civicrm_survey DROP title;
   ALTER TABLE civicrm_survey DROP instructions;
 {/if}
+
+-- CRM-11182 -- Make event confirmation page optional
+ ALTER TABLE civicrm_event
+   ADD COLUMN is_confirm_enabled tinyint(4) DEFAULT '1';
+
+ UPDATE civicrm_event
+   SET is_confirm_enabled = 1
+   WHERE is_monetary = 1;
+
+ UPDATE civicrm_event
+   SET is_confirm_enabled = 0
index 190f74bc3575364d8c20c4e154968ca4831fb049..bd9dea58a4ee41d79f6c376697b727dbf9ee328f 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>
-      <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/>
-            {if $addProfileBottomAdd }
-              <span class="description">{ts}Change this if you want to use a different profile for additional participants.{/ts}</span>
-            {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>
-            {/if}
-            <br/><span class="profile-links"></span>
-      </td>
-
+  <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>
+  <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/>
+    {if $addProfileBottomAdd }
+      <span
+        class="description">{ts}Change this if you want to use a different profile for additional participants.{/ts}</span>
+    {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>
+    {/if}
+    <br/><span class="profile-links"></span>
+  </td>
 {else}
 {assign var=eventID value=$id}
-<div id="help">
-{ts}If you want to provide an Online Registration page for this event, check the first box below and then complete the fields on this form.{/ts}
-{help id="id-event-reg"}
-</div>
+  <div id="help">
+    {ts}If you want to provide an Online Registration page for this event, check the first box below and then complete the fields on this form.{/ts}
+    {help id="id-event-reg"}
+  </div>
 <div class="crm-block crm-form-block crm-event-manage-registration-form-block">
 <div class="crm-submit-buttons">
 {include file="CRM/common/formButtons.tpl" location="top"}
 </div>
 
-    <div id="register">
-     <table class="form-layout">
-         <tr class="crm-event-manage-registration-form-block-is_online_registration">
-            <td class="label">{$form.is_online_registration.label}</td>
-            <td>{$form.is_online_registration.html}
-            <span class="description">{ts}Online registration enabled?{/ts}</span>
-            </td>
-         </tr>
-     </table>
-    </div>
-    <div class="spacer"></div>
-    <div id="registration_blocks">
-      <table class="form-layout-compressed">
+<div id="register">
+  <table class="form-layout">
+    <tr class="crm-event-manage-registration-form-block-is_online_registration">
+      <td class="label">{$form.is_online_registration.label}</td>
+      <td>{$form.is_online_registration.html}
+        <span class="description">{ts}Online registration enabled?{/ts}</span>
+      </td>
+    </tr>
+  </table>
+</div>
+<div class="spacer"></div>
+<div id="registration_blocks">
+<table class="form-layout-compressed">
 
-        <tr class="crm-event-manage-registration-form-block-registration_link_text">
-            <td scope="row" class="label" width="20%">{$form.registration_link_text.label} {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_event' field='registration_link_text' id=$eventID}{/if}</td>
-            <td>{$form.registration_link_text.html} {help id="id-link_text"}</td>
-        </tr>
-       {if !$isTemplate}
-        <tr class="crm-event-manage-registration-form-block-registration_start_date">
-           <td scope="row" class="label" width="20%">{$form.registration_start_date.label}</td>
-           <td>{include file="CRM/common/jcalendar.tpl" elementName=registration_start_date}</td>
-        </tr>
-        <tr class="crm-event-manage-registration-form-block-registration_end_date">
-           <td scope="row" class="label" width="20%">{$form.registration_end_date.label}</td>
-           <td>{include file="CRM/common/jcalendar.tpl" elementName=registration_end_date}</td>
-        </tr>
-       {/if}
-        <tr class="crm-event-manage-registration-form-block-is_multiple_registrations">
-            <td scope="row" class="label" width="20%">{$form.is_multiple_registrations.label}</td>
-            <td>{$form.is_multiple_registrations.html} {help id="id-allow_multiple"}</td>
-        </tr>
-        <tr class="crm-event-manage-registration-form-block-allow_same_participant_emails">
-            <td scope="row" class="label" width="20%">{$form.allow_same_participant_emails.label}</td>
-            <td>{$form.allow_same_participant_emails.html} {help id="id-allow_same_email"}</td>
-        </tr>
-        <tr class="crm-event-manage-registration-form-block-requires_approval">
-          {if $form.requires_approval}
-            <td scope="row" class="label" width="20%">{$form.requires_approval.label}</td>
-            <td>{$form.requires_approval.html} {help id="id-requires_approval"}</td>
-          {/if}
-        </tr>
-        <tr id="id-approval-text" class="crm-event-manage-registration-form-block-approval_req_text">
-          {if $form.approval_req_text}
-            <td scope="row" class="label" width="20%">{$form.approval_req_text.label} {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_event' field='approval_req_text' id=$eventID}{/if}</td>
-            <td>{$form.approval_req_text.html}</td>
-          {/if}
-        </tr>
-        <tr class="crm-event-manage-registration-form-block-expiration_time">
-            <td scope="row" class="label" width="20%">{$form.expiration_time.label}</td>
-            <td>{$form.expiration_time.html|crmAddClass:four} {help id="id-expiration_time"}</td>
-        </tr>
+  <tr class="crm-event-manage-registration-form-block-registration_link_text">
+    <td scope="row" class="label"
+        width="20%">{$form.registration_link_text.label} {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_event' field='registration_link_text' id=$eventID}{/if}</td>
+    <td>{$form.registration_link_text.html} {help id="id-link_text"}</td>
+  </tr>
+  {if !$isTemplate}
+    <tr class="crm-event-manage-registration-form-block-registration_start_date">
+      <td scope="row" class="label" width="20%">{$form.registration_start_date.label}</td>
+      <td>{include file="CRM/common/jcalendar.tpl" elementName=registration_start_date}</td>
+    </tr>
+    <tr class="crm-event-manage-registration-form-block-registration_end_date">
+      <td scope="row" class="label" width="20%">{$form.registration_end_date.label}</td>
+      <td>{include file="CRM/common/jcalendar.tpl" elementName=registration_end_date}</td>
+    </tr>
+  {/if}
+  <tr class="crm-event-manage-registration-form-block-is_multiple_registrations">
+    <td scope="row" class="label" width="20%">{$form.is_multiple_registrations.label}</td>
+    <td>{$form.is_multiple_registrations.html} {help id="id-allow_multiple"}</td>
+  </tr>
+  <tr class="crm-event-manage-registration-form-block-allow_same_participant_emails">
+    <td scope="row" class="label" width="20%">{$form.allow_same_participant_emails.label}</td>
+    <td>{$form.allow_same_participant_emails.html} {help id="id-allow_same_email"}</td>
+  </tr>
+  <tr class="crm-event-manage-registration-form-block-requires_approval">
+    {if $form.requires_approval}
+      <td scope="row" class="label" width="20%">{$form.requires_approval.label}</td>
+      <td>{$form.requires_approval.html} {help id="id-requires_approval"}</td>
+    {/if}
+  </tr>
+  <tr id="id-approval-text" class="crm-event-manage-registration-form-block-approval_req_text">
+    {if $form.approval_req_text}
+      <td scope="row" class="label"
+          width="20%">{$form.approval_req_text.label} {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_event' field='approval_req_text' id=$eventID}{/if}</td>
+      <td>{$form.approval_req_text.html}</td>
+    {/if}
+  </tr>
+  <tr class="crm-event-manage-registration-form-block-expiration_time">
+    <td scope="row" class="label" width="20%">{$form.expiration_time.label}</td>
+    <td>{$form.expiration_time.html|crmAddClass:four} {help id="id-expiration_time"}</td>
+  </tr>
+</table>
+<div class="spacer"></div>
+
+{*Registration Block*}
+<fieldset id="registration" class="crm-collapsible {if $defaultsEmpty}collapsed{/if}">
+  <legend class="collapsible-title">{ts}Registration Screen{/ts}</legend>
+  <div id="registration_screen">
+    <table class="form-layout-compressed">
+      <tr class="crm-event-manage-registration-form-block-intro_text">
+        <td scope="row" class="label"
+            width="20%">{$form.intro_text.label} {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_event' field='intro_text' id=$eventID}{/if}</td>
+        <td>{$form.intro_text.html}
+          <div
+            class="description">{ts}Introductory message / instructions for online event registration page (may include HTML formatting tags).{/ts}</div>
+        </td>
+      </tr>
+      <tr class="crm-event-manage-registration-form-block-footer_text">
+        <td scope="row" class="label"
+            width="20%">{$form.footer_text.label} {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_event' field='footer_text' id=$eventID}{/if}</td>
+        <td>{$form.footer_text.html}
+          <div class="description">{ts}Optional footer text for registration screen.{/ts}</div>
+        </td>
+      </tr>
     </table>
-    <div class="spacer"></div>
-    {*Registration Block*}
-    <fieldset id="registration" class="crm-collapsible {if $defaultsEmpty}collapsed{/if}">
-      <legend class="collapsible-title">{ts}Registration Screen{/ts}</legend>
-      <div id="registration_screen">
-      <table class= "form-layout-compressed">
-       <tr class="crm-event-manage-registration-form-block-intro_text">
-          <td scope="row" class="label" width="20%">{$form.intro_text.label} {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_event' field='intro_text' id=$eventID}{/if}</td>
-          <td>{$form.intro_text.html}
-          <div class="description">{ts}Introductory message / instructions for online event registration page (may include HTML formatting tags).{/ts}</div>
-          </td>
-       </tr>
-       <tr class="crm-event-manage-registration-form-block-footer_text">
-          <td scope="row" class="label" width="20%">{$form.footer_text.label} {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_event' field='footer_text' id=$eventID}{/if}</td>
-          <td>{$form.footer_text.html}
-          <div class="description">{ts}Optional footer text for registration screen.{/ts}</div></td>
-       </tr>
-   </table>
-    <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/>
+    <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>
+      </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>
+          <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 $profilePostMultiple}
+        {foreach from=$profilePostMultiple item=profilePostId key=profilePostNum name=profilePostIdName}
+          <tr id="custom_post_id_multiple_{$profilePostNum}_wrapper"
+              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>
+              {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>
+              {/if}
+              <br/><span class="profile-links"></span>
             </td>
+          </tr>
+        {/foreach}
+      {/if}
+    </table>
+    <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>
+          <br/><span class="profile-links"></span>
+        </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>
-          <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>
+      <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
+              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>
+          <br/><span class="profile-links"></span>
+        </td>
+      </tr>
+      {if $profilePostMultipleAdd}
+        {foreach from=$profilePostMultipleAdd item=profilePostIdA key=profilePostNumA name=profilePostIdAName}
+          <tr id='additional_custom_post_id_multiple_{$profilePostNumA}_wrapper'
+              class='crm-event-manage-registration-form-block-additional_custom_post_multiple'>
+            <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 profile{/ts}</a></span>
+              {/if}
+              <br/><span class="profile-links"></span>
             </td>
-        </tr>
+          </tr>
+        {/foreach}
+      {/if}
+    </table>
+  </div>
+</fieldset>
 
-      {if $profilePostMultiple}
-         {foreach from=$profilePostMultiple item=profilePostId key=profilePostNum name=profilePostIdName}
-        <tr id="custom_post_id_multiple_{$profilePostNum}_wrapper" 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>
-             {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>
-               {/if}
-                <br/><span class="profile-links"></span>
-         </td>
-         </tr>
-         {/foreach}
-   {/if}
+{*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>
-  <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>
-               <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 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>
-               <br/><span class="profile-links"></span>
-             </td>
-        </tr>
-  {if $profilePostMultipleAdd}
-         {foreach from=$profilePostMultipleAdd item=profilePostIdA key=profilePostNumA name=profilePostIdAName}
-       <tr id='additional_custom_post_id_multiple_{$profilePostNumA}_wrapper' class='crm-event-manage-registration-form-block-additional_custom_post_multiple'>
-               <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 profile{/ts}</a></span>
-               {/if}
-               <br/><span class="profile-links"></span>
-         </td>
-         </tr>
-         {/foreach}
-   {/if}
-        </table>
-        </div>
-  </fieldset>
 
-        {*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-confirm_title">
-              <td scope="row" class="label" width="20%">{$form.confirm_title.label} <span class="marker">*</span> {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_event' field='confirm_title' id=$eventID}{/if}</td>
-              <td>{$form.confirm_title.html}<br />
-                  <span class="description">{ts}Page title for screen where user reviews and confirms their registration information.{/ts}</span>
-              </td>
-           </tr>
-           <tr class="crm-event-manage-registration-form-block-confirm_text">
-              <td scope="row" class="label" width="20%">{$form.confirm_text.label} {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_event' field='confirm_text' id=$eventID}{/if}</td>
-              <td>{$form.confirm_text.html}
-                  <div class="description">{ts}Optional instructions / message for Confirmation screen.{/ts}</div>
-              </td>
-           </tr>
-           <tr class="crm-event-manage-registration-form-block-confirm_footer_text">
-              <td scope="row" class="label" width="20%">{$form.confirm_footer_text.label} {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_event' field='confirm_footer_text' id=$eventID}{/if}</td>
-              <td>{$form.confirm_footer_text.html}
-                 <div class="description">{ts}Optional page footer text for Confirmation screen.{/ts}</div>
-              </td>
-           </tr>
-         </table>
-       </fieldset>
+  <div id="confirm_screen_settings">
+    <table class="form-layout-compressed">
+      <tr class="crm-event-manage-registration-form-block-confirm_title">
+        <td scope="row" class="label" width="20%">{$form.confirm_title.label} <span
+            class="marker">*</span> {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_event' field='confirm_title' id=$eventID}{/if}
+        </td>
+        <td>{$form.confirm_title.html}<br/>
+                <span
+                  class="description">{ts}Page title for screen where user reviews and confirms their registration information.{/ts}</span>
+        </td>
+      </tr>
+      <tr class="crm-event-manage-registration-form-block-confirm_text">
+        <td scope="row" class="label"
+            width="20%">{$form.confirm_text.label} {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_event' field='confirm_text' id=$eventID}{/if}</td>
+        <td>{$form.confirm_text.html}
+          <div class="description">{ts}Optional instructions / message for Confirmation screen.{/ts}</div>
+        </td>
+      </tr>
+      <tr class="crm-event-manage-registration-form-block-confirm_footer_text">
+        <td scope="row" class="label"
+            width="20%">{$form.confirm_footer_text.label} {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_event' field='confirm_footer_text' id=$eventID}{/if}</td>
+        <td>{$form.confirm_footer_text.html}
+          <div class="description">{ts}Optional page footer text for Confirmation screen.{/ts}</div>
+        </td>
+      </tr>
+    </table>
+  </div>
+</fieldset>
 
-         {*ThankYou Block*}
-        <fieldset id="thankyou" class="crm-collapsible {if $defaultsEmpty}collapsed{/if}">
-        <legend class="collapsible-title">{ts}Thank-you Screen{/ts}</legend>
-         <table class= "form-layout-compressed">
-           <tr class="crm-event-manage-registration-form-block-confirm_thankyou_title">
-              <td scope="row" class="label" width="20%">{$form.thankyou_title.label} <span class="marker">*</span> {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_event' field='thankyou_title' id=$eventID}{/if}</td>
-              <td>{$form.thankyou_title.html}
-                <div class="description">{ts}Page title for registration Thank-you screen.{/ts}</div>
-            </td>
-            </tr>
-            <tr class="crm-event-manage-registration-form-block-confirm_thankyou_text">
-              <td scope="row" class="label" width="20%">{$form.thankyou_text.label} {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_event' field='thankyou_text' id=$eventID}{/if}</td>
-              <td>{$form.thankyou_text.html}
-                 <div class="description">{ts}Optional message for Thank-you screen (may include HTML formatting).{/ts}</div>
-              </td>
-            </tr>
-            <tr class="crm-event-manage-registration-form-block-confirm_thankyou_footer_text">
-              <td scope="row" class="label" width="20%">{$form.thankyou_footer_text.label} {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_event' field='thankyou_footer_text' id=$eventID}{/if}</td>
-              <td>{$form.thankyou_footer_text.html}
-                  <div class="description">{ts}Optional footer text for Thank-you screen (often used to include links to other pages/activities on your site).{/ts}</div>
-              </td>
-            </tr>
-         </table>
-       </fieldset>
+{*ThankYou Block*}
+<fieldset id="thankyou" class="crm-collapsible {if $defaultsEmpty}collapsed{/if}">
+  <legend class="collapsible-title">{ts}Thank-you Screen{/ts}</legend>
+  <table class="form-layout-compressed">
+    <tr class="crm-event-manage-registration-form-block-confirm_thankyou_title">
+      <td scope="row" class="label" width="20%">{$form.thankyou_title.label} <span
+          class="marker">*</span> {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_event' field='thankyou_title' id=$eventID}{/if}
+      </td>
+      <td>{$form.thankyou_title.html}
+        <div class="description">{ts}Page title for registration Thank-you screen.{/ts}</div>
+      </td>
+    </tr>
+    <tr class="crm-event-manage-registration-form-block-confirm_thankyou_text">
+      <td scope="row" class="label"
+          width="20%">{$form.thankyou_text.label} {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_event' field='thankyou_text' id=$eventID}{/if}</td>
+      <td>{$form.thankyou_text.html}
+        <div
+          class="description">{ts}Optional message for Thank-you screen (may include HTML formatting).{/ts}</div>
+      </td>
+    </tr>
+    <tr class="crm-event-manage-registration-form-block-confirm_thankyou_footer_text">
+      <td scope="row" class="label"
+          width="20%">{$form.thankyou_footer_text.label} {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_event' field='thankyou_footer_text' id=$eventID}{/if}</td>
+      <td>{$form.thankyou_footer_text.html}
+        <div
+          class="description">{ts}Optional footer text for Thank-you screen (often used to include links to other pages/activities on your site).{/ts}</div>
+      </td>
+    </tr>
+  </table>
+</fieldset>
 
-        {* Confirmation Email Block *}
-        <fieldset id="mail" class="crm-collapsible {if $defaultsEmpty}collapsed{/if}">
-        <legend class="collapsible-title">{ts}Confirmation Email{/ts}</legend>
-          <div>
-          <table class= "form-layout-compressed">
-            <tr class="crm-event-manage-registration-form-block-is_email_confirm">
-              <td scope="row" class="label" width="20%">{$form.is_email_confirm.label}</td>
-              <td>{$form.is_email_confirm.html}<br />
-                  <span class="description">{ts}Do you want a registration confirmation email sent automatically to the user? This email includes event date(s), location and contact information. For paid events, this email is also a receipt for their payment.{/ts}</span>
-              </td>
-            </tr>
-          </table>
-          <div id="confirmEmail">
-           <table class="form-layout-compressed">
-             <tr class="crm-event-manage-registration-form-block-confirm_email_text">
-               <td scope="row" class="label" width="20%">{$form.confirm_email_text.label} {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_event' field='confirm_email_text' id=$eventID}{/if}</td>
-               <td>{$form.confirm_email_text.html}<br />
-                   <span class="description">{ts}Additional message or instructions to include in confirmation email.{/ts}</span>
-               </td>
-             </tr>
-             <tr class="crm-event-manage-registration-form-block-confirm_from_name">
-               <td scope="row" class="label" width="20%">{$form.confirm_from_name.label} <span class="marker">*</span> {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_event' field='confirm_from_name' id=$eventID}{/if}</td>
-               <td>{$form.confirm_from_name.html}<br />
-                   <span class="description">{ts}FROM name for email.{/ts}</span>
-               </td>
-             </tr>
-             <tr class="crm-event-manage-registration-form-block-confirm_from_email">
-               <td scope="row" class="label" width="20%">{$form.confirm_from_email.label} <span class="marker">*</span></td>
-               <td>{$form.confirm_from_email.html}<br />
-                   <span class="description">{ts}FROM email address (this must be a valid email account with your SMTP email service provider).{/ts}</span>
-               </td>
-             </tr>
-             <tr class="crm-event-manage-registration-form-block-cc_confirm">
-               <td scope="row" class="label" width="20%">{$form.cc_confirm.label}</td>
-               <td>{$form.cc_confirm.html}<br />
-                    <span class="description">{ts}You can notify event organizers of each online registration by specifying one or more email addresses to receive a carbon copy (cc). Multiple email addresses should be separated by a comma (e.g. jane@example.org, paula@example.org).{/ts}</span>
-               </td>
-             </tr>
-              <tr class="crm-event-manage-registration-form-block-bcc_confirm">
-               <td scope="row" class="label" width="20%">{$form.bcc_confirm.label}</td>
-               <td>{$form.bcc_confirm.html}<br />
-                  <span class="description">{ts}You may specify one or more email addresses to receive a blind carbon copy (bcc) of the confirmation email. Multiple email addresses should be separated by a comma (e.g. jane@example.org, paula@example.org).{/ts}</span>
-               </td>
-             </tr>
-           </table>
-        </div>
-      </div>
-     </fieldset>
-    </div> {*end of div registration_blocks*}
+{* Confirmation Email Block *}
+<fieldset id="mail" class="crm-collapsible {if $defaultsEmpty}collapsed{/if}">
+  <legend class="collapsible-title">{ts}Confirmation Email{/ts}</legend>
+  <div>
+    <table class="form-layout-compressed">
+      <tr class="crm-event-manage-registration-form-block-is_email_confirm">
+        <td scope="row" class="label" width="20%">{$form.is_email_confirm.label}</td>
+        <td>{$form.is_email_confirm.html}<br/>
+          <span
+            class="description">{ts}Do you want a registration confirmation email sent automatically to the user? This email includes event date(s), location and contact information. For paid events, this email is also a receipt for their payment.{/ts}</span>
+        </td>
+      </tr>
+    </table>
+    <div id="confirmEmail">
+      <table class="form-layout-compressed">
+        <tr class="crm-event-manage-registration-form-block-confirm_email_text">
+          <td scope="row" class="label"
+              width="20%">{$form.confirm_email_text.label} {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_event' field='confirm_email_text' id=$eventID}{/if}</td>
+          <td>{$form.confirm_email_text.html}<br/>
+            <span
+              class="description">{ts}Additional message or instructions to include in confirmation email.{/ts}</span>
+          </td>
+        </tr>
+        <tr class="crm-event-manage-registration-form-block-confirm_from_name">
+          <td scope="row" class="label" width="20%">{$form.confirm_from_name.label} <span
+              class="marker">*</span> {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_event' field='confirm_from_name' id=$eventID}{/if}
+          </td>
+          <td>{$form.confirm_from_name.html}<br/>
+            <span class="description">{ts}FROM name for email.{/ts}</span>
+          </td>
+        </tr>
+        <tr class="crm-event-manage-registration-form-block-confirm_from_email">
+          <td scope="row" class="label" width="20%">{$form.confirm_from_email.label} <span class="marker">*</span></td>
+          <td>{$form.confirm_from_email.html}<br/>
+            <span
+              class="description">{ts}FROM email address (this must be a valid email account with your SMTP email service provider).{/ts}</span>
+          </td>
+        </tr>
+        <tr class="crm-event-manage-registration-form-block-cc_confirm">
+          <td scope="row" class="label" width="20%">{$form.cc_confirm.label}</td>
+          <td>{$form.cc_confirm.html}<br/>
+            <span
+              class="description">{ts}You can notify event organizers of each online registration by specifying one or more email addresses to receive a carbon copy (cc). Multiple email addresses should be separated by a comma (e.g. jane@example.org, paula@example.org).{/ts}</span>
+          </td>
+        </tr>
+        <tr class="crm-event-manage-registration-form-block-bcc_confirm">
+          <td scope="row" class="label" width="20%">{$form.bcc_confirm.label}</td>
+          <td>{$form.bcc_confirm.html}<br/>
+            <span
+              class="description">{ts}You may specify one or more email addresses to receive a blind carbon copy (bcc) of the confirmation email. Multiple email addresses should be separated by a comma (e.g. jane@example.org, paula@example.org).{/ts}</span>
+          </td>
+        </tr>
+      </table>
     </div>
- <div class="crm-submit-buttons">
-      {include file="CRM/common/formButtons.tpl" location="bottom"}
- </div>
-
-{include file="CRM/common/showHide.tpl"}
+  </div>
+</fieldset>
+</div> {*end of div registration_blocks*}
+    </div>
+  <div class="crm-submit-buttons">
+    {include file="CRM/common/formButtons.tpl" location="bottom"}
+  </div>
+  {include file="CRM/common/showHide.tpl"}
 {include file="CRM/common/showHideByFieldValue.tpl"
 trigger_field_id    ="is_online_registration"
 trigger_value       =""
@@ -299,6 +360,16 @@ target_element_type ="block"
 field_type          ="radio"
 invert              = 0
 }
+
+{include file="CRM/common/showHideByFieldValue.tpl"
+trigger_field_id    ="is_confirm_enabled"
+trigger_value       =""
+target_element_id   ="confirm_screen_settings"
+target_element_type ="block"
+field_type          ="radio"
+invert              = 0
+}
+
 {include file="CRM/common/showHideByFieldValue.tpl"
 trigger_field_id    ="is_email_confirm"
 trigger_value       =""
index e0144d0a2beb5dee752b515c31008cfd81009738..fc7efaa9c2c11cf3652794fa9daaa932ee295fdf 100644 (file)
       <type>CheckBox</type>
     </html>
   </field>
+  <field>
+    <name>is_confirm_enabled</name>
+    <title>Is the booking confirmation screen enabled?</title>
+    <type>boolean</type>
+    <default>1</default>
+    <comment>If false, the event booking confirmation screen gets skipped</comment>
+    <add>4.5</add>
+    <html>
+      <type>CheckBox</type>
+    </html>
+  </field>
   <field>
     <name>parent_event_id</name>
     <type>int unsigned</type>