$batch = new CRM_Batch_DAO_Batch();
$batch->id = $batchId;
$batch->delete();
- return true;
+ return TRUE;
}
/**
// get batch totals for open batches
$fetchTotals = array();
- $batchStatus = CRM_Core_PseudoConstant::get('CRM_Batch_DAO_Batch', 'status_id', array('labelColumn' => 'name'));
+ $batchStatus = CRM_Core_PseudoConstant::get('CRM_Batch_DAO_Batch', 'status_id', array('labelColumn' => 'name'));
$batchStatus = array(
array_search('Open', $batchStatus),
array_search('Reopened', $batchStatus),
case 'Open':
CRM_Utils_Array::remove($newLinks, 'reopen', 'download');
break;
+
case 'Closed':
CRM_Utils_Array::remove($newLinks, 'close', 'edit', 'download');
break;
+
case 'Exported':
CRM_Utils_Array::remove($newLinks, 'close', 'edit', 'reopen', 'export');
}
}
$tokens = array('id' => $object->id, 'status' => $values['status_id']);
if ($values['status_id'] == array_search('Exported', $batchStatusByName)) {
- $aid = CRM_Core_OptionGroup::getValue('activity_type','Export Accounting Batch');
+ $aid = CRM_Core_OptionGroup::getValue('activity_type', 'Export Accounting Batch');
$activityParams = array('source_record_id' => $object->id, 'activity_type_id' => $aid);
$exportActivity = CRM_Activity_BAO_Activity::retrieve($activityParams, $val);
$fid = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_EntityFile', $exportActivity->id, 'file_id', 'entity_id');
public function links($context = NULL) {
if ($context == 'financialBatch') {
$links = array(
- 'transaction' => array(
+ 'transaction' => array(
'name' => ts('Transactions'),
'url' => 'civicrm/batchtransaction',
'qs' => 'reset=1&bid=%%id%%',
'title' => ts('View/Add Transactions to Batch'),
),
- 'edit' => array(
+ 'edit' => array(
'name' => ts('Edit'),
'url' => 'civicrm/financial/batch',
'qs' => 'reset=1&action=update&id=%%id%%&context=1',
'title' => ts('Edit Batch'),
),
- 'close' => array(
+ 'close' => array(
'name' => ts('Close'),
'title' => ts('Close Batch'),
'url' => '#',
'extra' => 'rel="close"',
),
- 'export' => array(
+ 'export' => array(
'name' => ts('Export'),
'title' => ts('Export Batch'),
'url' => '#',
'extra' => 'rel="export"',
),
- 'reopen' => array(
+ 'reopen' => array(
'name' => ts('Re-open'),
'title' => ts('Re-open Batch'),
'url' => '#',
'extra' => 'rel="reopen"',
),
- 'delete' => array(
+ 'delete' => array(
'name' => ts('Delete'),
'title' => ts('Delete Batch'),
'url' => '#',
* excluding batches with data entry in progress
*/
public static function getBatches() {
- $dataEntryStatusId = CRM_Core_OptionGroup::getValue('batch_status','Data Entry', 'name');
+ $dataEntryStatusId = CRM_Core_OptionGroup::getValue('batch_status', 'Data Entry', 'name');
$query = "SELECT id, title
FROM civicrm_batch
WHERE item_count >= 1
$params['id'] = $ids['batchID'] = $value;
self::create($params, $ids);
}
- $url = CRM_Utils_System::url('civicrm/financial/financialbatches',"reset=1&batchStatus={$params['status_id']}");
+ $url = CRM_Utils_System::url('civicrm/financial/financialbatches', "reset=1&batchStatus={$params['status_id']}");
CRM_Utils_System::redirect($url);
}
$query = new CRM_Contact_BAO_Query($searchParams,
CRM_Contribute_BAO_Query::defaultReturnProperties(CRM_Contact_BAO_Query::MODE_CONTRIBUTE,
FALSE
- ),NULL, FALSE, FALSE,CRM_Contact_BAO_Query::MODE_CONTRIBUTE
+ ), NULL, FALSE, FALSE, CRM_Contact_BAO_Query::MODE_CONTRIBUTE
);
if ($field == 'contribution_date_high' || $field == 'contribution_date_low') {
$query->dateQueryBuilder($params[$field], 'civicrm_contribution', 'contribution_date', 'receive_date', 'Contribution Date');
if (!$searchValue) {
if (!$notPresent) {
- $where = " ( civicrm_entity_batch.batch_id = {$entityID}
+ $where = " ( civicrm_entity_batch.batch_id = {$entityID}
AND civicrm_entity_batch.entity_table = 'civicrm_financial_trxn'
AND civicrm_entity_financial_trxn.entity_table = 'civicrm_contribution') ";
}
}
// always create with data entry status
- $params['status_id'] = CRM_Core_OptionGroup::getValue('batch_status','Data Entry', 'name');
+ $params['status_id'] = CRM_Core_OptionGroup::getValue('batch_status', 'Data Entry', 'name');
$batch = CRM_Batch_BAO_Batch::create($params);
// redirect to batch entry page.
public $_params;
- public $_membershipId = null;
+ public $_membershipId = NULL;
/**
* When not to reset sort_name
*/
$this->addElement('hidden', 'batch_id', $this->_batchId);
- $batchTypes = CRM_Core_Pseudoconstant::get('CRM_Batch_DAO_Batch', 'type_id',array('flip' => 1), 'validate');
+ $batchTypes = CRM_Core_Pseudoconstant::get('CRM_Batch_DAO_Batch', 'type_id', array('flip' => 1), 'validate');
// 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']) {
+ elseif ($this->_batchInfo['type_id'] == $batchTypes['Membership']) {
CRM_Utils_System::setTitle(ts('Batch Data Entry for Memberships'));
$customFields = CRM_Core_BAO_CustomField::getFields('Membership');
}
- elseif ($this->_batchInfo['type_id'] == $batchTypes['Pledge Payment']) {
- CRM_Utils_System::setTitle(ts('Batch Data Entry for Pledge Payments'));
- $customFields = CRM_Core_BAO_CustomField::getFields('Contribution');
- }
+ elseif ($this->_batchInfo['type_id'] == $batchTypes['Pledge Payment']) {
+ CRM_Utils_System::setTitle(ts('Batch Data Entry for Pledge Payments'));
+ $customFields = CRM_Core_BAO_CustomField::getFields('Contribution');
+ }
$this->_fields = array();
$this->_fields = CRM_Core_BAO_UFGroup::getFields($this->_profileId, FALSE, CRM_Core_Action::VIEW);
$this->add('select', "member_option[$rowNumber]", '', $options);
}
if ($this->_batchInfo['type_id'] == $batchTypes['Pledge Payment']) {
- $options = array('' => '-select-');
+ $options = array('' => '-select-');
$optionTypes = array(
'1' => ts('Adjust Pledge Payment Schedule?'),
'2' => ts('Adjust Total Pledge Amount?'),
}
$this->add('select', "open_pledges[$rowNumber]", '', $options);
- }
+ }
foreach ($this->_fields as $name => $field) {
if (in_array($field['field_type'], $contactTypes)) {
$this->assign('fields', $this->_fields);
CRM_Core_Resources::singleton()
- ->addSetting(array('contact' => array(
+ ->addSetting(array(
+ 'contact' => array(
'return' => implode(',', $contactReturnProperties),
'fieldmap' => array_flip($contactReturnProperties),
)));
$value['skipRecentView'] = TRUE;
// build line item params
- $this->_priceSet['fields'][$priceFieldID]['options'][$priceFieldValueID ]['amount'] = $value['total_amount'];
+ $this->_priceSet['fields'][$priceFieldID]['options'][$priceFieldValueID]['amount'] = $value['total_amount'];
$value['price_'. $priceFieldID] = 1;
$lineItem = array();
//send receipt mail.
if ($contribution->id && !empty($value['send_receipt'])) {
- // add the domain email id
- $domainEmail = CRM_Core_BAO_Domain::getNameAndEmail();
- $domainEmail = "$domainEmail[0] <$domainEmail[1]>";
- $value['from_email_address'] = $domainEmail;
- $value['contribution_id'] = $contribution->id;
- CRM_Contribute_Form_AdditionalInfo::emailReceipt( $this, $value );
+ // add the domain email id
+ $domainEmail = CRM_Core_BAO_Domain::getNameAndEmail();
+ $domainEmail = "$domainEmail[0] <$domainEmail[1]>";
+ $value['from_email_address'] = $domainEmail;
+ $value['contribution_id'] = $contribution->id;
+ CRM_Contribute_Form_AdditionalInfo::emailReceipt( $this, $value );
}
}
}
}
if (!empty($value['receive_date'])) {
- $value['receive_date'] = CRM_Utils_Date::processDate( $value['receive_date'], $value['receive_date_time'] , TRUE );
+ $value['receive_date'] = CRM_Utils_Date::processDate( $value['receive_date'], $value['receive_date_time'], TRUE );
}
$params['actualBatchTotal'] += $value['total_amount'];
unset($value['membership_start_date']);
unset($value['membership_end_date']);
- $value['is_renew'] = false;
+ $value['is_renew'] = FALSE;
if (!empty($params['member_option']) && CRM_Utils_Array::value( $key, $params['member_option'] ) == 2 ) {
$this->_params = $params;
- $value['is_renew'] = true;
+ $value['is_renew'] = TRUE;
$membership = CRM_Member_BAO_Membership::renewMembershipFormWrapper(
$value['contact_id'],
$value['membership_type_id'],
//send receipt mail.
if ( $membership->id && !empty($value['send_receipt'])) {
- // add the domain email id
- $domainEmail = CRM_Core_BAO_Domain::getNameAndEmail();
- $domainEmail = "$domainEmail[0] <$domainEmail[1]>";
+ // add the domain email id
+ $domainEmail = CRM_Core_BAO_Domain::getNameAndEmail();
+ $domainEmail = "$domainEmail[0] <$domainEmail[1]>";
- $value['from_email_address'] = $domainEmail;
- $value['membership_id'] = $membership->id;
- $value['contribution_id'] = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipPayment', $membership->id, 'contribution_id', 'membership_id');
- CRM_Member_Form_Membership::emailReceipt( $this, $value, $membership );
+ $value['from_email_address'] = $domainEmail;
+ $value['membership_id'] = $membership->id;
+ $value['contribution_id'] = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipPayment', $membership->id, 'contribution_id', 'membership_id');
+ CRM_Member_Form_Membership::emailReceipt( $this, $value, $membership );
}
}
}
$rowCount =
isset($_REQUEST['iDisplayLength']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayLength'], 'Integer') : 25;
$sort =
- isset($_REQUEST['iSortCol_0']) ?
- CRM_Utils_Array::value(CRM_Utils_Type::escape($_REQUEST['iSortCol_0'], 'Integer'), $sortMapper) :
- NULL;
+ isset($_REQUEST['iSortCol_0']) ? CRM_Utils_Array::value(CRM_Utils_Type::escape($_REQUEST['iSortCol_0'], 'Integer'), $sortMapper) : NULL;
$sortOrder =
isset($_REQUEST['sSortDir_0']) ? CRM_Utils_Type::escape($_REQUEST['sSortDir_0'], 'String') : 'asc';
$context =
if ($context != 'financialBatch') {
// data entry status batches
- $params['status_id'] = CRM_Core_OptionGroup::getValue('batch_status','Data Entry', 'name');
+ $params['status_id'] = CRM_Core_OptionGroup::getValue('batch_status', 'Data Entry', 'name');
}
$params['context'] = $context;
*
* @return array (reference) of action links
*/
- public function &links() {}
+ public function &links() {
+ }
/**
* Get name of edit form
}
public function search() {
- if ($this->_action &
- (CRM_Core_Action::ADD |
+ if ($this->_action & (CRM_Core_Action::ADD |
CRM_Core_Action::UPDATE |
CRM_Core_Action::DELETE
)