projects
/
civicrm-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
further comment fixes
[civicrm-core.git]
/
CRM
/
Batch
/
Form
/
Entry.php
diff --git
a/CRM/Batch/Form/Entry.php
b/CRM/Batch/Form/Entry.php
index 9baf89a4fd65cfbf1fbbb738fb050d2782c01507..73f5610b807a7a445740354d51d30be4670105db 100755
(executable)
--- a/
CRM/Batch/Form/Entry.php
+++ b/
CRM/Batch/Form/Entry.php
@@
-1,7
+1,7
@@
<?php
/*
+--------------------------------------------------------------------+
<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.
6
|
+ | CiviCRM version 4.
7
|
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
@@
-29,12
+29,10
@@
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2015
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
- *
*/
/**
*/
/**
- * This class provides the functionality for batch entry for contributions/memberships
+ * This class provides the functionality for batch entry for contributions/memberships
.
*/
class CRM_Batch_Form_Entry extends CRM_Core_Form {
*/
class CRM_Batch_Form_Entry extends CRM_Core_Form {
@@
-86,8
+84,6
@@
class CRM_Batch_Form_Entry extends CRM_Core_Form {
/**
* Build all the data structures needed to build the form.
/**
* Build all the data structures needed to build the form.
- *
- * @return void
*/
public function preProcess() {
$this->_batchId = CRM_Utils_Request::retrieve('id', 'Positive', $this, TRUE);
*/
public function preProcess() {
$this->_batchId = CRM_Utils_Request::retrieve('id', 'Positive', $this, TRUE);
@@
-114,9
+110,6
@@
class CRM_Batch_Form_Entry extends CRM_Core_Form {
/**
* Build the form object.
/**
* Build the form object.
- *
- *
- * @return void
*/
public function buildQuickForm() {
if (!$this->_profileId) {
*/
public function buildQuickForm() {
if (!$this->_profileId) {
@@
-280,9
+273,9
@@
class CRM_Batch_Form_Entry extends CRM_Core_Form {
$errors = array();
$batchTypes = CRM_Core_Pseudoconstant::get('CRM_Batch_DAO_Batch', 'type_id', array('flip' => 1), 'validate');
$fields = array(
$errors = array();
$batchTypes = CRM_Core_Pseudoconstant::get('CRM_Batch_DAO_Batch', 'type_id', array('flip' => 1), 'validate');
$fields = array(
- 'total_amount' =>
'Amount'
,
- 'financial_type' =>
'Financial Type'
,
- 'payment_instrument' =>
'Paid By'
,
+ 'total_amount' =>
ts('Amount')
,
+ 'financial_type' =>
ts('Financial Type')
,
+ 'payment_instrument' =>
ts('Payment Method')
,
);
//CRM-16480 if contact is selected, validate financial type and amount field.
);
//CRM-16480 if contact is selected, validate financial type and amount field.
@@
-356,9
+349,6
@@
class CRM_Batch_Form_Entry extends CRM_Core_Form {
/**
* Set default values for the form.
/**
* Set default values for the form.
- *
- *
- * @return void
*/
public function setDefaultValues() {
if (empty($this->_fields)) {
*/
public function setDefaultValues() {
if (empty($this->_fields)) {
@@
-397,9
+387,6
@@
class CRM_Batch_Form_Entry extends CRM_Core_Form {
/**
* Process the form after the input has been submitted and validated.
/**
* Process the form after the input has been submitted and validated.
- *
- *
- * @return void
*/
public function postProcess() {
$params = $this->controller->exportValues($this->_name);
*/
public function postProcess() {
$params = $this->controller->exportValues($this->_name);
@@
-436,8
+423,7
@@
class CRM_Batch_Form_Entry extends CRM_Core_Form {
* @param array $params
* Associated array of submitted values.
*
* @param array $params
* Associated array of submitted values.
*
- *
- * @return void
+ * @return bool
*/
private function processContribution(&$params) {
$dates = array(
*/
private function processContribution(&$params) {
$dates = array(
@@
-622,7
+608,7
@@
class CRM_Batch_Form_Entry extends CRM_Core_Form {
'reminder_date',
);
'reminder_date',
);
- // get the price set associated with offline mem
e
bership
+ // get the price set associated with offline membership
$priceSetId = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', 'default_membership_type_amount', 'id', 'name');
$this->_priceSet = $priceSets = current(CRM_Price_BAO_PriceSet::getSetDetail($priceSetId));
$priceSetId = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', 'default_membership_type_amount', 'id', 'name');
$this->_priceSet = $priceSets = current(CRM_Price_BAO_PriceSet::getSetDetail($priceSetId));
@@
-807,6
+793,8
@@
class CRM_Batch_Form_Entry extends CRM_Core_Form {
// make contribution entry
$contrbutionParams = array_merge($value, array('membership_id' => $membership->id));
// make contribution entry
$contrbutionParams = array_merge($value, array('membership_id' => $membership->id));
+ // @todo - calling this from here is pretty hacky since it is called from membership.create anyway
+ // This form should set the correct params & not call this fn directly.
CRM_Member_BAO_Membership::recordMembershipContribution($contrbutionParams);
}
else {
CRM_Member_BAO_Membership::recordMembershipContribution($contrbutionParams);
}
else {
@@
-857,9
+845,6
@@
class CRM_Batch_Form_Entry extends CRM_Core_Form {
*
* @param array $value
* Associated array of submitted values.
*
* @param array $value
* Associated array of submitted values.
- *
- *
- * @return void
*/
private function updateContactInfo(&$value) {
$value['preserveDBName'] = $this->_preserveDefault;
*/
private function updateContactInfo(&$value) {
$value['preserveDBName'] = $this->_preserveDefault;
@@
-873,9
+858,10
@@
class CRM_Batch_Form_Entry extends CRM_Core_Form {
}
/**
}
/**
- * Function exists purely for unit testing purposes. If you feel tempted to use this in live code
- * then it probably means there is some functionality that needs to be moved
- * out of the form layer
+ * Function exists purely for unit testing purposes.
+ *
+ * If you feel tempted to use this in live code then it probably means there is some functionality
+ * that needs to be moved out of the form layer
*
* @param array $params
*
*
* @param array $params
*
@@
-886,9
+872,10
@@
class CRM_Batch_Form_Entry extends CRM_Core_Form {
}
/**
}
/**
- * Function exists purely for unit testing purposes. If you feel tempted to use this in live code
- * then it probably means there is some functionality that needs to be moved
- * out of the form layer
+ * Function exists purely for unit testing purposes.
+ *
+ * If you feel tempted to use this in live code then it probably means there is some functionality
+ * that needs to be moved out of the form layer.
*
* @param array $params
*
*
* @param array $params
*