Skip to content

Commit

Permalink
refs #38829, remove limitation, add qpdf default path for config when…
Browse files Browse the repository at this point in the history
… install
  • Loading branch information
jimyhuang committed Apr 8, 2024
1 parent 0b46390 commit c44ca1c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
6 changes: 2 additions & 4 deletions CRM/Admin/Form/Setting/Receipt.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,8 @@ public function buildQuickForm() {
parent::buildQuickForm($check);

// Refs #38829, Add receipt Email Encryption option
if (defined('CIVICRM_ENABLE_PDF_ENCRYPTION') && CIVICRM_ENABLE_PDF_ENCRYPTION) {
$this->add('checkbox', 'receiptEmailEncryption', ts('Email Receipt Password'));
$this->addElement('text', 'receiptEmailEncryptionText', ts('Email Receipt Password Explanation Text'));
}
$this->add('checkbox', 'receiptEmailEncryption', ts('Email Receipt Password'));
$this->addElement('text', 'receiptEmailEncryptionText', ts('Email Receipt Password Explanation Text'));
}

function setDefaultValues() {
Expand Down
2 changes: 1 addition & 1 deletion CRM/Contribute/Form/Task/PDF.php
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ public function makePDF($download = TRUE, $encryptWhenPossible = FALSE, $encrypt
$pages = $template->fetch('CRM/common/Receipt.tpl');
$pdf_real_filename = CRM_Utils_PDF_Utils::html2pdf($pages, 'Receipt.pdf', 'portrait', 'a4', $download);
$encryptPwd = str_replace(array('\'', '"'), '', $encryptPwd);
if (defined('CIVICRM_ENABLE_PDF_ENCRYPTION') && CIVICRM_ENABLE_PDF_ENCRYPTION && $encryptWhenPossible) {
if ($encryptWhenPossible) {
$pdf_real_filename = self::encryptPDF($pdf_real_filename, $encryptPwd);
}
if (!$download) {
Expand Down
7 changes: 6 additions & 1 deletion CRM/Core/Config/Variables.php
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,12 @@ class CRM_Core_Config_Variables extends CRM_Core_Config_Defaults {
/**
* Path to wkhtmltopdf if available
*/
public $wkhtmltopdfPath = FALSE;
public $wkhtmltopdfPath = '/usr/bin/wkhtmltopdf';

/**
* Path to wkhtmltopdf if available
*/
public $qpdfPath = '/usr/bin/qpdf';

/**
* The default value for Content Security Policy recover.
Expand Down

0 comments on commit c44ca1c

Please sign in to comment.