/**
* Maximum profile fields that will be displayed.
+ *
* @var int
*/
protected $_rowCount = 1;
/**
* Batch id.
+ *
* @var int
*/
protected $_batchId;
/**
* Batch information.
+ *
* @var array
*/
protected $_batchInfo = [];
/**
* When not to reset sort_name.
+ *
* @var bool
*/
protected $_preserveDefault = TRUE;
/**
* Contact fields.
+ *
* @var array
*/
protected $_contactFields = [];
/**
* 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
* required
+ *
* @var array
*/
public $_fields = [];
/**
* Build all the data structures needed to build the form.
+ *
+ * @throws \CRM_Core_Exception
*/
public function preProcess() {
$this->_batchId = CRM_Utils_Request::retrieve('id', 'Positive', $this, TRUE);
/**
* Build the form object.
+ *
+ * @throws \CRM_Core_Exception
*/
public function buildQuickForm() {
if (!$this->_profileId) {
// get the profile information
if ($this->_batchInfo['type_id'] == $batchTypes['Contribution']) {
CRM_Utils_System::setTitle(ts('Batch Data Entry for Contributions'));
- $customFields = CRM_Core_BAO_CustomField::getFields('Contribution');
}
elseif ($this->_batchInfo['type_id'] == $batchTypes['Membership']) {
CRM_Utils_System::setTitle(ts('Batch Data Entry for Memberships'));
elseif ($this->_batchInfo['type_id'] == $batchTypes['Pledge Payment']) {
CRM_Utils_System::setTitle(ts('Batch Data Entry for Pledge Payments'));
}
- $this->_fields = [];
+
$this->_fields = CRM_Core_BAO_UFGroup::getFields($this->_profileId, FALSE, CRM_Core_Action::VIEW);
// remove file type field and then limit fields
/**
* Set default values for the form.
+ *
+ * @throws \CRM_Core_Exception
*/
public function setDefaultValues() {
if (empty($this->_fields)) {
/**
* Process the form after the input has been submitted and validated.
+ *
+ * @throws \CRM_Core_Exception
+ * @throws \CiviCRM_API3_Exception
*/
public function postProcess() {
$params = $this->controller->exportValues($this->_name);
* Associated array of submitted values.
*
* @return bool
+ *
+ * @throws \CRM_Core_Exception
+ * @throws \CiviCRM_API3_Exception
*/
private function processContribution(&$params) {
* @param array $params
*
* @return bool
+ *
+ * @throws \CRM_Core_Exception
+ * @throws \CiviCRM_API3_Exception
*/
public function testProcessContribution($params) {
return $this->processContribution($params);