class CRM_Batch_Form_Entry extends CRM_Core_Form {
/**
- * Maximum profile fields that will be displayed
+ * Maximum profile fields that will be displayed.
*/
protected $_rowCount = 1;
/**
- * Batch id
+ * Batch id.
*/
protected $_batchId;
/**
- * Batch information
+ * Batch information.
*/
protected $_batchInfo = array();
/**
- * Store the profile id associated with the batch type
+ * Store the profile id associated with the batch type.
*/
protected $_profileId;
public $_membershipId = NULL;
/**
- * When not to reset sort_name
+ * When not to reset sort_name.
*/
protected $_preserveDefault = TRUE;
/**
- * Contact fields
+ * Contact fields.
*/
protected $_contactFields = array();
/**
- * Fields array of fields in the batch profile
+ * Fields array of fields in the batch profile.
* (based on the uf_field table data)
* (this can't be protected as it is passed into the CRM_Contact_Form_Task_Batch::parseStreetAddress function
* (although a future refactoring might hopefully change that so it uses the api & the function is not
public $_fields = array();
/**
- * Build all the data structures needed to build the form
+ * Build all the data structures needed to build the form.
*
* @return void
*/
}
/**
- * Build the form object
+ * Build the form object.
*
*
* @return void
for ($rowNumber = 1; $rowNumber <= $this->_batchInfo['item_count']; $rowNumber++) {
$this->addEntityRef("primary_contact_id[{$rowNumber}]", '', array(
'create' => TRUE,
- 'placeholder' => ts('- select -')
+ 'placeholder' => ts('- select -'),
));
// special field specific to membership batch udpate
'contact' => array(
'return' => implode(',', $contactReturnProperties),
'fieldmap' => array_flip($contactReturnProperties),
- )
+ ),
));
// don't set the status message when form is submitted.
}
/**
- * Form validations
+ * Form validations.
*
* @param array $params
* Posted values of the form.
*
* @return array
* list of errors to be posted back to the form
- * @static
*/
public static function formRule($params, $files, $self) {
$errors = array();
}
/**
- * Override default cancel action
+ * Override default cancel action.
*/
public function cancelAction() {
// redirect to batch listing
}
/**
- * Process the form after the input has been submitted and validated
+ * Process the form after the input has been submitted and validated.
*
*
* @return void
}
/**
- * Process contribution records
+ * Process contribution records.
*
* @param array $params
* Associated array of submitted values.
}
/**
- * Process membership records
+ * Process membership records.
*
* @param array $params
* Associated array of submitted values.
);
// make contribution entry
- CRM_Member_BAO_Membership::recordMembershipContribution(array_merge($value, array('membership_id' => $membership->id)));
+ $contrbutionParams = array_merge($value, array('membership_id' => $membership->id));
+ CRM_Member_BAO_Membership::recordMembershipContribution($contrbutionParams);
}
else {
$membership = CRM_Member_BAO_Membership::create($value, CRM_Core_DAO::$_nullArray);
}
/**
- * Update contact information
+ * Update contact information.
*
* @param array $value
* Associated array of submitted values.
public function testProcessContribution($params) {
return $this->processContribution($params);
}
+
}