/**
* Function to set variables up before form is built
*
+ * @param $form
+ *
* @return void
* @access static
*/
}
$softCreditTypes = CRM_Core_OptionGroup::values("soft_credit_type", FALSE);
- $extraOption = array('onclick' => "enableHonorType();");
// radio button for Honor Type
foreach ($jsonData['soft_credit_types'] as $value) {
- $honorTypes[$value] = $form->createElement('radio', NULL, NULL, $softCreditTypes[$value], $value, $extraOption);
+ $honorTypes[$value] = $form->createElement('radio', NULL, NULL, $softCreditTypes[$value], $value);
}
- $form->addGroup($honorTypes, 'soft_credit_type_id', NULL);
+ $form->addGroup($honorTypes, 'soft_credit_type_id', NULL)->setAttribute('allowClear', TRUE);
}
}
return $form;
if ($form->getAction() & CRM_Core_Action::UPDATE) {
$form->_softCreditInfo = CRM_Contribute_BAO_ContributionSoft::getSoftContribution($form->_id, TRUE);
}
- elseif ($form->_pledgeID) {
+ elseif (property_exists($form, "_pledgeID")) {
//Check and select most recent completed contrubtion and use it to retrieve
//soft-credit information to use as default for current pledge payment, CRM-13981
$pledgePayments = CRM_Pledge_BAO_PledgePayment::getPledgePayments($form->_pledgeID);
/**
* global form rule
*
- * @param array $fields the input form values
+ * @param array $fields the input form values
+ *
+ * @param $errors
+ * @param $self
*
- * @return true if no errors, else array of errors
+ * @return array of errors
* @access public
* @static
*/