9ce1baed9c71cdfb82a34ebc1a8eaa1b1231c12c
[civicrm-core.git] / CRM / Event / Form / Task / PDF.php
1 <?php
2
3 /*
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 +--------------------------------------------------------------------+
11 */
12
13 /**
14 *
15 * @package CRM
16 * @copyright CiviCRM LLC https://civicrm.org/licensing
17 * $Id: PDF.php 45499 2013-02-08 12:31:05Z kurund $
18 */
19
20 /**
21 * This class provides the functionality to create PDF letter for a group of
22 * participants or a single participant.
23 */
24 class CRM_Event_Form_Task_PDF extends CRM_Event_Form_Task {
25
26 use CRM_Contact_Form_Task_PDFTrait;
27
28 /**
29 * Are we operating in "single mode", i.e. printing letter to one
30 * specific participant?
31 *
32 * @var bool
33 */
34 public $_single = FALSE;
35
36 /**
37 * All the existing templates in the system.
38 *
39 * @var array
40 */
41 public $_templates = NULL;
42 public $_cid = NULL;
43 public $_activityId = NULL;
44
45 /**
46 * Build all the data structures needed to build the form.
47 */
48 public function preProcess() {
49 $this->preProcessPDF();
50 parent::preProcess();
51
52 // we have all the participant ids, so now we get the contact ids
53 parent::setContactIDs();
54
55 $this->assign('single', $this->_single);
56 }
57
58 /**
59 * Process the form after the input has been submitted and validated.
60 */
61 public function postProcess() {
62 CRM_Contact_Form_Task_PDFLetterCommon::postProcess($this);
63 }
64
65 /**
66 * List available tokens for this form.
67 *
68 * @return array
69 */
70 public function listTokens() {
71 $tokens = CRM_Core_SelectValues::contactTokens();
72 return $tokens;
73 }
74
75 }