3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2015 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
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. |
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. |
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 +--------------------------------------------------------------------+
31 * @copyright CiviCRM LLC (c) 2004-2015
37 * Build the form object for disable mail feature
43 class CRM_Mailing_Form_Browse
extends CRM_Core_Form
{
46 * Heart of the viewing process. The runner gets all the meta data for
47 * the contact and calls the appropriate type of page to view.
51 public function preProcess() {
52 $this->_mailingId
= CRM_Utils_Request
::retrieve('mid', 'Positive', $this);
53 $this->_action
= CRM_Utils_Request
::retrieve('action', 'String', $this);
55 // check for action permissions.
56 if (!CRM_Core_Permission
::checkActionPermission('CiviMail', $this->_action
)) {
57 CRM_Core_Error
::fatal(ts('You do not have permission to access this page.'));
60 $mailing = new CRM_Mailing_BAO_Mailing();
61 $mailing->id
= $this->_mailingId
;
63 if ($mailing->find(TRUE)) {
64 $subject = $mailing->subject
;
66 $this->assign('subject', $subject);
70 * Build the form object.
74 public function buildQuickForm() {
75 $this->addButtons(array(
78 'name' => ts('Confirm'),
83 'name' => ts('Cancel'),
93 public function postProcess() {
94 if ($this->_action
& CRM_Core_Action
::DELETE
) {
95 CRM_Mailing_BAO_Mailing
::del($this->_mailingId
);
97 elseif ($this->_action
& CRM_Core_Action
::DISABLE
) {
98 CRM_Mailing_BAO_MailingJob
::cancel($this->_mailingId
);
100 elseif ($this->_action
& CRM_Core_Action
::RENEW
) {
101 //set is_archived to 1
102 CRM_Core_DAO
::setFieldValue('CRM_Mailing_DAO_Mailing', $this->_mailingId
, 'is_archived', TRUE);