3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
19 * This class provides the functionality to create PDF letter for a group of
20 * contacts or a single contact.
22 class CRM_Member_Form_Task_PDFLetter
extends CRM_Member_Form_Task
{
24 use CRM_Contact_Form_Task_PDFTrait
;
27 * All the existing templates in the system.
31 public $_templates = NULL;
33 public $_single = NULL;
38 * Build all the data structures needed to build the form.
42 public function preProcess() {
43 $this->skipOnHold
= $this->skipDeceased
= FALSE;
45 $this->setContactIDs();
46 $this->preProcessPDF();
50 * Build the form object.
54 * @throws \CRM_Core_Exception
56 public function buildQuickForm() {
58 $this->assign('suppressForm', FALSE);
59 $this->addPDFElementsToForm();
63 * Process the form after the input has been submitted and validated.
68 public function postProcess() {
69 // TODO: rewrite using contribution token and one letter by contribution
70 $this->setContactIDs();
71 $skipOnHold = $this->skipOnHold ??
FALSE;
72 $skipDeceased = $this->skipDeceased ??
TRUE;
73 CRM_Member_Form_Task_PDFLetterCommon
::postProcessMembers(
74 $this, $this->_memberIds
, $skipOnHold, $skipDeceased, $this->_contactIds
79 * List available tokens for this form.
83 public function listTokens() {
84 $tokens = CRM_Core_SelectValues
::contactTokens();
85 $tokens = array_merge(CRM_Core_SelectValues
::membershipTokens(), $tokens);