Email.php 2.99 KB
Newer Older
totten's avatar
totten committed
1 2 3
<?php
/*
 +--------------------------------------------------------------------+
yashodha's avatar
yashodha committed
4
 | CiviCRM version 4.6                                                |
totten's avatar
totten committed
5
 +--------------------------------------------------------------------+
kurund's avatar
kurund committed
6
 | Copyright CiviCRM LLC (c) 2004-2014                                |
totten's avatar
totten committed
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
 +--------------------------------------------------------------------+
 | This file is a part of CiviCRM.                                    |
 |                                                                    |
 | CiviCRM is free software; you can copy, modify, and distribute it  |
 | under the terms of the GNU Affero General Public License           |
 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception.   |
 |                                                                    |
 | CiviCRM is distributed in the hope that it will be useful, but     |
 | WITHOUT ANY WARRANTY; without even the implied warranty of         |
 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.               |
 | See the GNU Affero General Public License for more details.        |
 |                                                                    |
 | You should have received a copy of the GNU Affero General Public   |
 | License and the CiviCRM Licensing Exception along                  |
 | with this program; if not, contact CiviCRM LLC                     |
 | at info[AT]civicrm[DOT]org. If you have questions about the        |
 | GNU Affero General Public License or the licensing of CiviCRM,     |
 | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
 +--------------------------------------------------------------------+
26
 */
totten's avatar
totten committed
27 28 29 30

/**
 *
 * @package CRM
kurund's avatar
kurund committed
31
 * @copyright CiviCRM LLC (c) 2004-2014
totten's avatar
totten committed
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
 * $Id: Email.php 26615 2010-03-21 21:05:35Z kurund $
 *
 */

/**
 * This class provides the functionality to email a group of
 * contacts.
 */
class CRM_Activity_Form_Task_Email extends CRM_Activity_Form_Task {

  /**
   * Are we operating in "single mode", i.e. sending email to one
   * specific contact?
   *
   * @var boolean
   */
  public $_single = FALSE;

  public $_noEmails = FALSE;

  /**
colemanw's avatar
colemanw committed
53
   * All the existing templates in the system
totten's avatar
totten committed
54 55 56 57 58 59
   *
   * @var array
   */
  public $_templates = NULL;

  /**
colemanw's avatar
colemanw committed
60
   * Build all the data structures needed to build the form
totten's avatar
totten committed
61 62
   *
   * @return void
Eileen McNaughton's avatar
Eileen McNaughton committed
63
   */
monishdeb's avatar
monishdeb committed
64
  public function preProcess() {
totten's avatar
totten committed
65 66 67 68 69 70 71 72 73 74
    CRM_Contact_Form_Task_EmailCommon::preProcessFromAddress($this);
    parent::preProcess();

    // we have all the contribution ids, so now we get the contact ids
    parent::setContactIDs();

    $this->assign('single', $this->_single);
  }

  /**
75
   * Build the form object
totten's avatar
totten committed
76 77 78 79 80 81 82 83 84 85 86 87
   *
   *
   * @return void
   */
  public function buildQuickForm() {
    //enable form element
    $this->assign('emailTask', TRUE);

    CRM_Contact_Form_Task_EmailCommon::buildQuickForm($this);
  }

  /**
colemanw's avatar
colemanw committed
88
   * Process the form after the input has been submitted and validated
totten's avatar
totten committed
89 90
   *
   *
colemanw's avatar
colemanw committed
91
   * @return void
totten's avatar
totten committed
92 93 94 95
   */
  public function postProcess() {
    CRM_Contact_Form_Task_EmailCommon::postProcess($this);
  }
96

totten's avatar
totten committed
97
}