* @param int $mailingID
* Mailing ID.
*
- * @return int
+ * @return object
*/
public static function getABTest($mailingID) {
$query = "SELECT * FROM `civicrm_mailing_abtest` ab
-- CRM-15578 Require access CiviMail permission for A/B Testing feature
UPDATE civicrm_navigation
SET permission = 'access CivMail', permission_operator = ''
-WHERE name = 'New A/B Test' OR name = 'Manage A/B Tests'
-{*--CRM-15979 - differentiate between standalone mailings, A/B tests, and A/B final-winner *}
-ALTER TABLE `civicrm_mailing` ADD mailing_type varchar(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci COMMENT 'differentiate between standalone mailings, A/B tests, and A/B final-winner';
-
-UPDATE `civicrm_mailing`cm
-LEFT JOIN civicrm_mailing_abtest ab
-ON cm.id = ab.mailing_id_a
- OR cm.id = ab.mailing_id_b
- OR cm.id = ab.mailing_id_c
- SET `mailing_type` = CASE
- WHEN cm.id IN (ab.mailing_id_a,ab.mailing_id_b) THEN 'experiment'
- WHEN cm.id IN (ab.mailing_id_c) THEN 'winner'
- ELSE 'standalone'
- END
-WHERE cm.id IS NOT NULL
+WHERE name = 'New A/B Test' OR name = 'Manage A/B Tests';
{* file to handle db changes in 4.6.beta3 during upgrade *}
+
+{*--CRM-15979 - differentiate between standalone mailings, A/B tests, and A/B final-winner *}
+ALTER TABLE `civicrm_mailing` ADD mailing_type varchar(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci COMMENT 'differentiate between standalone mailings, A/B tests, and A/B final-winner';
+
+UPDATE `civicrm_mailing`cm
+LEFT JOIN civicrm_mailing_abtest ab
+ON cm.id = ab.mailing_id_a
+ OR cm.id = ab.mailing_id_b
+ OR cm.id = ab.mailing_id_c
+ SET `mailing_type` = CASE
+ WHEN cm.id IN (ab.mailing_id_a,ab.mailing_id_b) THEN 'experiment'
+ WHEN cm.id IN (ab.mailing_id_c) THEN 'winner'
+ ELSE 'standalone'
+ END
+WHERE cm.id IS NOT NULL;
$safeParams = $params;
}
$safeParams['_evil_bao_validator_'] = 'CRM_Mailing_BAO_Mailing::checkSendable';
- if (empty($params['mailing_type'])) {
- $params['mailing_type'] = 'standalone';
- }
return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $safeParams);
}
$params['reply_id']['api.default'] = CRM_Mailing_PseudoConstant::defaultComponent('Reply', '');
$params['resubscribe_id']['api.default'] = CRM_Mailing_PseudoConstant::defaultComponent('Resubscribe', '');
$params['unsubscribe_id']['api.default'] = CRM_Mailing_PseudoConstant::defaultComponent('Unsubscribe', '');
-
+ $params['mailing_type']['api.default'] = 'standalone';
$defaultAddress = CRM_Core_OptionGroup::values('from_email_address', NULL, NULL, NULL, ' AND is_default = 1');
foreach ($defaultAddress as $id => $value) {
if (preg_match('/"(.*)" <(.*)>/', $value, $match)) {
// want to force-enable tracking.
open_tracking: "1",
url_tracking: "1",
- mailing_type:"experiment",
+ mailing_type:"experiment"
};
crmMailingAB.mailings.a = crmMailingMgr.create(mailingDefaults);
crmMailingAB.mailings.b = crmMailingMgr.create(mailingDefaults);