From d9e4ebe7ba6ede6c7223f092df0aec927b091201 Mon Sep 17 00:00:00 2001 From: Parag Bhilkar Date: Mon, 28 Jul 2014 18:17:24 +0530 Subject: [PATCH] VAT-572 Removes notices and warnings. --- CRM/Contribute/Form/Contribution.php | 6 +++--- CRM/Core/BAO/MessageTemplate.php | 1 + CRM/Event/Form/Registration/Confirm.php | 8 +++----- CRM/Event/Form/Registration/ThankYou.php | 18 +++++++----------- 4 files changed, 14 insertions(+), 19 deletions(-) diff --git a/CRM/Contribute/Form/Contribution.php b/CRM/Contribute/Form/Contribution.php index aa27d77204..38a60a4560 100644 --- a/CRM/Contribute/Form/Contribution.php +++ b/CRM/Contribute/Form/Contribution.php @@ -1033,11 +1033,11 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP $dataArray = array(); foreach ($this->_lineItems as $key => $value) { foreach ($value as $v) { - if (isset($dataArray[$v['tax_rate']])) { - $dataArray[$v['tax_rate']] = $dataArray[$v['tax_rate']] + CRM_Utils_Array::value('tax_amount', $v); + if (isset($dataArray[(string)$v['tax_rate']])) { + $dataArray[(string)$v['tax_rate']] = $dataArray[(string)$v['tax_rate']] + CRM_Utils_Array::value('tax_amount', $v); } else { - $dataArray[$v['tax_rate']] = CRM_Utils_Array::value('tax_amount', $v); + $dataArray[(string)$v['tax_rate']] = CRM_Utils_Array::value('tax_amount', $v); } } } diff --git a/CRM/Core/BAO/MessageTemplate.php b/CRM/Core/BAO/MessageTemplate.php index 2c065d7538..9f58e585ab 100644 --- a/CRM/Core/BAO/MessageTemplate.php +++ b/CRM/Core/BAO/MessageTemplate.php @@ -503,6 +503,7 @@ class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate { $params['attachments'][] = CRM_Utils_Mail::appendPDF($params['PDFFilename'], $params['html'], $format); if (isset($params['tplParams']['email_comment'])) { $params['html'] = $params['tplParams']['email_comment']; + $params['text'] = strip_tags($params['tplParams']['email_comment']); } } diff --git a/CRM/Event/Form/Registration/Confirm.php b/CRM/Event/Form/Registration/Confirm.php index 0dda44eacb..d8d5897bfe 100644 --- a/CRM/Event/Form/Registration/Confirm.php +++ b/CRM/Event/Form/Registration/Confirm.php @@ -278,9 +278,9 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration { $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME,'contribution_invoice_settings'); $taxTerm = CRM_Utils_Array::value('tax_term', $invoiceSettings); $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings); - $this->assign('taxTerm', $taxTerm); if ($invoicing) { $this->assign('totalTaxAmount', $taxAmount); + $this->assign('taxTerm', $taxTerm); } $this->assign('part', $this->_part); $this->set('part', $this->_part); @@ -299,9 +299,7 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration { if ($invoicing) { foreach ($value as $v) { if (isset($v['tax_rate'])) { - if ($v['tax_rate'] != '') { - $getTaxDetails = TRUE; - } + $getTaxDetails = TRUE; } } } @@ -309,9 +307,9 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration { if (!empty($lineItemForTemplate)) { $this->assign('lineItem', $lineItemForTemplate); } + $this->assign('getTaxDetails', $getTaxDetails); } - $this->assign('getTaxDetails', $getTaxDetails); //display additional participants profile. self::assignProfiles($this); diff --git a/CRM/Event/Form/Registration/ThankYou.php b/CRM/Event/Form/Registration/ThankYou.php index 4a0135d53f..16486177a4 100644 --- a/CRM/Event/Form/Registration/ThankYou.php +++ b/CRM/Event/Form/Registration/ThankYou.php @@ -98,13 +98,13 @@ class CRM_Event_Form_Registration_ThankYou extends CRM_Event_Form_Registration { } $this->assignToTemplate(); + $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME,'contribution_invoice_settings'); + $taxTerm = CRM_Utils_Array::value('tax_term', $invoiceSettings); + $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings); + $getTaxDetails = FALSE; $taxAmount = 0; if ($this->_priceSetId && !CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $this->_priceSetId, 'is_quick_config')) { $lineItemForTemplate = array(); - $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME,'contribution_invoice_settings'); - $taxTerm = CRM_Utils_Array::value('tax_term', $invoiceSettings); - $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings); - $getTaxDetails = FALSE; foreach ($this->_lineItem as $key => $value) { if (!empty($value)) { $lineItemForTemplate[$key] = $value; @@ -112,9 +112,7 @@ class CRM_Event_Form_Registration_ThankYou extends CRM_Event_Form_Registration { foreach ($value as $v) { if (isset($v['tax_amount']) || isset($v['tax_rate'])) { $taxAmount += $v['tax_amount']; - if ($v['tax_rate'] != '') { - $getTaxDetails = TRUE; - } + $getTaxDetails = TRUE; } } } @@ -130,9 +128,7 @@ class CRM_Event_Form_Registration_ThankYou extends CRM_Event_Form_Registration { foreach ($lineItemValue as $v) { if (isset($v['tax_amount']) || isset($v['tax_rate'])) { $taxAmount += $v['tax_amount']; - if ($v['tax_rate'] != '') { - $getTaxDetails = TRUE; - } + $getTaxDetails = TRUE; } } } @@ -142,6 +138,7 @@ class CRM_Event_Form_Registration_ThankYou extends CRM_Event_Form_Registration { if ($invoicing) { $this->assign('getTaxDetails', $getTaxDetails); $this->assign('totalTaxAmount', $taxAmount); + $this->assign('taxTerm', $taxTerm); } $this->assign('totalAmount', $this->_totalAmount); @@ -234,7 +231,6 @@ class CRM_Event_Form_Registration_ThankYou extends CRM_Event_Form_Registration { $this->assign('pcpLinkText', $dao->link_text); } - $this->assign('taxTerm', $taxTerm); // Assign Participant Count to Lineitem Table $this->assign('pricesetFieldsCount', CRM_Price_BAO_PriceSet::getPricesetCount($this->_priceSetId)); -- 2.25.1