limit option for confirmation only for free events
authoryashodha <yashodha.chaku@webaccess.co.in>
Fri, 2 May 2014 21:23:42 +0000 (02:53 +0530)
committeryashodha <yashodha.chaku@webaccess.co.in>
Fri, 2 May 2014 21:23:42 +0000 (02:53 +0530)
CRM/Event/Form/ManageEvent/Fee.php
CRM/Event/Form/ManageEvent/Registration.php
CRM/Event/Form/Registration/AdditionalParticipant.php
CRM/Event/Form/Registration/Register.php
CRM/Event/StateMachine/Registration.php
templates/CRM/Event/Form/ManageEvent/Registration.tpl

index 4747b045692026155bede96015f63c33064dabfe..ff3b4da180806f2258a0d2146e6d05c2df0aae75 100644 (file)
@@ -789,7 +789,6 @@ 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 de33780b5d91242c6cee7b6278f07cb85c735b78..a75951228951047ca952fb6f32851dd8eb821bc0 100644 (file)
@@ -385,10 +385,13 @@ 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);"));
 
+    // CRM-11182 - Optional confirmation page for free events
+    $is_monetary = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $form->_id, 'is_monetary');
+    $form->assign('is_monetary', $is_monetary);
+    if ($is_monetary == "0") {
+      $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
index 1e7e9f8633d45be8ebed21122d30662a21f0c1fc..0050b08cc8e9030bcaec3b921a34f334ec564358 100644 (file)
@@ -715,6 +715,7 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R
     // Check whether to process the registration now, calling processRegistration()
     if (
       !$this->_values['event']['is_confirm_enabled'] // CRM-11182 - Optional confirmation screen
+      && !$this->_values['event']['is_monetary']
       && CRM_Utils_Array::value('additional_participants', $this->_params[0])
       && $this->isLastParticipant()
     ) {
index 01c295f60217aa59102645307a2b1e2c0868b2a5..e97b05344cd84dc65d09ad885eeb0136f140a9e6 100644 (file)
@@ -513,6 +513,7 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration {
       // Change button label depending on whether the next action is confirm or register
       if (
         !$this->_values['event']['is_multiple_registrations']
+        && !$this->_values['event']['is_monetary']
         && !$this->_values['event']['is_confirm_enabled']
       ) {
         $buttonLabel = ts('Register >>');
index 5a946b2020a89b0b382414398b345d1ee25328e4..521b0a0676586399f73e91917e7fa988988fe9a3 100644 (file)
@@ -91,7 +91,7 @@ class CRM_Event_StateMachine_Registration extends CRM_Core_StateMachine {
     $pages = array_merge($pages, $additionalPages);
     
     // CRM-11182 - Optional confirmation screen
-    if (!$is_confirm_enabled) {
+    if (!$is_confirm_enabled  && !$is_monetary) {
       unset($pages['CRM_Event_Form_Registration_Confirm']);
     }
 
index f5cb13bbd1415cb93043105015e64fc6bd0667f0..859eaf701c42248711f66912f3fdecc74c940573 100644 (file)
 {*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 +366,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 +375,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       =""