Listing.html stage 2
authoraditya-nambiar <aditya.nambiar007@gmail.com>
Sun, 27 Jul 2014 14:07:52 +0000 (19:37 +0530)
committeraditya-nambiar <aditya.nambiar007@gmail.com>
Sun, 27 Jul 2014 14:07:52 +0000 (19:37 +0530)
js/angular-crmMailingAB.js
partials/abtesting/main.html

index 3c0b80434cb18eea49afa05003f54b0358e52141..312760ad18c8164a6216db5a622b9c67342ed79d 100644 (file)
@@ -39,6 +39,7 @@
               return crmApi('MailingAB', 'getsingle', {id: $route.current.params.id});
             }
             else {
+              console.log("created");
               //created_id has been set to my id. Does not save without created_id. Needs to made generic based on the user
               return { just_created:"1"
               };
         { name: 'From Name', url: partialUrl('from_name.html'),val:2},
         {name: 'Two different Emails', url: partialUrl('two_emails.html'),val:3}
       ];
-    if(typeof $scope.template == 'undefined'){
-    console.log("adi");
-      $scope.template = $scope.templates[0];
-  }
-    else{
+    if($scope.currentABTest.just_created != 1){
+
       console.log("adit "+$scope.currentABTest.testing_criteria_id);
 
       $scope.template=$scope.templates[$scope.currentABTest.testing_criteria_id-1];
       console.log($scope.template.val);
+  }
+    else{
+      console.log("adi");
+      $scope.template = $scope.templates[0];
     }
 
     mltokens = CRM.crmMailing.mailTokens;
           dateFormat: "yy-mm-dd",
           onSelect: function(date) {
             $(".ui-datepicker a").removeAttr("href");
-            scope.scheddate.date=date.toString();
+            scope.currentABTest.date=date.toString();
             scope.$apply();
-            console.log(scope.scheddate.date);
+            console.log(scope.currentABTest.date);
           }
         });
       }
index a612dd3a04d9da2863b4fc22b3917e541e54c4d9..9018d52e7e91ffbc9a97710c7de1d9ccea4cf41a 100644 (file)
@@ -1,6 +1,6 @@
 <div>
   {{tab_val}}<br>
-  
+
   <div ui-jq="tabs" id="alltabs">
     <ul>