// skip payment stuff inedit mode
if (!isset($params['id']) || !empty($params['is_pledge_pending'])) {
-
//if pledge is pending delete all payments and recreate.
if (!empty($params['is_pledge_pending'])) {
CRM_Pledge_BAO_PledgePayment::deletePayments($pledge->id);
$pamount[] = CRM_Utils_Money::format($dao->pledge_amount, $dao->currency);
}
- $pledge_amount = array('pledge_amount' => implode(', ', $pamount),
+ $pledge_amount = array(
+ 'pledge_amount' => implode(', ', $pamount),
'pledge_count' => $pCount,
'purl' => CRM_Utils_System::url('civicrm/pledge/search',
"reset=1&force=1&pstatus={$statusId}&pstart={$start}&pend={$end}&test=0"
}
if ($count) {
- return array_merge($pledge_amount, array('received_amount' => implode(', ', $amount),
+ return array_merge($pledge_amount, array(
+ 'received_amount' => implode(', ', $amount),
'received_count' => $count,
'url' => CRM_Utils_System::url('civicrm/pledge/search',
"reset=1&force=1&status={$statusId}&start={$start}&end={$end}&test=0"
);
}
$payments[$payID] = array_merge($contributionValue,
- array('amount' => CRM_Utils_Array::value('scheduled_amount', $values),
+ array(
+ 'amount' => CRM_Utils_Array::value('scheduled_amount', $values),
'due_date' => CRM_Utils_Array::value('scheduled_date', $values),
)
);
//handle domain token values
$domain = CRM_Core_BAO_Domain::getDomain();
- $tokens = array('domain' => array('name', 'phone', 'address', 'email'),
+ $tokens = array(
+ 'domain' => array('name', 'phone', 'address', 'email'),
'contact' => CRM_Core_SelectValues::contactTokens(),
);
$domainValues = array();
$fields = array_merge($fields, CRM_Pledge_DAO_PledgePayment::export());
//set title to calculated fields
- $calculatedFields = array('pledge_total_paid' => array('title' => ts('Total Paid')),
+ $calculatedFields = array(
+ 'pledge_total_paid' => array('title' => ts('Total Paid')),
'pledge_balance_amount' => array('title' => ts('Balance Amount')),
'pledge_next_pay_date' => array('title' => ts('Next Payment Date')),
'pledge_next_pay_amount' => array('title' => ts('Next Payment Amount')),
'pledge_payment_paid_amount' => array('title' => ts('Paid Amount')),
'pledge_payment_paid_date' => array('title' => ts('Paid Date')),
- 'pledge_payment_status' => array('title' => ts('Pledge Payment Status'),
+ 'pledge_payment_status' => array(
+ 'title' => ts('Pledge Payment Status'),
'name' => 'pledge_payment_status',
'data_type' => CRM_Utils_Type::T_STRING,
),
);
-
$pledgeFields = array(
- 'pledge_status' => array('title' => 'Pledge Status',
+ 'pledge_status' => array(
+ 'title' => 'Pledge Status',
'name' => 'pledge_status',
'data_type' => CRM_Utils_Type::T_STRING,
),
if ($sendReminders) {
// retrieve domain tokens
$domain = CRM_Core_BAO_Domain::getDomain();
- $tokens = array('domain' => array('name', 'phone', 'address', 'email'),
+ $tokens = array(
+ 'domain' => array('name', 'phone', 'address', 'email'),
'contact' => CRM_Core_SelectValues::contactTokens(),
);
* @param int $pledgeStatusID
* @return bool do financial transactions exist for this pledge?
*/
- public static function pledgeHasFinancialTransactions($pledgeID, $pledgeStatusID) {
+ public static function pledgeHasFinancialTransactions($pledgeID, $pledgeStatusID) {
if (empty($pledgeStatusID)) {
//why would this happen? If we can see where it does then we can see if we should look it up
//but assuming from form code it CAN be empty
}
return civicrm_api3('pledge_payment', 'getcount', array('pledge_id' => $pledgeID, 'status_id' => array('IN' => self::getTransactionalStatus())));
- }
+ }
/**
* Does this pledge / pledge payment status mean that a financial transaction has taken place?
$pledgeBlock = self::getPledgeBlock($form->_id);
//build form for pledge creation.
- $pledgeOptions = array('0' => ts('I want to make a one-time contribution'),
+ $pledgeOptions = array(
+ '0' => ts('I want to make a one-time contribution'),
'1' => ts('I pledge to contribute this amount every'),
);
$form->addRadio('is_pledge', ts('Pledge Frequency Interval'), $pledgeOptions,
CRM_Utils_Hook::post('create', 'PledgePayment', $payment->id, $payment);
}
-
return $result;
}
$value,
'Integer'
);
- $query->_qill[$grouping][] = ts( 'Financial Type - %1', array( 1 => $type ) );
+ $query->_qill[$grouping][] = ts( 'Financial Type - %1', array( 1 => $type ) );
$query->_tables['civicrm_pledge'] = $query->_whereTables['civicrm_pledge'] = 1;
return;
break;
case 'pledge_financial_type':
- $from .= " $side JOIN civicrm_financial_type ON civicrm_pledge.financial_type_id = civicrm_financial_type.id ";
+ $from .= " $side JOIN civicrm_financial_type ON civicrm_pledge.financial_type_id = civicrm_financial_type.id ";
break;
case 'civicrm_pledge_payment':
* @param $row
* @param int $id
*/
- public static function searchAction(&$row, $id) {}
+ public static function searchAction(&$row, $id) {
+ }
/**
* @param $tables
NULL, TRUE
);
- $optionTypes = array('1' => ts('Adjust Pledge Payment Schedule?'),
+ $optionTypes = array(
+ '1' => ts('Adjust Pledge Payment Schedule?'),
'2' => ts('Adjust Total Pledge Amount?'),
);
$element = $this->addRadio('option_type',
NULL,
$optionTypes,
- array(
- ), '<br/>'
+ array(), '<br/>'
);
$this->addButtons(array(
$adjustTotalAmount = TRUE;
}
-
$pledgeScheduledAmount = CRM_Core_DAO::getFieldValue('CRM_Pledge_DAO_PledgePayment',
$params['id'],
'scheduled_amount',
$defaults['max_reminders'] = 1;
$defaults['additional_reminder_day'] = 5;
$defaults['frequency_unit'] = array_search('month', $this->_freqUnits);
- $defaults['financial_type_id'] = array_search( 'Donation', CRM_Contribute_PseudoConstant::financialType() );
+ $defaults['financial_type_id'] = array_search( 'Donation', CRM_Contribute_PseudoConstant::financialType() );
}
$pledgeStatus = CRM_Contribute_PseudoConstant::contributionStatus();
);
foreach ($paneNames as $name => $type) {
$urlParams = "snippet=4&formType={$type}";
- $allPanes[$name] = array('url' => CRM_Utils_System::url('civicrm/contact/view/pledge', $urlParams),
+ $allPanes[$name] = array(
+ 'url' => CRM_Utils_System::url('civicrm/contact/view/pledge', $urlParams),
'open' => 'false',
'id' => $type,
);
$this->addDate('acknowledge_date', ts('Acknowledgment Date'));
- $this->add('select', 'financial_type_id',
+ $this->add('select', 'financial_type_id',
ts( 'Financial Type' ),
- array(''=>ts( '- select -' )) + CRM_Contribute_PseudoConstant::financialType( ),
+ array('' => ts( '- select -' )) + CRM_Contribute_PseudoConstant::financialType( ),
TRUE
);
$values['contribution_page'] = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_ContributionPage', $values['contribution_page_id'], 'title');
}
- $values['financial_type'] = CRM_Utils_Array::value( $values['financial_type_id'], CRM_Contribute_PseudoConstant::financialType() );
+ $values['financial_type'] = CRM_Utils_Array::value( $values['financial_type_id'], CRM_Contribute_PseudoConstant::financialType() );
if ($values['status_id']) {
$values['pledge_status'] = CRM_Utils_Array::value($values['status_id'], CRM_Contribute_PseudoConstant::contributionStatus());
);
}
-
$this->_queryParams = CRM_Contact_BAO_Query::convertFormValues($this->_formValues);
$selector = new CRM_Pledge_Selector_Search($this->_queryParams,
$this->_action,
}
else {
$queryParams = $form->get('queryParams');
- $sortOrder = null;
+ $sortOrder = NULL;
if ( $form->get( CRM_Utils_Sort::SORT_ORDER ) ) {
$sortOrder = $form->get( CRM_Utils_Sort::SORT_ORDER );
}
*
* @return void
*/
- public function preProcess() {}
+ public function preProcess() {
+ }
/**
* Build the form object
* @return array|null
*/
public function getUserDashboardElement() {
- return array('name' => ts('Pledges'),
+ return array(
+ 'name' => ts('Pledges'),
'title' => ts('Your Pledge(s)'),
// we need to check this permission since you can click on contribution page link for making payment
'perm' => array('make online contributions'),
* @return array|null
*/
public function registerTab() {
- return array('title' => ts('Pledges'),
+ return array(
+ 'title' => ts('Pledges'),
'url' => 'pledge',
'weight' => 25,
);
* @return array|null
*/
public function registerAdvancedSearchPane() {
- return array('title' => ts('Pledges'),
+ return array(
+ 'title' => ts('Pledges'),
'weight' => 25,
);
}
CRM_Core_Permission::check('edit pledges')
) {
$shortCuts = array_merge($shortCuts, array(
- array('path' => 'civicrm/pledge/add',
+ array(
+ 'path' => 'civicrm/pledge/add',
'query' => 'reset=1&action=add&context=standalone',
'ref' => 'new-pledge',
'title' => ts('Pledge'),
if (!$name && isset($_GET['id'])) {
$name = $_GET['id'];
}
- $elements[] = array('name' => trim($name, '*'),
+ $elements[] = array(
+ 'name' => trim($name, '*'),
'value' => trim($name, '*'),
);
}
echo CRM_Utils_JSON::encode($elements, 'value');
CRM_Utils_System::civiExit();
}
- /**
- * Function to setDefaults according to Pledge Id
- * for batch entry pledges
- */
+ /**
+ * Function to setDefaults according to Pledge Id
+ * for batch entry pledges
+ */
public function getPledgeDefaults() {
$details = array();
if (!empty($_POST['pid'])) {
$previousMonth = date("F Y", mktime(0, 0, 0, date("m") - 1, 01, date("Y")));
$this->assign('previousMonthYear', $previousMonth);
-
foreach ($prefixes as $prefix) {
$aName = $prefix . 'ToDate';
$startName = $prefix . 'Date';
@access public
*/
function __construct(&$queryParams,
- $action = CRM_Core_Action::NONE,
+ $action = CRM_Core_Action::NONE,
$additionalClause = NULL,
- $single = FALSE,
- $limit = NULL,
- $context = 'search'
+ $single = FALSE,
+ $limit = NULL,
+ $context = 'search'
) {
// submitted form values
$this->_queryParams = &$queryParams;
),
);
-
if (in_array('Cancel', $hideOption)) {
unset(self::$_links[CRM_Core_Action::DETACH]);
}
$result->pledge_id
);
-
- $row['contact_type'] = CRM_Contact_BAO_Contact_Utils::getImage($result->contact_sub_type ?
- $result->contact_sub_type : $result->contact_type, FALSE, $result->contact_id
+ $row['contact_type'] = CRM_Contact_BAO_Contact_Utils::getImage($result->contact_sub_type ? $result->contact_sub_type : $result->contact_type, FALSE, $result->contact_id
);
$rows[] = $row;
}
*/
public static function &tasks() {
if (!self::$_tasks) {
- self::$_tasks = array(1 => array(
+ self::$_tasks = array(
+ 1 => array(
'title' => ts('Delete Pledges'),
'class' => 'CRM_Pledge_Form_Task_Delete',
'result' => FALSE,