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
21 * This class provides the functionality to create PDF letter for a group of
22 * contacts or a single contact.
24 class CRM_Member_Form_Task_PDFLetter
extends CRM_Member_Form_Task
{
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 CRM_Contact_Form_Task_PDFLetterCommon
::preProcess($this);
52 * @see CRM_Core_Form::setDefaultValues()
54 public function setDefaultValues() {
55 return CRM_Contact_Form_Task_PDFLetterCommon
::setDefaultValues();
59 * Build the form object.
64 public function buildQuickForm() {
66 $this->assign('suppressForm', FALSE);
67 CRM_Contact_Form_Task_PDFLetterCommon
::buildQuickForm($this);
71 * Process the form after the input has been submitted and validated.
76 public function postProcess() {
77 // TODO: rewrite using contribution token and one letter by contribution
78 $this->setContactIDs();
79 $skipOnHold = $this->skipOnHold ??
FALSE;
80 $skipDeceased = $this->skipDeceased ??
TRUE;
81 CRM_Member_Form_Task_PDFLetterCommon
::postProcessMembers(
82 $this, $this->_memberIds
, $skipOnHold, $skipDeceased, $this->_contactIds
87 * List available tokens for this form.
91 public function listTokens() {
92 $tokens = CRM_Core_SelectValues
::contactTokens();
93 $tokens = array_merge(CRM_Core_SelectValues
::membershipTokens(), $tokens);