Commit | Line | Data |
---|---|---|
9cda9396 TM |
1 | <?php |
2 | ||
3 | /* | |
bc77d7c0 TO |
4 | +--------------------------------------------------------------------+ |
5 | | Copyright CiviCRM LLC. All rights reserved. | | |
6 | | | | |
7 | | This work is published under the GNU AGPLv3 license with some | | |
8 | | permitted exceptions and without any warranty. For full license | | |
9 | | and copyright information, see https://civicrm.org/licensing | | |
10 | +--------------------------------------------------------------------+ | |
9cda9396 TM |
11 | */ |
12 | ||
13 | /** | |
14 | * | |
15 | * @package CRM | |
ca5cec67 | 16 | * @copyright CiviCRM LLC https://civicrm.org/licensing |
9cda9396 TM |
17 | * $Id: PDF.php 45499 2013-02-08 12:31:05Z kurund $ |
18 | */ | |
19 | ||
20 | /** | |
acb298ac TM |
21 | * This class provides the functionality to create PDF letter for a group of |
22 | * participants or a single participant. | |
9cda9396 TM |
23 | */ |
24 | class CRM_Event_Form_Task_PDF extends CRM_Event_Form_Task { | |
25 | ||
26 | /** | |
27 | * Are we operating in "single mode", i.e. printing letter to one | |
acb298ac | 28 | * specific participant? |
9cda9396 | 29 | * |
d51c6add | 30 | * @var bool |
9cda9396 TM |
31 | */ |
32 | public $_single = FALSE; | |
33 | ||
34 | /** | |
35 | * All the existing templates in the system. | |
36 | * | |
37 | * @var array | |
38 | */ | |
39 | public $_templates = NULL; | |
dcedb375 TM |
40 | public $_cid = NULL; |
41 | public $_activityId = NULL; | |
9cda9396 TM |
42 | |
43 | /** | |
44 | * Build all the data structures needed to build the form. | |
45 | */ | |
46 | public function preProcess() { | |
47 | CRM_Contact_Form_Task_PDFLetterCommon::preProcess($this); | |
48 | parent::preProcess(); | |
49 | ||
50 | // we have all the participant ids, so now we get the contact ids | |
51 | parent::setContactIDs(); | |
52 | ||
53 | $this->assign('single', $this->_single); | |
54 | } | |
55 | ||
56 | /** | |
57 | * Build the form object. | |
58 | */ | |
59 | public function buildQuickForm() { | |
60 | CRM_Contact_Form_Task_PDFLetterCommon::buildQuickForm($this); | |
61 | } | |
62 | ||
63 | /** | |
64 | * Process the form after the input has been submitted and validated. | |
65 | */ | |
66 | public function postProcess() { | |
67 | CRM_Contact_Form_Task_PDFLetterCommon::postProcess($this); | |
68 | } | |
69 | ||
9065b8a5 TM |
70 | /** |
71 | * Set default values for the form. | |
72 | * | |
73 | * @return void | |
74 | */ | |
75 | public function setDefaultValues() { | |
76 | return CRM_Contact_Form_Task_PDFLetterCommon::setDefaultValues(); | |
77 | } | |
78 | ||
5ec6b0ad TM |
79 | /** |
80 | * List available tokens for this form. | |
81 | * | |
82 | * @return array | |
83 | */ | |
84 | public function listTokens() { | |
85 | $tokens = CRM_Core_SelectValues::contactTokens(); | |
86 | return $tokens; | |
87 | } | |
88 | ||
9cda9396 | 89 | } |