Merge pull request #15815 from artfulrobot/issue-1108-fix-unsubscribe
[civicrm-core.git] / CRM / Activity / Form / Task / SMS.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 * @package CRM
14 * @copyright CiviCRM LLC https://civicrm.org/licensing
15 */
16
17 /**
18 * This class provides the functionality to sms a group of contacts.
19 */
20 class CRM_Activity_Form_Task_SMS extends CRM_Activity_Form_Task {
21
22 /**
23 * Are we operating in "single mode", i.e. sending sms to one
24 * specific contact?
25 *
26 * @var bool
27 */
28 public $_single = FALSE;
29
30 /**
31 * All the existing templates in the system.
32 *
33 * @var array
34 */
35 public $_templates = NULL;
36
37 /**
38 * Build all the data structures needed to build the form.
39 */
40 public function preProcess() {
41 parent::preProcess();
42 CRM_Contact_Form_Task_SMSCommon::preProcessProvider($this);
43 $this->assign('single', $this->_single);
44 }
45
46 /**
47 * Build the form object.
48 */
49 public function buildQuickForm() {
50 // Enable form element.
51 $this->assign('SMSTask', TRUE);
52 CRM_Contact_Form_Task_SMSCommon::buildQuickForm($this);
53 }
54
55 /**
56 * Process the form after the input has been submitted and validated.
57 */
58 public function postProcess() {
59 CRM_Contact_Form_Task_SMSCommon::postProcess($this);
60 }
61
62 /**
63 * List available tokens for this form.
64 *
65 * @return array
66 */
67 public function listTokens() {
68 $tokens = CRM_Core_SelectValues::contactTokens();
69 return $tokens;
70 }
71
72 }