<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
class CRM_Contribute_Form_SoftCredit {
/**
- * Function to set variables up before form is built
+ * Set variables up before form is built
*
- * @param $form
+ * @param CRM_Core_Form $form
*
* @return void
- * @access static
*/
- static function preProcess(&$form) {
+ public static function preProcess(&$form) {
$contriDAO = new CRM_Contribute_DAO_Contribution();
$contriDAO->id = $form->_id;
$contriDAO->find(TRUE);
* Function used to build form element for soft credit block
*
* @param CRM_Core_Form $form
- * @access public
*
* @return void
*/
- static function buildQuickForm(&$form) {
+ public static function buildQuickForm(&$form) {
if ($form->_mode == 'live' && !empty($form->_honor_block_is_active)) {
$ufJoinDAO = new CRM_Core_DAO_UFJoin();
$ufJoinDAO->module = 'soft_credit';
$form->addGroup($honorTypes, 'soft_credit_type_id', NULL)->setAttribute('allowClear', TRUE);
}
}
- return $form;
+ return $form;
}
// by default generate 5 blocks
if ($form->getAction() & CRM_Core_Action::UPDATE) {
$form->_softCreditInfo = CRM_Contribute_BAO_ContributionSoft::getSoftContribution($form->_id, TRUE);
}
- elseif (property_exists($form, "_pledgeID")) {
+ elseif (!empty($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);
/**
* Function used to set defaults for soft credit block
+ *
+ * @param $defaults
+ * @param $form
*/
- static function setDefaultValues(&$defaults, &$form) {
+ public static function setDefaultValues(&$defaults, &$form) {
//Used to hide/unhide PCP and/or Soft-credit Panes
$noPCP = $noSoftCredit = TRUE;
if (!empty($form->_softCreditInfo['soft_credit'])) {
}
/**
- * global form rule
+ * Global form rule
*
- * @param array $fields the input form values
+ * @param array $fields
+ * The input form values.
*
* @param $errors
* @param $self
*
* @return array of errors
- * @access public
* @static
*/
- static function formRule($fields, $errors, $self) {
+ public static function formRule($fields, $errors, $self) {
$errors = array();
// if honor roll fields are populated but no PCP is selected
return $errors;
}
}
-