From: aditya-nambiar Date: Wed, 18 Jun 2014 18:58:17 +0000 (-0400) Subject: Mailing db updateb in all 3 cases X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=d340146d44effedcc2af7f97820b00174cfcc6cf;p=civicrm-core.git Mailing db updateb in all 3 cases --- diff --git a/js/angular-crmMailingAB.js b/js/angular-crmMailingAB.js index 48e884e22b..5e8afbb8f0 100644 --- a/js/angular-crmMailingAB.js +++ b/js/angular-crmMailingAB.js @@ -11,6 +11,12 @@ var crmMailingAB = angular.module('crmMailingAB', ['ngRoute', 'ui.utils']); + crmMailingAB.run(function($rootScope, $templateCache) { + $rootScope.$on('$viewContentLoaded', function() { + $templateCache.removeAll(); + }); + }); + crmMailingAB.config(['$routeProvider', function($routeProvider) { $routeProvider.when('/mailing', { @@ -84,12 +90,28 @@ $scope.send_date ="10/4/2004"; + $scope.mailA={}; + + $scope.mailB={}; + $scope.save=function(dat){ + + var result= crmApi('Mailing', 'create',dat, true); + console.log("Ac "+result); + }; + + $scope.init=function(par){ + + $scope.whatnext=par.toString() + } + + }); crmMailingAB.directive('nexttab', function() { return { // Restrict it to be an attribute in this case restrict: 'A', + priority: 500, // responsible for registering DOM listeners as well as updating the DOM link: function(scope, element, attrs) { @@ -102,11 +124,10 @@ var myArray1 = new Array( ); for ( var i = scope.tab_val+1; i < 4; i++ ) { myArray1.push(i); - console.log( "try " + i ); } $(element).parent().parent().parent().tabs( "option", "disabled", myArray1 ); $(element).parent().parent().parent().tabs({active:scope.tab_val}); - console.log("adiroxxx"); + console.log("Adir"); }); } }; @@ -188,4 +209,54 @@ } }; }); + + crmMailingAB.directive('submitform',function(){ + return { + restrict:'A', + priority: 1000, + link: function(scope,element,attrs){ + $(element).on("click",function() { + + console.log("clicked"); + scope.save({ + "sequential": 1, + "name": "Aditya Nambiar", + "subject": scope.mailA.subj, + "created_id": "2", + "from_email": scope.mailA.fromEmail, + "body_text": scope.mailA.body + + }); + console.log("Truth "+ scope.whatnext) + + if(scope.whatnext=="3"){ + console.log("sdf"); + scope.mailB.subj=scope.mailA.subj; + scope.mailB.body=scope.mailA.body; + + } + else if(scope.whatnext=="2"){ + scope.mailB.fromEmail=scope.mailA.fromEmail; + scope.mailB.body=scope.mailA.body; + + } + + + scope.save({ + "sequential": 1, + "name": "Aditya Nambiar", + "subject": scope.mailB.subj, + "created_id": "2", + "from_email": scope.mailB.fromEmail, + "body_text": scope.mailB.body + + }); + + }); + } + }; + + }); + + })(angular, CRM.$, CRM._); \ No newline at end of file diff --git a/partials/abtesting/from_name.html b/partials/abtesting/from_name.html index 1c22cc02de..90455b8181 100644 --- a/partials/abtesting/from_name.html +++ b/partials/abtesting/from_name.html @@ -4,16 +4,17 @@

 
-        From Email Address A: 
- From Email Address B:
+ From Email Address A:
+ From Email Address B:
Use Template :
- Mail Subject:
+ Mail Subject:
- +
\ No newline at end of file diff --git a/partials/abtesting/helloworld.html b/partials/abtesting/helloworld.html index f7c08a4e09..9b57e092ed 100644 --- a/partials/abtesting/helloworld.html +++ b/partials/abtesting/helloworld.html @@ -25,7 +25,8 @@
-
+ gghvjhkv +
diff --git a/partials/abtesting/subject_lines.html b/partials/abtesting/subject_lines.html index 4522eb2923..c44a656783 100644 --- a/partials/abtesting/subject_lines.html +++ b/partials/abtesting/subject_lines.html @@ -4,15 +4,16 @@

 
-        From Email Address: 
+ From Email Address:
Use Template :
- Mail Subject A:
- Mail Subject B:
+ Mail Subject A:
+ Mail Subject B:
- +
diff --git a/partials/abtesting/two_emails.html b/partials/abtesting/two_emails.html index 1e09b7f6ac..c5252d4322 100644 --- a/partials/abtesting/two_emails.html +++ b/partials/abtesting/two_emails.html @@ -8,22 +8,22 @@
- From Email Address :
- Use Template :
- Mail Subject:
+ From Email Address :
+ Use Template :
+ Mail Subject:
-
- From Email Address :
+ From Email Address :
Use Template :
- Mail Subject:
+ Mail Subject:
- @@ -33,4 +33,5 @@
+ \ No newline at end of file