Merge remote-tracking branch 'origin/abtest' into master-abtest
[civicrm-core.git] / CRM / Event / Form / ManageEvent / Fee.php
index c8678770af87c9f3942d4cc7c30f99389f43b296..bfe253f22c85610899840007d190c5a8f538dbae 100644 (file)
@@ -288,6 +288,7 @@ class CRM_Event_Form_ManageEvent_Fee extends CRM_Event_Form_ManageEvent {
     );
     $this->addWysiwyg('pay_later_receipt', ts('Pay Later Instructions'), CRM_Core_DAO::getAttribute('CRM_Event_DAO_Event', 'pay_later_receipt'));
 
+    $this->addElement('checkbox', 'is_billing_required', ts('Is billing block required'));
     $this->add('text', 'fee_label', ts('Fee Label'));
 
     $price = CRM_Price_BAO_PriceSet::getAssoc(FALSE, 'CiviEvent');
@@ -577,6 +578,7 @@ class CRM_Event_Form_ManageEvent_Fee extends CRM_Event_Form_ManageEvent {
     }
 
     $params['is_pay_later'] = CRM_Utils_Array::value('is_pay_later', $params, 0);
+    $params['is_billing_required'] = CRM_Utils_Array::value('is_billing_required', $params, 0);
 
     if ($this->_id) {
 
@@ -791,6 +793,12 @@ class CRM_Event_Form_ManageEvent_Fee extends CRM_Event_Form_ManageEvent {
       }
       $params['financial_type_id'] = '';
       $params['is_pay_later'] = 0;
+      $params['is_billing_required'] = 0;
+    }
+
+    //update 'is_billing_required'
+    if (empty($params['is_pay_later'])) {
+      $params['is_billing_required'] = False;
     }
 
     //update events table