Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
bc77d7c0 | 4 | | Copyright CiviCRM LLC. All rights reserved. | |
6a488035 | 5 | | | |
bc77d7c0 TO |
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 | | |
6a488035 | 9 | +--------------------------------------------------------------------+ |
d25dd0ee | 10 | */ |
6a488035 TO |
11 | |
12 | /** | |
13 | * | |
14 | * @package CRM | |
ca5cec67 | 15 | * @copyright CiviCRM LLC https://civicrm.org/licensing |
6a488035 | 16 | * $Id: Email.php 45499 2013-02-08 12:31:05Z kurund $ |
6a488035 TO |
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 | * | |
d51c6add | 29 | * @var bool |
6a488035 TO |
30 | */ |
31 | public $_single = FALSE; | |
32 | ||
33 | /** | |
34 | * Are we operating in "single mode", i.e. sending email to one | |
35 | * specific contact? | |
36 | * | |
d51c6add | 37 | * @var bool |
6a488035 TO |
38 | */ |
39 | public $_noEmails = FALSE; | |
40 | ||
41 | /** | |
66f9e52b | 42 | * All the existing templates in the system. |
6a488035 TO |
43 | * |
44 | * @var array | |
45 | */ | |
46 | public $_templates = NULL; | |
47 | ||
48 | /** | |
5c9ff055 | 49 | * Build all the data structures needed to build the form. |
95ea96be | 50 | */ |
d8689418 | 51 | public function preProcess() { |
6a488035 TO |
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 | /** | |
0965e988 | 62 | * Build the form object. |
6a488035 TO |
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 | /** | |
0965e988 | 72 | * Process the form after the input has been submitted and validated. |
6a488035 TO |
73 | */ |
74 | public function postProcess() { | |
75 | CRM_Contact_Form_Task_EmailCommon::postProcess($this); | |
76 | } | |
96025800 | 77 | |
5ec6b0ad TM |
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 | ||
6a488035 | 88 | } |