+--------------------------------------------------------------------+
| CiviCRM version 4.6 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014 |
+ | Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
+ * @copyright CiviCRM LLC (c) 2004-2015
* $Id$
*
*/
class CRM_Contribute_BAO_ContributionPage extends CRM_Contribute_DAO_ContributionPage {
/**
- * Takes an associative array and creates a contribution page object
+ * Takes an associative array and creates a contribution page object.
*
* @param array $params
* (reference ) an assoc array of name/value pairs.
}
/**
- * Update the is_active flag in the db
+ * Update the is_active flag in the db.
*
* @param int $id
* Id of the database record.
}
/**
- * Send the emails
+ * Send the emails.
*
* @param int $contactID
* Contact id.
$taxAmt = $template->get_template_vars('dataArray');
$prefixValue = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
$invoicing = CRM_Utils_Array::value('invoicing', $prefixValue);
- if (count($taxAmt) > 0 && (isset($invoicing) && isset($prefixValue['is_email_pdf']))) {
+ if (isset($invoicing) && isset($prefixValue['is_email_pdf'])) {
$sendTemplateParams['isEmailPdf'] = TRUE;
$sendTemplateParams['contributionId'] = $values['contribution_id'];
}
}
/**
- * Construct the message to be sent by the send function
+ * Construct the message to be sent by the send function.
*
* @param array $tplParams
* @param int $contactID
}
/**
- * Send the emails for Recurring Contribution Notication
+ * Send the emails for Recurring Contribution Notication.
*
* @param string $type
* TxnType.
* @param object $recur
* Object of recurring contribution table.
* @param bool|object $autoRenewMembership is it a auto renew membership.
- *
- * @return void
*/
public static function recurringNotify($type, $contactID, $pageID, $recur, $autoRenewMembership = FALSE) {
$value = array();
+ $isEmailReceipt = FALSE;
if ($pageID) {
CRM_Core_DAO::commonRetrieveAll('CRM_Contribute_DAO_ContributionPage', 'id', $pageID, $value, array(
'title',
'cc_receipt',
'bcc_receipt',
));
+ $isEmailReceipt = CRM_Utils_Array::value('is_email_receipt', $value[$pageID]);
}
- $isEmailReceipt = CRM_Utils_Array::value('is_email_receipt', $value[$pageID]);
$isOfflineRecur = FALSE;
if (!$pageID && $recur->id) {
$isOfflineRecur = TRUE;
'entity_table' => 'civicrm_contribution_page',
), array(
'entity_id' => $copy->id,
+ 'target_entity_id' => $copy->id,
));
$copyPremium = &CRM_Core_DAO::copyGeneric('CRM_Contribute_DAO_Premium', array(
* @return array|string
*/
public static function formatMultilingualHonorParams($params, $setDefault = FALSE) {
+ global $tsLocale;
$config = CRM_Core_Config::singleton();
+
$sctJson = $sctJsonDecode = NULL;
$domain = new CRM_Core_DAO_Domain();
$domain->find(TRUE);
//monolingual state
$sctJsonDecode += (array) $sctJsonDecode['default'];
}
- elseif (!empty($sctJsonDecode[$config->lcMessages])) {
+ elseif (!empty($sctJsonDecode[$tsLocale])) {
//multilingual state
- foreach ($sctJsonDecode[$config->lcMessages] as $column => $value) {
+ foreach ($sctJsonDecode[$tsLocale] as $column => $value) {
$sctJsonDecode[$column] = $value;
}
- unset($sctJsonDecode[$config->lcMessages]);
+ unset($sctJsonDecode[$tsLocale]);
}
return $sctJsonDecode;
}
}
/**
- * 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