Merge pull request #15821 from seamuslee001/dev_core_183_custom_group
[civicrm-core.git] / CRM / Event / Form / Task / Email.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
5 | |
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 +--------------------------------------------------------------------+
10 */
11
12 /**
13 *
14 * @package CRM
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
16 * $Id: Email.php 45499 2013-02-08 12:31:05Z kurund $
17 */
18
19 /**
20 * This class provides the functionality to email a group of
21 * contacts.
22 */
23 class CRM_Event_Form_Task_Email extends CRM_Event_Form_Task {
24
25 /**
26 * Are we operating in "single mode", i.e. sending email to one
27 * specific contact?
28 *
29 * @var bool
30 */
31 public $_single = FALSE;
32
33 /**
34 * Are we operating in "single mode", i.e. sending email to one
35 * specific contact?
36 *
37 * @var bool
38 */
39 public $_noEmails = FALSE;
40
41 /**
42 * All the existing templates in the system.
43 *
44 * @var array
45 */
46 public $_templates = NULL;
47
48 /**
49 * Build all the data structures needed to build the form.
50 */
51 public function preProcess() {
52 CRM_Contact_Form_Task_EmailCommon::preProcessFromAddress($this);
53 parent::preProcess();
54
55 // we have all the participant ids, so now we get the contact ids
56 parent::setContactIDs();
57
58 $this->assign('single', $this->_single);
59 }
60
61 /**
62 * Build the form object.
63 */
64 public function buildQuickForm() {
65 //enable form element
66 $this->assign('emailTask', TRUE);
67
68 CRM_Contact_Form_Task_EmailCommon::buildQuickForm($this);
69 }
70
71 /**
72 * Process the form after the input has been submitted and validated.
73 */
74 public function postProcess() {
75 CRM_Contact_Form_Task_EmailCommon::postProcess($this);
76 }
77
78 /**
79 * List available tokens for this form.
80 *
81 * @return array
82 */
83 public function listTokens() {
84 $tokens = CRM_Core_SelectValues::contactTokens();
85 return $tokens;
86 }
87
88 }