*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
- *
*/
/**
/**
* Update the is_active flag in the db.
*
+ * @deprecated - this bypasses hooks.
+ *
* @param int $id
* Id of the database record.
* @param bool $is_active
}
/**
+ * Load values for a contribution page.
+ *
* @param int $id
- * @param $values
+ * @param array $values
*/
public static function setValues($id, &$values) {
$params = array(
else {
$values['custom_post_id'] = '';
}
- // // add an accounting code also
- // if ($values ['financial_type_id']) {
- // $values ['accountingCode'] = CRM_Core_DAO::getFieldValue( 'CRM_Financial_DAO_FinancialType', $values ['financial_type_id'], 'accounting_code' );
- // }
}
/**
* @param bool $returnMessageText
* Return the message text instead of sending the mail.
*
- * @param null $fieldTypes
- *
- * @return void
+ * @param array $fieldTypes
*/
public static function sendMail($contactID, $values, $isTest = FALSE, $returnMessageText = FALSE, $fieldTypes = NULL) {
$gIds = $params = array();
* @param array $params
* Params to build component whereclause.
*
- * @param null $fieldTypes
- *
- * @return void
+ * @param array $fieldTypes
*/
- public static function buildCustomDisplay($gid, $name, $cid, &$template, &$params, $fieldTypes = NULL) {
+ public static function buildCustomDisplay($gid, $name, $cid, &$template, &$params, $fieldTypes = array()) {
if ($gid) {
if (CRM_Core_BAO_UFGroup::filterUFGroups($gid, $cid)) {
$values = array();
}
/**
- * make a copy of a contribution page, including
- * all the blocks in the page
+ * Make a copy of a contribution page, including all the blocks in the page.
*
* @param int $id
* The contribution page id to copy.
$premiumDao = CRM_Core_DAO::executeQuery($premiumQuery, CRM_Core_DAO::$_nullArray);
while ($premiumDao->fetch()) {
if ($premiumDao->id) {
- $copyPremiumProduct = &CRM_Core_DAO::copyGeneric('CRM_Contribute_DAO_PremiumsProduct', array(
+ CRM_Core_DAO::copyGeneric('CRM_Contribute_DAO_PremiumsProduct', array(
'premiums_id' => $premiumDao->id,
), array(
'premiums_id' => $copyPremium->id,
return $copy;
}
- /**
- * Check if contribution page contains payment
- * processor that supports recurring payment
- *
- * @param int $contributionPageId
- * Contribution Page Id.
- *
- * @return bool
- * true if payment processor supports recurring
- * else false
- *
- */
- public static function checkRecurPaymentProcessor($contributionPageId) {
- //FIXME
- $sql = "
- SELECT pp.is_recur
- FROM civicrm_contribution_page cp,
- civicrm_payment_processor pp
- WHERE cp.payment_processor = pp.id
- AND cp.id = {$contributionPageId}
-";
-
- if ($recurring = &CRM_Core_DAO::singleValueQuery($sql, CRM_Core_DAO::$_nullArray)) {
- return TRUE;
- }
- return FALSE;
- }
-
/**
* Get info for all sections enable/disable.
*
}
/**
- * Generate html for pdf in confirmation receipt email attachment.
+ * Generate html for pdf in confirmation receipt email attachment.
+ *
* @param int $contributionId
* Contribution Page Id.
* @param int $userID
ContributionPage::delete($copycontributionpage->id);
}
- /**
- * Test checkRecurPaymentProcessor() method
- */
- public function testcheckRecurPaymentProcessor() {
- //@todo paypalpro create seems to fail silently without causing this class to fail
- // $this->paymentProcessorCreate may be a better option
- $paymentProcessor = PaypalPro::create();
- $params = array(
- 'title' => 'Test Contribution Page',
- 'financial_type_id' => $this->_financialTypeID,
- 'is_active' => 1,
- 'payment_processor_id' => $paymentProcessor,
- );
-
- $contributionpage = CRM_Contribute_BAO_ContributionPage::create($params);
- $id = $contributionpage->id;
- $checkRecurring = CRM_Contribute_BAO_ContributionPage::checkRecurPaymentProcessor($id);
- $this->assertEquals($checkRecurring, FALSE, 'Check for false return.');
- ContributionPage::delete($contributionpage->id);
- }
-
}