From: Brian Shaughnessy Date: Tue, 20 Dec 2016 16:16:14 +0000 (-0500) Subject: CRM-19761 support docx, etc export X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=0f2a9bd2827a303d4f2a04494471e48b85116aa6;p=civicrm-core.git CRM-19761 support docx, etc export --- diff --git a/CRM/Contribute/Form/Task/PDFLetterCommon.php b/CRM/Contribute/Form/Task/PDFLetterCommon.php index b93bd533a0..adc1e8de9f 100644 --- a/CRM/Contribute/Form/Task/PDFLetterCommon.php +++ b/CRM/Contribute/Form/Task/PDFLetterCommon.php @@ -112,8 +112,17 @@ class CRM_Contribute_Form_Task_PDFLetterCommon extends CRM_Contact_Form_Task_PDF //@todo - figure out why $form->_contactIds = array_keys($contacts); self::createActivities($form, $html_message, $form->_contactIds); + + //CRM-19761 if (!empty($html)) { - CRM_Utils_PDF_Utils::html2pdf($html, "CiviLetter.pdf", FALSE, $formValues); + $type = $formValues['document_type']; + + if ($type == 'pdf') { + CRM_Utils_PDF_Utils::html2pdf($html, "CiviLetter.pdf", FALSE, $formValues); + } + else { + CRM_Utils_PDF_Document::html2doc($html, "CiviLetter.$type", $formValues); + } } $form->postProcessHook();