Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
fee14197 | 4 | | CiviCRM version 5 | |
6a488035 | 5 | +--------------------------------------------------------------------+ |
6b83d5bd | 6 | | Copyright CiviCRM LLC (c) 2004-2019 | |
6a488035 TO |
7 | +--------------------------------------------------------------------+ |
8 | | This file is a part of CiviCRM. | | |
9 | | | | |
10 | | CiviCRM is free software; you can copy, modify, and distribute it | | |
11 | | under the terms of the GNU Affero General Public License | | |
12 | | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | | |
13 | | | | |
14 | | CiviCRM is distributed in the hope that it will be useful, but | | |
15 | | WITHOUT ANY WARRANTY; without even the implied warranty of | | |
16 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | | |
17 | | See the GNU Affero General Public License for more details. | | |
18 | | | | |
19 | | You should have received a copy of the GNU Affero General Public | | |
20 | | License and the CiviCRM Licensing Exception along | | |
21 | | with this program; if not, contact CiviCRM LLC | | |
22 | | at info[AT]civicrm[DOT]org. If you have questions about the | | |
23 | | GNU Affero General Public License or the licensing of CiviCRM, | | |
24 | | see the CiviCRM license FAQ at http://civicrm.org/licensing | | |
25 | +--------------------------------------------------------------------+ | |
d25dd0ee | 26 | */ |
6a488035 | 27 | |
7808aae6 SB |
28 | /** |
29 | * @package CRM | |
6b83d5bd | 30 | * @copyright CiviCRM LLC (c) 2004-2019 |
7808aae6 SB |
31 | */ |
32 | ||
6a488035 | 33 | /** |
b6c94f42 | 34 | * This class provides the functionality to sms a group of contacts. |
6a488035 TO |
35 | */ |
36 | class CRM_Activity_Form_Task_SMS extends CRM_Activity_Form_Task { | |
37 | ||
38 | /** | |
39 | * Are we operating in "single mode", i.e. sending sms to one | |
40 | * specific contact? | |
41 | * | |
d51c6add | 42 | * @var bool |
6a488035 TO |
43 | */ |
44 | public $_single = FALSE; | |
45 | ||
46 | /** | |
fe482240 | 47 | * All the existing templates in the system. |
6a488035 TO |
48 | * |
49 | * @var array | |
50 | */ | |
51 | public $_templates = NULL; | |
52 | ||
53 | /** | |
fe482240 | 54 | * Build all the data structures needed to build the form. |
6a488035 | 55 | */ |
00be9182 | 56 | public function preProcess() { |
6a488035 TO |
57 | parent::preProcess(); |
58 | CRM_Contact_Form_Task_SMSCommon::preProcessProvider($this); | |
59 | $this->assign('single', $this->_single); | |
60 | } | |
61 | ||
62 | /** | |
fe482240 | 63 | * Build the form object. |
6a488035 TO |
64 | */ |
65 | public function buildQuickForm() { | |
7808aae6 | 66 | // Enable form element. |
6a488035 TO |
67 | $this->assign('SMSTask', TRUE); |
68 | CRM_Contact_Form_Task_SMSCommon::buildQuickForm($this); | |
69 | } | |
70 | ||
71 | /** | |
fe482240 | 72 | * Process the form after the input has been submitted and validated. |
6a488035 TO |
73 | */ |
74 | public function postProcess() { | |
75 | CRM_Contact_Form_Task_SMSCommon::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 | } |