CRM-18108 Fix choosing A/B testing as final
authorscardinius <scardinius@chords.pl>
Tue, 12 Apr 2016 13:12:40 +0000 (15:12 +0200)
committerscardinius <scardinius@chords.pl>
Tue, 12 Apr 2016 13:12:40 +0000 (15:12 +0200)
ang/crmMailingAB/EditCtrl.js

index 914280125cb71d9a57d324a95a5675862a1460e9..b189bafcd78fab9f85afe99bf27ee9e1d28964bf 100644 (file)
         // TODO review fields exposed in UI and make sure the sync rules match
         switch (abtest.ab.testing_criteria) {
           case 'subject':
-            crmMailingMgr.mergeInto(abtest.mailings.b, abtest.mailings.a, [
+            var exclude_subject = [
               'name',
               'recipients',
               'subject'
-            ]);
+            ];
+            crmMailingMgr.mergeInto(abtest.mailings.b, abtest.mailings.a, exclude_subject);
+            crmMailingMgr.mergeInto(abtest.mailings.c, abtest.mailings.a, exclude_subject);
             break;
           case 'from':
-            crmMailingMgr.mergeInto(abtest.mailings.b, abtest.mailings.a, [
+            var exclude_from = [
               'name',
               'recipients',
               'from_name',
               'from_email'
-            ]);
+            ];
+            crmMailingMgr.mergeInto(abtest.mailings.b, abtest.mailings.a, exclude_from);
+            crmMailingMgr.mergeInto(abtest.mailings.c, abtest.mailings.a, exclude_from);
             break;
           case 'full_email':
-            crmMailingMgr.mergeInto(abtest.mailings.b, abtest.mailings.a, [
+            var exclude_full_email = [
               'name',
               'recipients',
               'subject',
               'override_verp', // keep override_verp and replyto_Email linked
               'body_html',
               'body_text'
-            ]);
+            ];
+            crmMailingMgr.mergeInto(abtest.mailings.b, abtest.mailings.a, exclude_full_email);
+            crmMailingMgr.mergeInto(abtest.mailings.c, abtest.mailings.a, exclude_full_email);
             break;
           default:
             throw "Unrecognized testing_criteria";
         }
       }
-      crmMailingMgr.mergeInto(abtest.mailings.c, abtest.mailings.a, ['name']);
       return true;
     };