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 TO |
16 | */ |
17 | ||
18 | /** | |
b6c94f42 | 19 | * This class provides the functionality to email a group of contacts. |
6a488035 TO |
20 | */ |
21 | class CRM_Activity_Form_Task_Email extends CRM_Activity_Form_Task { | |
22 | ||
23 | /** | |
24 | * Are we operating in "single mode", i.e. sending email to one | |
25 | * specific contact? | |
26 | * | |
d51c6add | 27 | * @var bool |
6a488035 TO |
28 | */ |
29 | public $_single = FALSE; | |
30 | ||
31 | public $_noEmails = FALSE; | |
32 | ||
33 | /** | |
fe482240 | 34 | * All the existing templates in the system. |
6a488035 TO |
35 | * |
36 | * @var array | |
37 | */ | |
38 | public $_templates = NULL; | |
39 | ||
40 | /** | |
fe482240 | 41 | * Build all the data structures needed to build the form. |
95ea96be | 42 | */ |
bed98343 | 43 | public function preProcess() { |
6a488035 TO |
44 | CRM_Contact_Form_Task_EmailCommon::preProcessFromAddress($this); |
45 | parent::preProcess(); | |
46 | ||
47 | // we have all the contribution ids, so now we get the contact ids | |
48 | parent::setContactIDs(); | |
49 | ||
50 | $this->assign('single', $this->_single); | |
51 | } | |
52 | ||
53 | /** | |
fe482240 | 54 | * Build the form object. |
6a488035 TO |
55 | */ |
56 | public function buildQuickForm() { | |
7808aae6 | 57 | // Enable form element. |
6a488035 TO |
58 | $this->assign('emailTask', TRUE); |
59 | ||
60 | CRM_Contact_Form_Task_EmailCommon::buildQuickForm($this); | |
61 | } | |
62 | ||
63 | /** | |
fe482240 | 64 | * Process the form after the input has been submitted and validated. |
6a488035 TO |
65 | */ |
66 | public function postProcess() { | |
67 | CRM_Contact_Form_Task_EmailCommon::postProcess($this); | |
68 | } | |
96025800 | 69 | |
5ec6b0ad TM |
70 | /** |
71 | * List available tokens for this form. | |
72 | * | |
73 | * @return array | |
74 | */ | |
75 | public function listTokens() { | |
76 | $tokens = CRM_Core_SelectValues::contactTokens(); | |
77 | return $tokens; | |
78 | } | |
79 | ||
6a488035 | 80 | } |