From 6efffa5d5c827e37d10112a1d7d43986402d36b6 Mon Sep 17 00:00:00 2001 From: Parag Bhilkar Date: Thu, 3 Jul 2014 18:42:00 +0530 Subject: [PATCH] VAT-417 Record an activity Downloaded Invoice and Emailed Invoice on Print Invoice and Email Invoice buttons action. --- CRM/Contribute/Form/Task/Invoice.php | 248 ++++++++++++++---- CRM/Contribute/Form/Task/PDF.php | 15 +- .../CRM/Contribute/Form/Task/Invoice.hlp | 63 +++++ .../CRM/Contribute/Form/Task/Invoice.tpl | 61 +++-- 4 files changed, 313 insertions(+), 74 deletions(-) create mode 100644 templates/CRM/Contribute/Form/Task/Invoice.hlp diff --git a/CRM/Contribute/Form/Task/Invoice.php b/CRM/Contribute/Form/Task/Invoice.php index c647a85b23..7a9002e774 100644 --- a/CRM/Contribute/Form/Task/Invoice.php +++ b/CRM/Contribute/Form/Task/Invoice.php @@ -116,7 +116,11 @@ class CRM_Contribute_Form_Task_Invoice extends CRM_Contribute_Form_Task { )); CRM_Utils_System::appendBreadCrumb($breadCrumb); - CRM_Utils_System::setTitle(ts('Print Contribution Invoice')); + if (in_array("email", $this->urlPath)) { + CRM_Utils_System::setTitle(ts('Email Invoice')); + } else { + CRM_Utils_System::setTitle(ts('Print Contribution Invoice')); + } } /** @@ -127,26 +131,74 @@ class CRM_Contribute_Form_Task_Invoice extends CRM_Contribute_Form_Task { * @return void */ public function buildQuickForm() { - $this->addElement('radio', 'output', NULL, ts('Email Invoice'), 'email_invoice', - array('onClick' => "document.getElementById('selectPdfFormat').style.display = 'none';document.getElementById ('comment').style.display = 'block';") - ); - $this->addElement('radio', 'output', NULL, ts('PDF Invoice'), 'pdf_invoice', - array('onClick' => "document.getElementById('comment').style.display = 'none';document.getElementById('selectPdfFormat').style.display = 'block';") - ); - $this->addRule('output', ts('Selection required'), 'required'); - $this->add('textarea', 'email_comment', ts('If you would like to add personal message to email please add it here. (The same messages will sent to all receipients.)')); - $this->addButtons(array( - array( - 'type' => 'next', - 'name' => ts('Process Invoice(s)'), - 'isDefault' => TRUE, - ), - array( - 'type' => 'back', - 'name' => ts('Cancel'), - ), - ) + $session = CRM_Core_Session::singleton(); + $config = CRM_Core_Config::singleton(); + $options = array(); + $session->getVars($options, + "CRM_Mailing_Controller_Send_{$this->controller->_key}" + ); + if (CRM_Core_Permission::check('administer CiviCRM')) { + $this->assign('isAdmin', 1); + } + $fromEmailAddress = CRM_Core_OptionGroup::values('from_email_address'); + if (empty($fromEmailAddress)) { + //redirect user to enter from email address. + $url = CRM_Utils_System::url('civicrm/admin/options/from_email_address', 'action=add&reset=1'); + $status = ts("There is no valid from email address present. You can add here Add From Email Address.", array(1 => $url)); + $session->setStatus($status, ts('Notice')); + } + else { + foreach ($fromEmailAddress as $key => $email) { + $fromEmailAddress[$key] = htmlspecialchars($fromEmailAddress[$key]); + } + } + $this->addElement('radio', 'output', NULL, ts('Email Invoice'), 'email_invoice'); + $this->addElement('radio', 'output', NULL, ts('PDF Invoice'), 'pdf_invoice'); + $this->add('select', 'from_email_address', + ts('From Email Address'), array( + '' => '- select -') + $fromEmailAddress ); + + // Validation of From Email Address + if (in_array("email", $this->urlPath)) { + $this->addRule('from_email_address', ts('From Email Address is required'), 'required'); + } + else { + $this->addRule('output', ts('Selection required'), 'required'); + if (!empty($this->_submitValues['output']) && $this->_submitValues['output'] == 'email_invoice') { + $this->addRule('from_email_address', ts('From Email Address is required'), 'required'); + } + } + + $this->addWysiwyg('email_comment', ts('If you would like to add personal message to email please add it here. (The same messages will sent to all receipients.)'), array('rows' => 2, 'cols' => 40)); + + if (in_array("email", $this->urlPath)) { + $this->addButtons(array( + array( + 'type' => 'next', + 'name' => ts('Email Invoice'), + 'isDefault' => TRUE, + ), + array( + 'type' => 'back', + 'name' => ts('Cancel'), + ), + ) + ); + } else { + $this->addButtons(array( + array( + 'type' => 'next', + 'name' => ts('Process Invoice(s)'), + 'isDefault' => TRUE, + ), + array( + 'type' => 'back', + 'name' => ts('Cancel'), + ), + ) + ); + } } /** @@ -157,15 +209,32 @@ class CRM_Contribute_Form_Task_Invoice extends CRM_Contribute_Form_Task { * @return void */ public function postProcess() { + $params = $this->controller->exportValues($this->_name); + $this->printPDF($this->_contributionIds, $params, $this->_contactIds); + } + + /** + * + * process the PDf and email with activity and attachment + * on click of Print Invoices + * + * @param array $contribIDs Contribution Id + * @param array $params for pdf or email invoices + * @param array $contactIds Contact Id + * @static + * + */ + static function printPDF($contribIDs, $params, $contactIds) { // get all the details needed to generate a invoice - $this->_messageInvoice = array(); + $messageInvoice = array(); - $this->_invoiceTemplate = CRM_Core_Smarty::singleton(); + $invoiceTemplate = CRM_Core_Smarty::singleton(); - $invoiceElements = CRM_Contribute_Form_Task_PDF::getElements(); + $invoiceElements = CRM_Contribute_Form_Task_PDF::getElements($contribIDs, $params, $contactIds); // gives the status id when contribution status is 'Refunded' - $refundedStatusId = CRM_Utils_Array::key('Refunded', $this->_contributionStatusId); + $contributionStatusID = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name'); + $refundedStatusId = CRM_Utils_Array::key('Refunded', $contributionStatusID); // getting data from admin page $prefixValue = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME,'contribution_invoice_settings'); @@ -216,7 +285,12 @@ class CRM_Contribute_Form_Task_Invoice extends CRM_Contribute_Form_Task { } } - $stateProvinceAbbreviation = CRM_Core_PseudoConstant::stateProvinceAbbreviation($billingAddress[$contribution->contact_id]['state_province_id']); + if (!empty($billingAddress[$contribution->contact_id]['state_province_id'])) { + $stateProvinceAbbreviation = CRM_Core_PseudoConstant::stateProvinceAbbreviation($billingAddress[$contribution->contact_id]['state_province_id']); + } + else { + $stateProvinceAbbreviation = ''; + } if ($contribution->contribution_status_id == $refundedStatusId) { $invoiceId = CRM_Utils_Array::value('credit_notes_prefix', $prefixValue). "" .$contribution->id; @@ -270,7 +344,6 @@ class CRM_Contribute_Form_Task_Invoice extends CRM_Contribute_Form_Task { 'bcc_confirm', ); CRM_Core_DAO::commonRetrieveAll($daoName, 'id', $pageId, $mailDetails, $mailElements); - $values['title'] = CRM_Utils_Array::value('title', $mailDetails[$contribution->_relatedObjects['event']->id]); $values['confirm_from_name'] = CRM_Utils_Array::value('confirm_from_name', $mailDetails[$contribution->_relatedObjects['event']->id]); $values['confirm_from_email'] = CRM_Utils_Array::value('confirm_from_email', $mailDetails[$contribution->_relatedObjects['event']->id]); @@ -290,19 +363,19 @@ class CRM_Contribute_Form_Task_Invoice extends CRM_Contribute_Form_Task { 'bcc_receipt', ); CRM_Core_DAO::commonRetrieveAll($daoName, 'id', $pageId, $mailDetails, $mailElements); - - $values['title'] = CRM_Utils_Array::value('title',$mailDetails[$contribution->contribution_page_id]); - $values['receipt_from_name'] = CRM_Utils_Array::value('receipt_from_name', $mailDetails[$contribution->contribution_page_id]); - $values['receipt_from_email'] = CRM_Utils_Array::value('receipt_from_email', $mailDetails[$contribution->contribution_page_id]); - $values['cc_receipt'] = CRM_Utils_Array::value('cc_receipt', $mailDetails[$contribution->contribution_page_id]); - $values['bcc_receipt'] = CRM_Utils_Array::value('bcc_receipt', $mailDetails[$contribution->contribution_page_id]); - - $title = CRM_Utils_Array::value('title', $mailDetails[$contribution->contribution_page_id]); + + $values['title'] = CRM_Utils_Array::value('title',CRM_Utils_Array::value($contribution->contribution_page_id, $mailDetails)); + $values['receipt_from_name'] = CRM_Utils_Array::value('receipt_from_name', CRM_Utils_Array::value($contribution->contribution_page_id, $mailDetails)); + $values['receipt_from_email'] = CRM_Utils_Array::value('receipt_from_email', CRM_Utils_Array::value($contribution->contribution_page_id, $mailDetails)); + $values['cc_receipt'] = CRM_Utils_Array::value('cc_receipt', CRM_Utils_Array::value($contribution->contribution_page_id, $mailDetails)); + $values['bcc_receipt'] = CRM_Utils_Array::value('bcc_receipt', CRM_Utils_Array::value($contribution->contribution_page_id, $mailDetails)); + + $title = CRM_Utils_Array::value('title', CRM_Utils_Array::value($contribution->contribution_page_id, $mailDetails)); } $config = CRM_Core_Config::singleton(); $config->doNotAttachPDFReceipt = 1; - + // parameters to be assign for template $tplParams = array( 'title' => $title, @@ -322,12 +395,12 @@ class CRM_Contribute_Form_Task_Invoice extends CRM_Contribute_Form_Task { 'refundedStatusId' => $refundedStatusId, 'contribution_status_id' => $contribution->contribution_status_id, 'subTotal' => $subTotal, - 'street_address' => CRM_Utils_Array::value('street_address', $billingAddress[$contribution->contact_id]), - 'supplemental_address_1' => CRM_Utils_Array::value('supplemental_address_1', $billingAddress[$contribution->contact_id]), - 'supplemental_address_2' => CRM_Utils_Array::value('supplemental_address_2', $billingAddress[$contribution->contact_id]), - 'city' => CRM_Utils_Array::value('city', $billingAddress[$contribution->contact_id]), + 'street_address' => CRM_Utils_Array::value('street_address', CRM_Utils_Array::value($contribution->contact_id,$billingAddress)), + 'supplemental_address_1' => CRM_Utils_Array::value('supplemental_address_1', CRM_Utils_Array::value($contribution->contact_id,$billingAddress)), + 'supplemental_address_2' => CRM_Utils_Array::value('supplemental_address_2', CRM_Utils_Array::value($contribution->contact_id,$billingAddress)), + 'city' => CRM_Utils_Array::value('city', CRM_Utils_Array::value($contribution->contact_id,$billingAddress)), 'stateProvinceAbbreviation' => $stateProvinceAbbreviation, - 'postal_code' => CRM_Utils_Array::value('postal_code', $billingAddress[$contribution->contact_id]), + 'postal_code' => CRM_Utils_Array::value('postal_code', CRM_Utils_Array::value($contribution->contact_id,$billingAddress)), 'is_pay_later' => $contribution->is_pay_later, 'organization_name' => $contribution->_relatedObjects['contact']->organization_name, ); @@ -341,6 +414,12 @@ class CRM_Contribute_Form_Task_Invoice extends CRM_Contribute_Form_Task { ); + // from email address + if (isset($params['from_email_address'])) { + $fromEmailAddress = CRM_Utils_Array::value($params['from_email_address'], + CRM_Core_OptionGroup::values('from_email_address') + ); + } // condition to check for download PDF Invoice or email Invoice if ($invoiceElements['createPdf']) { list($sent, $subject, $message, $html) = CRM_Core_BAO_MessageTemplate::sendTemplate($sendTemplateParams); @@ -351,41 +430,52 @@ class CRM_Contribute_Form_Task_Invoice extends CRM_Contribute_Form_Task { ); if ($mail['html']) { - $this->_messageInvoice[] = $mail['html']; + $messageInvoice[] = $mail['html']; } else { - $this->_messageInvoice[] = nl2br($mail['body']); + $messageInvoice[] = nl2br($mail['body']); } } elseif ($contribution->_component == 'contribute') { $email = CRM_Contact_BAO_Contact::getPrimaryEmail($contribution->contact_id); $sendTemplateParams['tplParams'] = array_merge($tplParams,array('email_comment' => $invoiceElements['params']['email_comment'])); - $sendTemplateParams['from'] = CRM_Utils_Array::value('receipt_from_name', $values) . ' <' . $mailDetails[$contribution->contribution_page_id]['receipt_from_email']. '>'; + $sendTemplateParams['from'] = $fromEmailAddress; $sendTemplateParams['toEmail'] = $email; $sendTemplateParams['cc'] = CRM_Utils_Array::value('cc_receipt', $values); $sendTemplateParams['bcc'] = CRM_Utils_Array::value('bcc_receipt', $values); list($sent, $subject, $message, $html) = CRM_Core_BAO_MessageTemplate::sendTemplate($sendTemplateParams); + // functions call for adding activity with attachment + $fileName = self::putFile($html); + self::addActivities($subject, $contribution->contact_id, $fileName, $params); } elseif ($contribution->_component == 'event') { $email = CRM_Contact_BAO_Contact::getPrimaryEmail($contribution->contact_id); $sendTemplateParams['tplParams'] = array_merge($tplParams,array('email_comment' => $invoiceElements['params']['email_comment'])); - $sendTemplateParams['from'] = CRM_Utils_Array::value('confirm_from_name', $values) . ' <' . $mailDetails[$contribution->_relatedObjects['event']->id]['confirm_from_email']. '>'; + $sendTemplateParams['from'] = $fromEmailAddress; $sendTemplateParams['toEmail'] = $email; $sendTemplateParams['cc'] = CRM_Utils_Array::value('cc_confirm', $values); $sendTemplateParams['bcc'] = CRM_Utils_Array::value('bcc_confirm', $values); list($sent, $subject, $message, $html) = CRM_Core_BAO_MessageTemplate::sendTemplate($sendTemplateParams); + // functions call for adding activity with attachment + $fileName = self::putFile($html); + self::addActivities($subject, $contribution->contact_id, $fileName, $params); } $updateInvoiceId = CRM_Core_DAO::setFieldValue('CRM_Contribute_DAO_Contribution', $contribution->id, 'invoice_id', $invoiceId); - $this->_invoiceTemplate->clearTemplateVars(); + $invoiceTemplate->clearTemplateVars(); } if ($invoiceElements['createPdf']) { - CRM_Utils_PDF_Utils::html2pdf($this->_messageInvoice, 'Invoice.pdf', FALSE); + CRM_Utils_PDF_Utils::html2pdf($messageInvoice, 'Invoice.pdf', FALSE); + + // functions call for adding activity with attachment + $fileName = self::putFile($html); + self::addActivities($subject, $contactIds, $fileName, $params['output']); + CRM_Utils_System::civiExit(); } else { @@ -402,5 +492,71 @@ class CRM_Contribute_Form_Task_Invoice extends CRM_Contribute_Form_Task { CRM_Core_Session::setStatus($status, $msgTitle, $msgType); } } + + /** + * + * This function is use for adding activity for + * Email Invoice and the PDF Invoice + * + * @param string $subject Activity subject + * @param array $contactIds Contact Id + * @param string $fileName gives the location with name of the file + * @param array $output for invoices + * + */ + public function addActivities($subject, $contactIds, $fileName, $output) { + $session = CRM_Core_Session::singleton(); + $userID = $session->get('userID'); + $config = CRM_Core_Config::singleton(); + $config->doNotAttachPDFReceipt = 1; + if ($output['output'] == 'email_invoice' || (is_array($output) && array_key_exists("from_email_address", $output))) { + $activityTypeID = CRM_Core_OptionGroup::getValue('activity_type', + 'Emailed Invoice', + 'name' + ); + } else { + $activityTypeID = CRM_Core_OptionGroup::getValue('activity_type', + 'Downloaded Invoice', + 'name' + ); + } + $activityParams = array( + 'subject' => $subject, + 'source_contact_id' => $userID, + 'target_contact_id' => $contactIds, + 'activity_type_id' => $activityTypeID, + 'activity_date_time' => date('YmdHis'), + 'attachFile_1' => array ('uri' => $fileName, + 'type' => 'application/pdf', + 'location' => $fileName, + 'upload_date' => date('YmdHis'), + ), + ); + $activity = CRM_Activity_BAO_Activity::create($activityParams); + } + + /** + * + * This function is use for creating the Invoice file in upload folder + * for attachment + * + * @param $html content for pdf in html format + * + * return $fileName of file which is in pdf format + * + */ + public function putFile($html) { + require_once("packages/dompdf/dompdf_config.inc.php"); + spl_autoload_register('DOMPDF_autoload'); + $doc = new DOMPDF(); + $doc->load_html($html); + $doc->render(); + $html = $doc->output(); + $config = CRM_Core_Config::singleton(); + $fileName = $config->uploadDir.'Invoice.pdf'; + $file = file_put_contents($fileName, $html); + return $fileName; + } + } diff --git a/CRM/Contribute/Form/Task/PDF.php b/CRM/Contribute/Form/Task/PDF.php index a89e05afc5..b6cd07fd51 100644 --- a/CRM/Contribute/Form/Task/PDF.php +++ b/CRM/Contribute/Form/Task/PDF.php @@ -154,7 +154,8 @@ AND {$this->_componentClause}"; $message = array(); $template = CRM_Core_Smarty::singleton(); - $elements = self::getElements(); + $params = $this->controller->exportValues($this->_name); + $elements = self::getElements($this->_contributionIds, $params, $this->_contactIds); foreach ($elements['details'] as $contribID => $detail) { $input = $ids = $objects = array(); @@ -234,19 +235,23 @@ AND {$this->_componentClause}"; * * @access public * + * @param array $contribIds Contribution Id + * @param array $params parameter for pdf or email invoices + * @param array $contactIds Contact Id + * * @return array array of common elements * */ - public function getElements() { + public function getElements($contribIds, $params, $contactIds) { $pdfElements = array(); - $pdfElements['contribIDs'] = implode(',', $this->_contributionIds); + $pdfElements['contribIDs'] = implode(',', $contribIds); $pdfElements['details'] = CRM_Contribute_Form_Task_Status::getDetails($pdfElements['contribIDs']); $pdfElements['baseIPN'] = new CRM_Core_Payment_BaseIPN(); - $pdfElements['params'] = $this->controller->exportValues($this->_name); + $pdfElements['params'] = $params; $pdfElements['createPdf'] = FALSE; if ($pdfElements['params']['output'] == "pdf_invoice" || $pdfElements['params']['output'] == "pdf_receipt") { @@ -262,7 +267,7 @@ AND {$this->_componentClause}"; 'on_hold' => 1, ); - list($contactDetails) = CRM_Utils_Token::getTokenDetails($this->_contactIds, $returnProperties, FALSE, FALSE); + list($contactDetails) = CRM_Utils_Token::getTokenDetails($contactIds, $returnProperties, FALSE, FALSE); $pdfElements['suppressedEmails'] = 0; foreach ($contactDetails as $id => $values) { if (empty($values['email']) || !empty($values['do_not_email']) || diff --git a/templates/CRM/Contribute/Form/Task/Invoice.hlp b/templates/CRM/Contribute/Form/Task/Invoice.hlp new file mode 100644 index 0000000000..c6cbd52be0 --- /dev/null +++ b/templates/CRM/Contribute/Form/Task/Invoice.hlp @@ -0,0 +1,63 @@ +{* + +--------------------------------------------------------------------+ + | CiviCRM version 4.5 | + +--------------------------------------------------------------------+ + | Copyright CiviCRM LLC (c) 2004-2013 | + +--------------------------------------------------------------------+ + | This file is a part of CiviCRM. | + | | + | CiviCRM is free software; you can copy, modify, and distribute it | + | under the terms of the GNU Affero General Public License | + | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | + | | + | CiviCRM is distributed in the hope that it will be useful, but | + | WITHOUT ANY WARRANTY; without even the implied warranty of | + | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | + | See the GNU Affero General Public License for more details. | + | | + | You should have received a copy of the GNU Affero General Public | + | License and the CiviCRM Licensing Exception along | + | with this program; if not, contact CiviCRM LLC | + | at info[AT]civicrm[DOT]org. If you have questions about the | + | GNU Affero General Public License or the licensing of CiviCRM, | + | see the CiviCRM license FAQ at http://civicrm.org/licensing | + +--------------------------------------------------------------------+ +*} +{htxt id ="id-from_email-title"} + {ts}From Address{/ts} +{/htxt} +{htxt id ="id-from_email"} +

{ts}Select the "FROM" Email Address for this mailing from the dropdown list. Available email addresses are configurable by users with Administer CiviCRM permission. EXAMPLE: "Client Services" <clientservices@example.org>{/ts}

+{if $params.isAdmin} + {capture assign="fromConfig"}{crmURL p="civicrm/admin/options/from_email_address" q="reset=1"}{/capture} +

{ts 1=$fromConfig}Go to Administer CiviCRM » Communications » FROM Email Addresses to add or edit email addresses. Make sure these email addresses are valid email accounts with your email service provider.{/ts}

+{else} + {ts}Contact your site administrator if you need to use a "FROM" Email Address which is not in the dropdown list.{/ts} +{/if} +{/htxt} + +{htxt id="content-intro-title"} + {ts}Message Formats{/ts} +{/htxt} +{htxt id="content-intro"} +

{ts}You can choose to send BOTH an HTML and a plain TEXT version of your mailing, OR you can send a TEXT version only.{/ts}

+

{ts}If you create only an HTML version, CiviMail will automatically create a TEXT version for your recipients who have chosen NOT to receive HTML email.{/ts}

+

{ts}Required Elements{/ts}

+

{ts}CiviMail email messages must include an opt-out link ("Opt out via web page"), and the postal address of your organization. These elements help reduce the chances of your email being categorized as SPAM. They can be included in the main message body OR in a re-usable message footer. Refer to the online documentation for details on how to include required links and contact information as well as sample messages.{/ts} {docURL page="Sample CiviMail Messages" resource="wiki"}

+{/htxt} + +{htxt id="upload-compose-title"} + {ts}Upload or Compose On-screen{/ts} +{/htxt} +{htxt id="upload-compose"} +

{ts}You can use your favorite editor to create content on your local computer and then Upload the files. OR you can Compose content directly on the screen.{/ts}

+

{ts}If you choose to compose on the screen, a basic WYSIWYG (what-you-see-is-what-you-get) editor is provided which you can use create simple HTML messages. However, if you are planning on creating HTML messages with complex layouts - it is best to use an HTML editor on your local computer. Then locate and upload the saved file(s) by clicking the Browse button.{/ts}

+{/htxt} + +{htxt id="id-message-text-title"} + {ts}Text Message{/ts} +{/htxt} +{htxt id="id-message-text"} +

{ts}You can send your email as a simple text-only message, as an HTML formatted message, or both. Text-only messages are sufficient for most email communication - and some recipients may prefer not to receive HTML formatted messages.{/ts}

+

{ts}HTML messages have more visual impact, allow you to include images, and may be more readable if you are including links to website pages. However, different email programs may interpret HTML formats differently - so use this option cautiously unless you have a template format that has been tested with different web and desktop email programs.{/ts}

+{/htxt} diff --git a/templates/CRM/Contribute/Form/Task/Invoice.tpl b/templates/CRM/Contribute/Form/Task/Invoice.tpl index b0e4039cc6..72222ddefd 100644 --- a/templates/CRM/Contribute/Form/Task/Invoice.tpl +++ b/templates/CRM/Contribute/Form/Task/Invoice.tpl @@ -27,42 +27,57 @@
{include file="CRM/Contribute/Form/Task.tpl"} -
+{if $smarty.get.select != 'email' || $smarty.get.q != 'civicrm/contribute/invoice/email'} +
{ts}You may choose to email invoice to contributors OR download a PDF file containing one invoice per page to your local computer by clicking Process Invoice(s). Your browser may display the file for you automatically, or you may need to open it for printing using any PDF reader (such as Adobe® Reader).{/ts} -
+
+{/if} - {if $smarty.get.select == 'email'} + {if $smarty.get.select == 'email' || $smarty.get.q == 'civicrm/contribute/invoice/email'} {literal} {/literal} {/if} - {if $smarty.get.select == 'pdf'} - {literal} - - {/literal} - {/if} - - + {literal} + + {/literal} + + {if $smarty.get.select != 'email' && $smarty.get.q != 'civicrm/contribute/invoice/email'} + + + + {/if} + + - - - - + + {if $smarty.get.select != 'email' && $smarty.get.q != 'civicrm/contribute/invoice/email'} + + + + {/if} -- 2.25.1
{$form.output.email_invoice.html}
{$form.output.email_invoice.html}
{$form.output.pdf_invoice.html}{$form.email_comment.label}{$form.email_comment.html}
{$form.output.pdf_invoice.html}