option to configure confirm screen
[civicrm-core.git] / CRM / Event / Form / Registration / Register.php
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' => '         ',
             '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);
       }
     }