Merge pull request #16005 from magnolia61/Contribution_Invoice_Privacy
[civicrm-core.git] / CRM / Member / 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 /**
21 * This class provides the functionality to email a group of
22 * contacts.
23 */
24 class CRM_Member_Form_Task_Email extends CRM_Member_Form_Task {
25
26 /**
27 * Are we operating in "single mode", i.e. sending email to one
28 * specific contact?
29 *
30 * @var bool
31 */
32 public $_single = FALSE;
33
34 /**
35 * Are we operating in "single mode", i.e. sending email to one
36 * specific contact?
37 *
38 * @var bool
39 */
40 public $_noEmails = FALSE;
41
42 /**
43 * All the existing templates in the system.
44 *
45 * @var array
46 */
47 public $_templates = NULL;
48
49 /**
50 * Build all the data structures needed to build the form.
51 *
52 * @return void
53 */
54 public function preProcess() {
55 CRM_Contact_Form_Task_EmailCommon::preProcessFromAddress($this);
56 parent::preProcess();
57
58 // we have all the membership ids, so now we get the contact ids
59 parent::setContactIDs();
60
61 $this->assign('single', $this->_single);
62 }
63
64 /**
65 * Build the form object.
66 *
67 *
68 * @return void
69 */
70 public function buildQuickForm() {
71 //enable form element
72 $this->assign('emailTask', TRUE);
73
74 CRM_Contact_Form_Task_EmailCommon::buildQuickForm($this);
75 }
76
77 /**
78 * Process the form after the input has been submitted and validated.
79 *
80 *
81 * @return void
82 */
83 public function postProcess() {
84 CRM_Contact_Form_Task_EmailCommon::postProcess($this);
85 }
86
87 /**
88 * List available tokens for this form.
89 *
90 * @return array
91 */
92 public function listTokens() {
93 $tokens = CRM_Core_SelectValues::contactTokens();
94 return $tokens;
95 }
96
97 }