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 contacts.
21 class CRM_Case_Form_Task_PDF
extends CRM_Case_Form_Task
{
23 use CRM_Contact_Form_Task_PDFTrait
;
26 * All the existing templates in the system.
30 public $_templates = NULL;
32 public $_single = NULL;
37 * Build all the data structures needed to build the form.
39 public function preProcess() {
40 CRM_Contact_Form_Task_PDFLetterCommon
::preProcess($this);
41 $this->skipOnHold
= $this->skipDeceased
= FALSE;
43 $this->setContactIDs();
47 * Process the form after the input has been submitted and validated.
49 public function postProcess() {
50 CRM_Contact_Form_Task_PDFLetterCommon
::postProcess($this);
54 * List available tokens for this form.
58 public function listTokens() {
59 $tokens = CRM_Core_SelectValues
::contactTokens();
60 foreach ($this->_entityIds
as $key => $caseId) {
61 $caseTypeId = CRM_Core_DAO
::getFieldValue('CRM_Case_DAO_Case', $caseId, 'case_type_id');
62 $tokens +
= CRM_Core_SelectValues
::caseTokens($caseTypeId);