3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
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 +--------------------------------------------------------------------+
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
17 class CRM_Mailing_Controller_Send
extends CRM_Core_Controller
{
23 * @param bool|int $action
28 public function __construct($title = NULL, $action = CRM_Core_Action
::NONE
, $modal = TRUE) {
29 parent
::__construct($title, $modal, NULL, FALSE, TRUE);
31 // New: civicrm/mailing/send?reset=1
32 // Re-use: civicrm/mailing/send?reset=1&mid=%%mid%%
33 // Continue: civicrm/mailing/send?reset=1&mid=%%mid%%&continue=true
34 $mid = CRM_Utils_Request
::retrieve('mid', 'Positive');
35 $continue = CRM_Utils_Request
::retrieve('continue', 'String');
37 CRM_Utils_System
::redirect(CRM_Utils_System
::url('civicrm/a/', NULL, TRUE, '/mailing/new'));
39 if ($mid && $continue) {
40 //CRM-15979 - check if abtest exist for mailing then redirect accordingly
41 $abtest = CRM_Mailing_BAO_MailingAB
::getABTest($mid);
42 if (!empty($abtest) && !empty($abtest->id
)) {
43 $redirect = CRM_Utils_System
::url('civicrm/a/', NULL, TRUE, '/abtest/' . $abtest->id
);
46 $redirect = CRM_Utils_System
::url('civicrm/a/', NULL, TRUE, '/mailing/' . $mid);
48 CRM_Utils_System
::redirect($redirect);
50 if ($mid && !$continue) {
51 $clone = civicrm_api3('Mailing', 'clone', ['id' => $mid]);
52 CRM_Utils_System
::redirect(CRM_Utils_System
::url('civicrm/a/', NULL, TRUE, '/mailing/' . $clone['id']));