CIVICRM-1391 Update Smart Group form unsets the existing Group Types for the Group
[civicrm-core.git] / CRM / Contact / Form / Task / SMS.php
CommitLineData
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/**
424029e3 19 * This class provides the functionality to sms a group of contacts.
6a488035
TO
20 */
21class CRM_Contact_Form_Task_SMS extends CRM_Contact_Form_Task {
22
23 /**
24 * Are we operating in "single mode", i.e. sending sms to one
25 * specific contact?
26 *
d51c6add 27 * @var bool
6a488035
TO
28 */
29 public $_single = FALSE;
30
31 /**
fe482240 32 * All the existing templates in the system.
6a488035
TO
33 *
34 * @var array
35 */
430ae6dd
TO
36 public $_templates = NULL;
37
00be9182 38 public function preProcess() {
6a488035 39
edc80cda 40 $this->_context = CRM_Utils_Request::retrieve('context', 'Alphanumeric', $this);
6a488035
TO
41
42 $cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this, FALSE);
6a488035
TO
43
44 CRM_Contact_Form_Task_SMSCommon::preProcessProvider($this);
45
46 if (!$cid && $this->_context != 'standalone') {
47 parent::preProcess();
48 }
49
50 $this->assign('single', $this->_single);
51 if (CRM_Core_Permission::check('administer CiviCRM')) {
52 $this->assign('isAdmin', 1);
53 }
54 }
55
56 /**
fe482240 57 * Build the form object.
6a488035
TO
58 */
59 public function buildQuickForm() {
60 //enable form element
61 $this->assign('suppressForm', FALSE);
62 $this->assign('SMSTask', TRUE);
63 CRM_Contact_Form_Task_SMSCommon::buildQuickForm($this);
64 }
65
66 /**
fe482240 67 * Process the form after the input has been submitted and validated.
6a488035
TO
68 */
69 public function postProcess() {
70 CRM_Contact_Form_Task_SMSCommon::postProcess($this);
71 }
96025800 72
5ec6b0ad
TM
73 /**
74 * List available tokens for this form.
75 *
76 * @return array
77 */
78 public function listTokens() {
79 $tokens = CRM_Core_SelectValues::contactTokens();
80 return $tokens;
81 }
82
6a488035 83}