Retrieving from DB
authoraditya-nambiar <aditya.nambiar007@gmail.com>
Sun, 27 Jul 2014 07:22:21 +0000 (12:52 +0530)
committeraditya-nambiar <aditya.nambiar007@gmail.com>
Sun, 27 Jul 2014 07:22:21 +0000 (12:52 +0530)
js/angular-crmMailingAB.js
partials/abtesting/main.html
partials/abtesting/subject_lines.html
partials/abtesting/two_emails.html

index b59d33a069f4ca68cba1161a03ed5174e5965a15..a7078cb70188570ddc9feb9f52d0a3454c7a921c 100644 (file)
@@ -58,6 +58,7 @@
   })
   crmMailingAB.controller('TabsDemoCtrl', function ($scope, crmApi,selectedABTest) {
     $scope.abId="";
+    $scope.whatnext=2;
     $scope.currentABTest=selectedABTest
     $scope.groups = CRM.crmMailing.groupNames;
     $scope.mailList = CRM.crmMailing.civiMails;
         console.log($scope.currentABTest.mailing_id_a);
 
         $scope.abId = $scope.currentABTest.id;
-      $scope.mailA = crmApi('Mailing','getsingle',{id:$scope.currentABTest.mailing_id_a});
-      $scope.mailB= crmApi('Mailing','getsingle',{id:$scope.currentABTest.mailing_id_b});
-      console.log($scope.mailA);
+        var abmailA = crmApi('Mailing','getsingle',{id:$scope.currentABTest.mailing_id_a});
+        var abmailB= crmApi('Mailing','getsingle',{id:$scope.currentABTest.mailing_id_b});
+        abmailA.success(function (data) {
+          if (data.is_error == 0) {
+            $scope.mailA = data;
+
+          };
+        });
+        abmailB.success(function(data) {
+          if (data.is_error == 0) {
+            $scope.mailB = data;
+
+          };
+        });
       }
       else{
         console.log("Prithvila");
index d4f971be325f907bffb0155ae740bb155b994b01..54bb7c2bd75edfa6f48d5315bd9d93c1541d2527 100644 (file)
@@ -15,9 +15,9 @@
 
         <h3> What would you like to test ?</h3><br><br>
 
-        &nbsp <input type="radio" ng-model="template" ng-value="templates[0]" ng-init="whatnext=2"> Subject Lines <br/><br>
-        &nbsp <input type="radio" ng-model="template" ng-value="templates[1]" ng-init="whatnext=3"> From Names <br/><br>
-        &nbsp <input type="radio" ng-model="template" ng-value="templates[2]" ng-init="whatnext=1"> Two different Emails <br/><br>
+        &nbsp <input type="radio" ng-model="template" ng-value="templates[0]" ng-click="init(2)"> Subject Lines <br/><br>
+        &nbsp <input type="radio" ng-model="template" ng-value="templates[1]" ng-click="init(3)"> From Names <br/><br>
+        &nbsp <input type="radio" ng-model="template" ng-value="templates[2]" ng-click="init(1)"> Two different Emails <br/><br>
         &nbsp
         <div style="position:relative; left:220px; top: 30px;"  nextbutton></div>
         <div style="position:relative; left:300px; top:-1px;" cancelbutton></div>
@@ -29,7 +29,8 @@
     <div id="tabs-2">
 
       <form>
-        <div  ng-include="template.url"> -->
+        <div  ng-include="template.url">
+
         </div>
         <div style="position:relative; left:200px; top:61px;" prevbutton></div>
         <div style="position:relative; left:300px; top: 30px;" submitform nextbutton></div>
index b4cb969650acdd7cf2a70c143e27cba2688ccfec..63646f3d7a1de4d2884493eb0fe4c730a72aa2d6 100644 (file)
@@ -3,6 +3,7 @@
 
 <div>
 
+
 <table class="form-layout-compressed">
   <tbody>
   <tr>
index daa1101bc24ffb47c68bd11fc8bf1368c3293b5e..e0f8e5c1cf1574128d084ea54cb15e580b666995 100644 (file)
@@ -10,7 +10,7 @@
       <div id="tabs-21">
 
       <div>
-      {{mailA}}
+
 
       <table class="form-layout-compressed">
 
@@ -18,7 +18,7 @@
           <tr>
             <td class="label">From E-mail Address</td>
             <td>
-              {{mailA.subject}}
+
               <select  style="width: 200px" ng-model="mailA.from_email" ng-options="frm.email as frm.email for frm in eMailing">
                 <option value="">-none-</option>
               </select>