From ec0e47c86ff9c86ec678936a2c4777bc79d4d116 Mon Sep 17 00:00:00 2001 From: Siddhant Rajagopalan Date: Tue, 19 Aug 2014 15:20:17 +0530 Subject: [PATCH] renamed some files --- js/angular-newMailing.js | 967 ------------------ partials/crmMailingType/attachments.html | 35 - partials/crmMailingType/composeonScreen.html | 17 - partials/crmMailingType/content.html | 98 -- partials/crmMailingType/headerandFooter.html | 25 - partials/crmMailingType/ht.html | 15 - partials/crmMailingType/mailingGroup.html | 20 - partials/crmMailingType/mailingList.html | 46 - partials/crmMailingType/main.html | 25 - partials/crmMailingType/plainText.html | 14 - partials/crmMailingType/previewMailing.html | 18 - partials/crmMailingType/preview_ht.html | 22 - .../crmMailingType/preview_plaintext.html | 17 - partials/crmMailingType/recipient.html | 56 - partials/crmMailingType/sched.html | 39 - partials/crmMailingType/send.html | 61 -- partials/crmMailingType/test.html | 31 - partials/crmMailingType/trackandRespond.html | 100 -- partials/crmMailingType/uploadContent.html | 17 - 19 files changed, 1623 deletions(-) delete mode 100644 js/angular-newMailing.js delete mode 100644 partials/crmMailingType/attachments.html delete mode 100644 partials/crmMailingType/composeonScreen.html delete mode 100644 partials/crmMailingType/content.html delete mode 100644 partials/crmMailingType/headerandFooter.html delete mode 100644 partials/crmMailingType/ht.html delete mode 100644 partials/crmMailingType/mailingGroup.html delete mode 100644 partials/crmMailingType/mailingList.html delete mode 100644 partials/crmMailingType/main.html delete mode 100644 partials/crmMailingType/plainText.html delete mode 100644 partials/crmMailingType/previewMailing.html delete mode 100644 partials/crmMailingType/preview_ht.html delete mode 100644 partials/crmMailingType/preview_plaintext.html delete mode 100644 partials/crmMailingType/recipient.html delete mode 100644 partials/crmMailingType/sched.html delete mode 100644 partials/crmMailingType/send.html delete mode 100644 partials/crmMailingType/test.html delete mode 100644 partials/crmMailingType/trackandRespond.html delete mode 100644 partials/crmMailingType/uploadContent.html diff --git a/js/angular-newMailing.js b/js/angular-newMailing.js deleted file mode 100644 index efef13cd6c..0000000000 --- a/js/angular-newMailing.js +++ /dev/null @@ -1,967 +0,0 @@ -(function(angular, $, _) { -//partials for the html pages - var partialUrl = function(relPath) { - return CRM.resourceUrls['civicrm'] + '/partials/crmMailingType/' + relPath; - }; - - var crmMailing = angular.module('crmMailing', ['ngRoute', 'ui.utils','ngSanitize']); - var chck = []; //to fill the group variable $scope.incGroup - var chck2= []; // to get id and text in the required format - var mltokens = []; - var global = 0; -//------------------------------------------------------------------------------------------------------- - crmMailing.config(['$routeProvider', - function($routeProvider) { - $routeProvider.when('/mailing', { - templateUrl: partialUrl('mailingList.html'), - controller: 'mailingListCtrl', - resolve: { - mailingList: function($route, crmApi) { - return crmApi('Mailing', 'get', {}); - } - - } - }); //This route is used for generating the list of mails created. - - - - $routeProvider.when('/mailing/:id', { - templateUrl: partialUrl('main.html'), - controller: 'mailingCtrl', - resolve: { - selectedMail: function($route, crmApi) { - if ( $route.current.params.id !== 'new') { - return crmApi('Mailing', 'getsingle', {id: $route.current.params.id}); - } - else { - //created_id has been set to my id. Does not save without created_id. Needs to made generic based on the user - return {visibility: "Public Pages", url_tracking:"1",dedupe_email:"1", forward_replies:"0", auto_responder:"0", open_tracking:"1" - }; - } - } - } - }); //This route is used for creating new mails and editing the current mails - } - ]); -//----------------------------------------- - - -//This controller is used in creating new mail and editing current mails - crmMailing.controller('mailingCtrl', function($scope, crmApi, selectedMail, $location,$route, $sce, $window) { - - //setting variables to the values we have got to the api - $scope.submitted = false; - $scope.partialUrl = partialUrl; - $scope.campaignList = CRM.crmMailing.campNames; - $scope.mailList = CRM.crmMailing.civiMails; - $scope.mailNameList = _.pluck(CRM.crmCaseType.civiMails, 'name'); - $scope.groupNamesList = CRM.crmMailing.groupNames; - $scope.headerfooter = CRM.crmMailing.headerfooterList; - $scope.fromAddress = CRM.crmMailing.fromAddress; - console.log($scope.fromAddress); - $scope.tmpList = CRM.crmMailing.mesTemplate; - $scope.mailingGrp = CRM.crmMailing.mailGrp; - $scope.user_id = CRM.crmMailing.contactid; - $scope.currentMailing = selectedMail; - $scope.currentMailing.created_id = $scope.user_id; - mltokens = CRM.crmMailing.mailTokens; - $scope.pre = false; - $scope.noOfRecipients = 0; - $scope.testMailing = {}; - $scope.testMailing.name = ""; - $scope.testMailing.group = ""; - window.ct = $scope.currentMailing; - $scope.previewbody_html = ""; - $scope.previewbody_text = ""; - $scope.preview_subject = ""; - $scope.param = {}; - $scope.token = ""; - chck = []; - chck2 = []; - $scope.from = {}; - $scope.from.name = ""; - $scope.from.email = ""; - $scope.from.total = ""; - $scope.reply ={}; - $scope.reply.email = ""; - $scope.replyaddress = []; - for(var a in $scope.fromAddress){ - var b = {}; - var splt = $scope.fromAddress[a].label.split(" "); - splt = splt[1].substring(1,(splt[1].length-1)); - b.email = splt; - $scope.replyaddress.push(b); - } - - if ($scope.currentMailing.from_name != null) { - $scope.from.name = $scope.currentMailing.from_name; - $scope.from.email = $scope.currentMailing.from_email; - $scope.from.total = $scope.from.name + " <" + $scope.from.email + ">"; - console.log($scope.from.total); - $scope.reply.email = $scope.currentMailing.replyto_email; - } - - $scope.mailid = []; - - for (var a in $scope.mailingGrp) { - if ($scope.mailingGrp[a].mailing_id==$scope.currentMailing.id) { - var b = $scope.mailingGrp[a].entity_id + " " + $scope.mailingGrp[a].entity_table +" " + $scope.mailingGrp[a].group_type; - var c = $scope.mailingGrp[a].id; - chck.push(b); - $scope.mailid.push(c); - } - } - - console.log(chck); - console.log($scope.mailid); - if ($scope.currentMailing.msg_template_id!=null) { - $scope.tst=$scope.currentMailing.msg_template_id; - } - console.log($scope.tst); - //Making the object for data - - for (var a in chck) { - var b ={} - b.id = chck[a]; - var splt = chck[a].split(" "); - - if(splt[1] == "civicrm_group"){ - for(var c in $scope.groupNamesList){ - if($scope.groupNamesList[c].id==splt[0]){ - b.text = $scope.groupNamesList[c].title; - } - } - } - if(splt[1] == "civicrm_mailing"){ - for(var c in $scope.mailList){ - if($scope.mailList[c].id==splt[0]){ - b.text = $scope.mailList[c].name; - } - } - } - chck2.push(b); - } - - console.log(chck2); - $scope.incGroup = chck2; - - - $scope.mailingForm = function() { - if ($scope.mailing_form.$valid) { - // Submit as normal - } - else { - $scope.mailing_form.submitted = true; - } - }; - - $scope.back = function (){ - $window.location.href = "#/mailing" ; - $route.reload(); - }; - - $scope.tmp = function (tst){ - $scope.currentMailing.msg_template_id=tst; - console.log($scope.currentMailing.msg_template_id+ "sasas"); - if($scope.currentMailing.msg_template_id == null){ - $scope.currentMailing.body_html=""; - $scope.currentMailing.subject=""; - } - else{ - for(var a in $scope.tmpList){ - - if($scope.tmpList[a].id==$scope.currentMailing.msg_template_id){ - $scope.currentMailing.body_html=$scope.tmpList[a].msg_html; - console.log($scope.tmpList[a].msg_subject); - $scope.currentMailing.subject=$scope.tmpList[a].msg_subject; - console.log($scope.currentMailing.subject); - } - } - } - }; - //initializing variables we will use for checkboxes, or for purpose of ng-show - $scope.acttab=0; - $scope.composeS="1"; - if($scope.currentMailing.forward_replies==0 && $scope.currentMailing.auto_responder==0){ - $scope.trackreplies="0"; - } - else { - $scope.trackreplies="1"; - } - if($scope.currentMailing.scheduled_date == null || $scope.currentMailing.scheduled_date == "") - $scope.now="1"; - else - $scope.now="0"; - - $scope.reply = function(){ - if($scope.trackreplies==0){ - $scope.trackreplies=1; - } - else{ - $scope.trackreplies=0; - $scope.currentMailing.forward_replies=0; - $scope.currentMailing.auto_responder=0; - } - } - - - $scope.recclicked = function(){ - //if($scope.acttab >=0){ - $scope.acttab =0; - //} - }; - - $scope.conclicked = function(){ - // if($scope.acttab >=1){ - $scope.acttab =1; - //} - }; - - $scope.schedclicked = function(){ - //if($scope.acttab >=2){ - $scope.acttab =2; - //} - }; - - //to split the value of selectedMail.scheduled_date into the date and time separately - $scope.scheddate={}; - $scope.scheddate.date = ""; - $scope.scheddate.time = ""; - $scope.ans=""; - - $scope.checkNow = function(){ - if($scope.now == 1 ){ - $scope.now = 0; - } - else{ - $scope.now = 1; - $scope.currentMailing.scheduled_date = null; - $scope.currentMailing.scheduled_id = null; - console.log($scope.currentMailing.scheduled_date); - $scope.scheddate.date = ""; - $scope.scheddate.time = ""; - } - } - - // To split the scheduled_date into date and time. The date format is not accepting - if(selectedMail.scheduled_date != null){ - $scope.ans= selectedMail.scheduled_date.split(" "); - $scope.scheddate.date=$scope.ans[0]; - $scope.scheddate.time=$scope.ans[1]; - console.log("scheddate.date is " + $scope.scheddate.date); - console.log("scheddate.time is " + $scope.scheddate.time); - } - - console.log(selectedMail); - - //changing the screen from compose on screen to upload content - $scope.upldChange= function(composeS){ - if(composeS=="1"){ - return true; - } - else - return false; - }; - //filter so we only get headers from mailing component - $scope.isHeader= function(hf){ - return hf.component_type == "Header"; - }; - //filter so we only get footers from mailing component - $scope.isFooter= function(f){ - return f.component_type == "Footer"; - }; - //filter so we only get auto-Responders from mailing component - $scope.isAuto= function(au){ - return au.component_type == "Reply"; - }; - //filter so we only get userDriven message templates - $scope.isUserDriven= function(mstemp){ - return (parseInt(mstemp.id)>58); - }; - //used for ng-show when trackreplies is selected. Only then we show forward replies and auto-responders options - $scope.trackr= function(trackreplies){ - if(trackreplies=="1"){ - return true; - } - else - return false; - } - - $scope.isGrp= function(grp){ - return grp.visibility == "Public Pages"; - }; - - $scope.isCompMail= function(ml){ - return ml.is_completed == 1; - }; - - $scope.upload = function(){ - console.log($scope.param.file_1.type); - }; - - $scope.upload_2 = function(){ - console.log($scope.param.file_2); - }; - - $scope.upload_3 = function(){ - console.log($scope.param.file_3); - }; - - $scope.preview_update = function(){ - var resulta =crmApi('Mailing','preview',{id:$scope.currentMailing.id}); - resulta.success(function(data) { - if (data.is_error == 0) { - console.log("came"); - console.log(data.values); - $scope.previewbody_html=data.values.html; - $scope.previewbody_text=data.values.text; - $scope.preview_subject=data.values.subject; - console.log($scope.preview_subject); - $scope.pre = true; - $scope.$digest(); - $scope.$apply(); - } - }); - }; - - $scope.isBody_text = function(){ - if($scope.currentMailing.body_text == null || $scope.currentMailing.body_text == "" ) - return false; - else - return true; - }; - - $scope.deliberatelyTrustDangerousSnippet = function() { - return $sce.trustAsHtml($scope.previewbody_html); - }; - - $scope.deliberatelyTrustDangerousSnippet2 = function() { - return $sce.trustAsHtml($scope.previewbody_text); - }; - - $scope.deliberatelyTrustDangerousSnippet3 = function() { - return $sce.trustAsHtml($scope.preview_subject); - }; - - $scope.mailing_recipients= function() { - console.log("the id is " + $scope.currentMailing.id); - var resulta =crmApi('MailingRecipients', 'get', {mailing_id: $scope.currentMailing.id, options: {limit:1000}}); - resulta.success(function(data) { - if (data.is_error == 0) { - console.log("Entered Mailing Recipients"); - console.log(data); - $scope.noOfRecipients=data.count; - console.log($scope.noOfRecipients); - $scope.$digest(); - $scope.$apply(); - } - }); - } - - $scope.mailingGroup = function() { - var resulta =crmApi('MailingGroup', 'get', {mailing_id: $scope.currentMailing.id, options: {limit:1000}}) - resulta.success(function(data) { - console.log("I am awesome " ); - console.log(data.values); - $scope.mailid = []; - chck = []; - angular.forEach(data.values, function(value,key){ - var b = value.entity_id + " " + value.entity_table +" " + value.group_type; - var c = value.id; - chck.push(b); - $scope.mailid.push(c); - }); - console.log(chck); - console.log($scope.mailid); - for(var a in chck) - { var b ={} - b.id = chck[a]; - var splt = chck[a].split(" "); - - if(splt[1] == "civicrm_group"){ - for(var c in $scope.groupNamesList){ - if($scope.groupNamesList[c].id==splt[0]){ - b.text = $scope.groupNamesList[c].title; - } - } - } - if(splt[1] == "civicrm_mailing"){ - for(var c in $scope.mailList){ - if($scope.mailList[c].id==splt[0]){ - b.text = $scope.mailList[c].name; - } - } - } - chck2.push(b); - } - - console.log(chck2); - $scope.incGroup = chck2; - $scope.mailing_recipients(); - }); - } - - $scope.save_repeat = function(){ - if ($scope.from.total != "") { - var splt = $scope.from.total.split(" "); - var splta = splt[1].substring(1,(splt[1].length-1)); - var spltb = splt[0]; - console.log(splta); - console.log(spltb); - $scope.currentMailing.from_email = splta; - $scope.currentMailing.from_name = spltb; - } - - if ($scope.currentMailing.scheduled_date == $scope.currentMailing.approval_date - && $scope.currentMailing.scheduled_date != null) { - console.log("Do Nothing"); - } - else { - $scope.currentMailing.scheduled_date= $scope.scheddate.date + " " + $scope.scheddate.time ; - if ($scope.currentMailing.scheduled_date!=" ") { - $scope.currentMailing.scheduled_id= $scope.user_id; - } - else { - $scope.currentMailing.scheduled_date= null; - } - } - - - } - - $scope.save_next = function() { - $scope.save_repeat(); - $scope.incGrp=[]; - $scope.excGrp=[]; - $scope.incMail=[]; - $scope.excMail=[]; - console.log(chck); - $scope.answer=""; - for(req_id in chck){ - $scope.answer = chck[req_id].split(" "); - - if($scope.answer[1] == "civicrm_mailing" && $scope.answer[2]=="include"){ - $scope.incMail.push($scope.answer[0]); - } - else if($scope.answer[1] == "civicrm_mailing" && $scope.answer[2]=="exclude"){ - $scope.excMail.push($scope.answer[0]); - } - if($scope.answer[1] == "civicrm_group" && $scope.answer[2]=="include"){ - $scope.incGrp.push($scope.answer[0]); - } - else if($scope.answer[1] == "civicrm_group" && $scope.answer[2]=="exclude"){ - $scope.excGrp.push($scope.answer[0]); - } - } - - console.log($scope.incMail + " inc mail"); - console.log($scope.excMail + " exc mail"); - console.log($scope.incGrp + " inc group"); - console.log($scope.excGrp + " exc group"); - - console.log($scope.mailid + "coolio") - if ($scope.mailid != null) { - for (var a in $scope.mailid) { - var result_2= crmApi('MailingGroup', 'delete', { - id: $scope.mailid[a] - }); - } - } - - var result = crmApi('Mailing', 'create', { - id: $scope.currentMailing.id, - name: $scope.currentMailing.name, - visibility: $scope.currentMailing.visibility, - created_id: $scope.currentMailing.created_id, - subject: $scope.currentMailing.subject, - msg_template_id: $scope.currentMailing.msg_template_id==null ? "" : $scope.currentMailing.msg_template_id, - open_tracking: $scope.currentMailing.open_tracking, - url_tracking: $scope.currentMailing.url_tracking, - forward_replies: $scope.currentMailing.forward_replies, - auto_responder: $scope.currentMailing.auto_responder, - from_name: $scope.currentMailing.from_name, - from_email: $scope.currentMailing.from_email, - replyto_email: $scope.currentMailing.replyto_email, - unsubscribe_id: $scope.currentMailing.unsubscribe_id, - resubscribe_id: $scope.currentMailing.resubscribe_id, - body_html: $scope.currentMailing.body_html, - body_text: $scope.currentMailing.body_text, - scheduled_date: $scope.currentMailing.scheduled_date==null ? "" : $scope.currentMailing.scheduled_date, - scheduled_id: $scope.currentMailing.scheduled_id==null ? "" : $scope.currentMailing.scheduled_id, - campaign_id: $scope.currentMailing.campaign_id==null ? "" : $scope.currentMailing.campaign_id, - header_id: $scope.currentMailing.header_id, - footer_id: $scope.currentMailing.footer_id, - groups: {include: $scope.incGrp, - exclude: $scope.excGrp - }, - mailings: {include: $scope.incMail, - exclude: $scope.excMail - }, - is_completed: $scope.currentMailing.is_completed, - approver_id: $scope.currentMailing.approver_id, - approval_status_id: $scope.currentMailing.approval_status_id, - approval_date: $scope.currentMailing.approval_date, - dedupe_email: $scope.currentMailing.dedupe_email - }, - true); - //var result = crmApi('Mailing', 'create', $scope.currentMailing, true); - result.success(function(data) { - if (data.is_error == 0) { - $scope.currentMailing.id = data.id; - console.log("the id is " + $scope.currentMailing.id ); - console.log("OK"); - console.log(data); - $scope.mailingGroup(); - } - console.log("OK2"); - }); - }; - - $scope.save_next_page2 = function() { - $scope.save_repeat(); - var result = crmApi('Mailing', 'create', { - id: $scope.currentMailing.id, - name: $scope.currentMailing.name, - visibility: $scope.currentMailing.visibility, - created_id: $scope.currentMailing.created_id, - subject: $scope.currentMailing.subject, - msg_template_id: $scope.currentMailing.msg_template_id==null ? "" : $scope.currentMailing.msg_template_id, - open_tracking: $scope.currentMailing.open_tracking, - url_tracking: $scope.currentMailing.url_tracking, - forward_replies: $scope.currentMailing.forward_replies, - auto_responder: $scope.currentMailing.auto_responder, - from_name: $scope.currentMailing.from_name, - from_email: $scope.currentMailing.from_email, - replyto_email: $scope.currentMailing.replyto_email, - unsubscribe_id: $scope.currentMailing.unsubscribe_id, - resubscribe_id: $scope.currentMailing.resubscribe_id, - body_html: $scope.currentMailing.body_html, - body_text: $scope.currentMailing.body_text, - scheduled_date: $scope.currentMailing.scheduled_date==null ? "" : $scope.currentMailing.scheduled_date, - scheduled_id: $scope.currentMailing.scheduled_id==null ? "" : $scope.currentMailing.scheduled_id, - campaign_id: $scope.currentMailing.campaign_id==null ? "" : $scope.currentMailing.campaign_id, - header_id: $scope.currentMailing.header_id, - footer_id: $scope.currentMailing.footer_id, - is_completed: $scope.currentMailing.is_completed, - approver_id: $scope.currentMailing.approver_id, - approval_status_id: $scope.currentMailing.approval_status_id, - approval_date: $scope.currentMailing.approval_date, - dedupe_email: $scope.currentMailing.dedupe_email - }, - true); - //var result = crmApi('Mailing', 'create', $scope.currentMailing, true); - result.success(function(data) { - if (data.is_error == 0) { - $scope.currentMailing.id = data.id; - console.log("the id is " + $scope.currentMailing.id ); - console.log("OK"); - console.log(data); - } - console.log("OK2"); - }); - }; - - - $scope.save = function() { - $scope.save_next_page2(); - $scope.back(); - }; - - $scope.save_page1 = function() { - $scope.save_next_page1(); - $scope.back(); - }; - - $scope.save_next_page1 = function() { - if($scope.currentMailing.id == null){ - $scope.currentMailing.subject = $scope.currentMailing.name; - $scope.save_next(); - } - else { - $scope.save_next(); - } - - }; - - $scope.submitButton= function(){ - $scope.currentMailing.approval_status_id = "1"; - $scope.currentMailing.approver_id = $scope.user_id; - var currentdate = new Date(); - var yyyy = currentdate.getFullYear(); - var mm = currentdate.getMonth() + 1; - mm = mm<10 ? '0' + mm : mm; - var dd = currentdate.getDate(); - dd = dd<10 ? '0' + dd : dd; - var hh = currentdate.getHours(); - hh = hh<10 ? '0' + hh : hh; - var min = currentdate.getMinutes(); - min = min<10 ? '0' + min : min; - var sec = currentdate.getSeconds(); - sec = sec<10 ? '0' + sec : sec; - $scope.currentMailing.approval_date = yyyy + "/"+ mm - + "/" + dd + " " - + hh + ":" - + min + ":" + sec; - console.log($scope.now + "sched immediately"); - if($scope.now == 1){ - $scope.currentMailing.scheduled_date = $scope.currentMailing.approval_date; - } - console.log($scope.currentMailing.approval_date); - $scope.save(); - }; - - $scope.$watch('pre',function(){ - console.log("dsfdfsfds"); - if($scope.pre==true){ - $('#prevmail').dialog({ - title: 'Preview Mailing', - width: 1080, - height: 800, - closed: false, - cache: false, - modal: true, - close :function(){console.log("close"); - $scope.pre = false; $scope.$apply();} - }); - } - },true); - - $scope.sendTest = function(){ - console.log("Opened send Test"); - - var resulta =crmApi('Mailing','send_test',{test_email:$scope.testMailing.name, test_group:$scope.testMailing.group, - mailing_id:$scope.currentMailing.id}); - resulta.success(function(data) { - console.log("worked"); - }); - }; - }); - - -// Directive to go to the next tab - crmMailing.directive('nexttab', function() { - return { - restrict: 'A', - link: function(scope, element, attrs) { - $(element).parent().parent().parent().parent().parent().tabs(); - console.log($(element).parent().parent().parent().parent().parent()); - // var myarr = new Array(1,2); - //$(element).parent().parent().parent().parent().parent().tabs({disabled:myarr}); - $(element).on("click",function() { - scope.acttab=scope.acttab +1; - /* var myArray1 = new Array( ); - for ( var i = 0; i < 3; i++ ) { - if(scope.acttab!=i) - myArray1.push(i); - }*/ - //$(element).parent().parent().parent().parent().parent().tabs( "option", "disabled", myArray1 ); - $(element).parent().parent().parent().parent().parent().tabs({active:scope.acttab}); - console.log("sid"); - }); - } - }; - }); - - // Directive to go to the previous tab - crmMailing.directive('prevtab', function() { - return { - restrict: 'A', - link: function(scope, element, attrs) { - $(element).parent().parent().parent().parent().parent().tabs(); - //var myarr = new Array(1,2); - //$(element).parent().parent().parent().parent().parent().tabs({disabled:myarr}); - $(element).on("click",function() { - scope.acttab=scope.acttab -1; - /* var myArray1 = new Array( ); - for ( var i = 0; i < 3; i++ ) { - if(scope.acttab!=i) - myArray1.push(i); - }*/ - // $(element).parent().parent().parent().parent().parent().tabs( "option", "disabled", myArray1 ); - $(element).parent().parent().parent().parent().parent().tabs({active:scope.acttab}); - console.log("sid"); - }); - } - }; - }); - - -/* crmMailing.directive('prevtab', 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) { - $(element).on("click", function () { - var temp = scope.tab_val - 1; - scope.tab_upd_dec(); - scope.$apply(); - if (temp != 3) { - $(".crmABTestingAllTabs").tabs("option", "active", temp); - } - scope.$apply(); - }); - } - }; - }); - - crmMailing.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) { - var tabselector = $(".crmABTestingAllTabs"); - tabselector.tabs(scope.$eval(attrs.nexttab)); - var myarr = new Array(1, 2, 3) -// disable remaining tabs - if(scope.sparestuff.isnew == true) - tabselector.tabs({disabled: myarr}); - $(element).on("click", function () { - if (scope.tab_val == 0) { - scope.create_abtest(); - } - else { - if (scope.tab_val == 2) { - scope.update_abtest(); - if (scope.currentABTest.winner_criteria_id == 1) { - scope.sparestuff.winnercriteria = "Open"; - scope.$apply(); - } - else { - if (scope.currentABTest.winner_criteria_id == 2) { - scope.sparestuff.winnercriteria = " Total Unique Clicks"; - scope.$apply(); - } - else { - if (scope.currentABTest.winner_criteria_id == 3) { - scope.sparestuff.winnercriteria = "Total Clicks on a particular link"; - scope.$apply(); - } - } - } - scope.a_b_update(); - } - } - scope.tab_upd(); - var myArray1 = new Array(); - for (var i = scope.max_tab + 1; i < 4; i++) { - myArray1.push(i); - } - tabselector.tabs("option", "disabled", myArray1); - tabselector.tabs("option", "active", scope.tab_val); - scope.$apply(); - }); - } - }; - }); -*/ - - // Select 2 Widget for selecting the included group - crmMailing.directive('chsgroup',function(){ - return { - restrict : 'AE', - link: function(scope,element, attrs){ - function format(item) { - if(!item.id) { - // return `text` for optgroup - return item.text; - } - // return item template - var a = item.id.split(" "); - if(a[1]=="civicrm_group" && a[2]=="include") - return "" + " " + "" + item.text; - if(a[1]=="civicrm_group" && a[2]=="exclude") - return "" + " " + "" + item.text; - if(a[1]=="civicrm_mailing" && a[2]=="include") - return "" + " " + "" + item.text; - if(a[1]=="civicrm_mailing" && a[2]=="exclude") - return "" + " " + "" + item.text; - } - - $(element).select2({ - width:"400px", - placeholder: "Choose Recipients", - formatResult: format, - formatSelection: format, - escapeMarkup: function(m) { return m; }, - }).select2("data", scope.incGroup); - - - $(element).on("select2-opening", function() - { scope.incGroup=chck; - console.log(scope.incGroup); - scope.$apply(); - - }); - - $(element).on('select2-selecting', function(e) { - chck.push(e.val); - scope.incGroup=chck; - scope.$apply(); - console.log(scope.incGroup); - - }); - - $(element).on("select2-removed", function(e) { - var index = chck.indexOf(e.val); - chck.splice(index, 1); - scope.incGroup=chck; - console.log(scope.incGroup); - scope.$apply(); - }); - - } - }; - }); - - crmMailing.directive('groupselect',function(){ - return { - restrict : 'AE', - link: function(scope,element, attrs){ - $(element).select2({width:"200px", data: mltokens, placeholder:"Insert Token"}); - $(element).on('select2-selecting', function(e) { - - scope.$evalAsync('_resetSelection()');console.log(mltokens); - var a = $(element).attr('id'); - if(a=="htgroup"){ - var msg = document.getElementById("body_html").value; - var cursorlen = document.getElementById("body_html").selectionStart; - console.log(cursorlen); - var textlen = msg.length; - document.getElementById("body_html").value = msg.substring(0, cursorlen) + e.val + msg.substring(cursorlen, textlen); - scope.currentMailing.body_html = msg.substring(0, cursorlen) + e.val + msg.substring(cursorlen, textlen); - console.log(document.getElementById("body_html").value); - console.log(scope.currentMailing.body_html); - var cursorPos = (cursorlen + e.val.length); - document.getElementById("body_html").selectionStart = cursorPos; - document.getElementById("body_html").selectionEnd = cursorPos; - document.getElementById("body_html").focus(); - } - else if(a=="subgroup"){ - var msg = document.getElementById("sub").value; - var cursorlen = document.getElementById("sub").selectionStart; - console.log(cursorlen); - var textlen = msg.length; - document.getElementById("sub").value = msg.substring(0, cursorlen) + e.val + msg.substring(cursorlen, textlen); - scope.currentMailing.subject = msg.substring(0, cursorlen) + e.val + msg.substring(cursorlen, textlen); - console.log(document.getElementById("sub").value); - console.log(scope.currentMailing.subject); - var cursorPos = (cursorlen + e.val.length); - document.getElementById("sub").selectionStart = cursorPos; - document.getElementById("sub").selectionEnd = cursorPos; - document.getElementById("sub").focus(); - } - else if(a=="textgroup"){ - var msg = document.getElementById("body_text").value; - var cursorlen = document.getElementById("body_text").selectionStart; - console.log(cursorlen); - var textlen = msg.length; - document.getElementById("body_text").value = msg.substring(0, cursorlen) + e.val + msg.substring(cursorlen, textlen); - scope.currentMailing.body_text = msg.substring(0, cursorlen) + e.val + msg.substring(cursorlen, textlen); - console.log(document.getElementById("body_text").value); - console.log(scope.currentMailing.body_text); - var cursorPos = (cursorlen + e.val.length); - document.getElementById("body_text").selectionStart = cursorPos; - document.getElementById("body_text").selectionEnd = cursorPos; - document.getElementById("body_text").focus(); - } - scope.$apply(); - e.preventDefault(); - }) - } - }; - }); - - - - // Used for the select date option. This is used for giving scheduled_date its date value - crmMailing.directive('chsdate',function(){ - return { - restrict: 'AE', - link: function(scope,element,attrs){ - $(element).datepicker({ - dateFormat: "yy-mm-dd", - onSelect: function(date) { - $(".ui-datepicker a").removeAttr("href"); - scope.scheddate.date=date.toString(); - scope.$apply(); - console.log(scope.scheddate.date); - } - }); - } - }; - }); - - crmMailing.directive('file', function(){ - return { - scope: { - file: '=' - }, - link: function(scope, el, attrs){ - el.bind('change', function(event){ - var files = event.target.files; - console.log(event); - var file = files[0]; - scope.file = file ? file : undefined; - scope.$apply(); - }); - } - }; - }); - - - crmMailing.directive('checktimeentry',function(){ - return { - restrict :'AE', - link: function (scope, element, attrs) { - $(element).timeEntry({show24Hours:true}); - } - } - }); - - //This controller is used for creating the mailing list. Simply gets all the mailing data from civiAPI - crmMailing.controller('mailingListCtrl', function($scope, crmApi, mailingList, $route) { - if (global == 0) { - global = global + 1; - $route.reload(); - } - $scope.mailingList = mailingList.values; - $scope.checkEmpty = function(){ - if($scope.mailingList == "") - return true; - else - return false; - } - console.log($scope.mailingList + "sdadsa"); - $scope.deleteMail = function (mail) { - crmApi('Mailing', 'delete', {id: mail.id}, { - error: function (data) { - CRM.alert(data.error_message, ts('Error')); - } - }) - .then(function (data) { - if (!data.is_error) { - console.log(mailingList.values); - console.log(mailingList.values[mail.id]); - delete mailingList.values[mail.id]; - $scope.$digest(); - $route.reload(); - } - }); - - }; - - $scope.edit = function (){ - global = global - 1; - }; - - }); - -})(angular, CRM.$, CRM._); - -/* example of params - [attachFile_1] => Array ( [uri] => /var/www/siddhant/drupal-7.27/sites/default/files/civicrm/custom/blog_2_odt_2c622a7b5e32415a92e81ed97d6554c7.unknown [type] => application/vnd.oasis.opendocument.text [location] => /var/www/siddhant/drupal-7.27/sites/default/files/civicrm/custom/blog_2_odt_2c622a7b5e32415a92e81ed97d6554c7.unknown [description] => dasdas [upload_date] => 20140706105804 [tag] => Array ( ) [attachment_taglist] => Array ( ) ) - */ diff --git a/partials/crmMailingType/attachments.html b/partials/crmMailingType/attachments.html deleted file mode 100644 index 85b7d47d39..0000000000 --- a/partials/crmMailingType/attachments.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - -
Attach Files - - - -
Attach Files - - - -
Attach Files - - - -
- - - diff --git a/partials/crmMailingType/composeonScreen.html b/partials/crmMailingType/composeonScreen.html deleted file mode 100644 index a6b38a34e3..0000000000 --- a/partials/crmMailingType/composeonScreen.html +++ /dev/null @@ -1,17 +0,0 @@ -
- - - - - - - -
-   Save Template -
diff --git a/partials/crmMailingType/content.html b/partials/crmMailingType/content.html deleted file mode 100644 index 75696deb68..0000000000 --- a/partials/crmMailingType/content.html +++ /dev/null @@ -1,98 +0,0 @@ - -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
From E-mail Address - -
Reply to E-mail Address - -
Mailing Subject - -
- Mailing subject required. -
Mailing Subject Token - -
Use Template - -
-
- - -
-
-
HTML Format
-
-
- - - - - - -
-
- - - - - - - - - - - - -
-
-
- - - diff --git a/partials/crmMailingType/headerandFooter.html b/partials/crmMailingType/headerandFooter.html deleted file mode 100644 index 0c1da434e4..0000000000 --- a/partials/crmMailingType/headerandFooter.html +++ /dev/null @@ -1,25 +0,0 @@ - -
- - - - - - - - - - -
Mailing Header - -
Mailing Footer - -
- diff --git a/partials/crmMailingType/ht.html b/partials/crmMailingType/ht.html deleted file mode 100644 index 86b0e02736..0000000000 --- a/partials/crmMailingType/ht.html +++ /dev/null @@ -1,15 +0,0 @@ - - -
-                                                -                                                -                                - - -

-        - -

- - - diff --git a/partials/crmMailingType/mailingGroup.html b/partials/crmMailingType/mailingGroup.html deleted file mode 100644 index 3ba5aec882..0000000000 --- a/partials/crmMailingType/mailingGroup.html +++ /dev/null @@ -1,20 +0,0 @@ - - -
- -

- - - diff --git a/partials/crmMailingType/mailingList.html b/partials/crmMailingType/mailingList.html deleted file mode 100644 index 6c73a4f3f5..0000000000 --- a/partials/crmMailingType/mailingList.html +++ /dev/null @@ -1,46 +0,0 @@ - -
- All partially completed and completed mail are listed here -
- -
- - - - - - - - - - - - - - - - - - - - - - -
Mailing NameCreated ByCreated DateSent ByScheduled
{{mail.name}}{{mail.from_email}}{{mail.created_date}}{{mail.from_email}}{{mail.scheduled_date}}Edit - Delete -
-
- -
-
- You have no Mailings -
- - - - diff --git a/partials/crmMailingType/main.html b/partials/crmMailingType/main.html deleted file mode 100644 index 0fba3ce902..0000000000 --- a/partials/crmMailingType/main.html +++ /dev/null @@ -1,25 +0,0 @@ - - - -
- - -
-
-
- -
-
-
- -
-
-
-
diff --git a/partials/crmMailingType/plainText.html b/partials/crmMailingType/plainText.html deleted file mode 100644 index 537828d681..0000000000 --- a/partials/crmMailingType/plainText.html +++ /dev/null @@ -1,14 +0,0 @@ - -
-                                                -                                                -                                - - -

-        - -

diff --git a/partials/crmMailingType/previewMailing.html b/partials/crmMailingType/previewMailing.html deleted file mode 100644 index 7b1d265c49..0000000000 --- a/partials/crmMailingType/previewMailing.html +++ /dev/null @@ -1,18 +0,0 @@ - -
- - - -
- - diff --git a/partials/crmMailingType/preview_ht.html b/partials/crmMailingType/preview_ht.html deleted file mode 100644 index 0e005c50a1..0000000000 --- a/partials/crmMailingType/preview_ht.html +++ /dev/null @@ -1,22 +0,0 @@ - - -
- - - - - - - - - - - -
Subject:
Html:
- diff --git a/partials/crmMailingType/preview_plaintext.html b/partials/crmMailingType/preview_plaintext.html deleted file mode 100644 index 5b54864806..0000000000 --- a/partials/crmMailingType/preview_plaintext.html +++ /dev/null @@ -1,17 +0,0 @@ - -
- - - - - - - - - - - -
Subject:
PlainText:
diff --git a/partials/crmMailingType/recipient.html b/partials/crmMailingType/recipient.html deleted file mode 100644 index 04054d2723..0000000000 --- a/partials/crmMailingType/recipient.html +++ /dev/null @@ -1,56 +0,0 @@ - - -
-
-
- - - - - - - - - - - - - - - -
Name your Mailing * - -
Campaign - -
Remove Duplicates? - -
-
- -
-
Mailing Recipients
-
-
-
- - - - - - - - - -
-
-
- - diff --git a/partials/crmMailingType/sched.html b/partials/crmMailingType/sched.html deleted file mode 100644 index 0ff114d85a..0000000000 --- a/partials/crmMailingType/sched.html +++ /dev/null @@ -1,39 +0,0 @@ - - -
- - - - - - - - - - - - - - - - - -
Send Immediately - -
OR
Schedule Mailing - - Time - -
- -
- Enter the time in the 12:32:45 format where 12 is the hour, 32 the minutes and 45 the seconds. -
-
- - diff --git a/partials/crmMailingType/send.html b/partials/crmMailingType/send.html deleted file mode 100644 index a558a53009..0000000000 --- a/partials/crmMailingType/send.html +++ /dev/null @@ -1,61 +0,0 @@ - -
-
-
-

Preview

-
-
- -
-
-
-
-
-
- - - - - - - - - -
-
- - - - - - - - - - - - -
- -
-
- - diff --git a/partials/crmMailingType/test.html b/partials/crmMailingType/test.html deleted file mode 100644 index 6c3a5e136b..0000000000 --- a/partials/crmMailingType/test.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - -
Send to address - -
Send to this Group - -
- -
- diff --git a/partials/crmMailingType/trackandRespond.html b/partials/crmMailingType/trackandRespond.html deleted file mode 100644 index 7de7c61177..0000000000 --- a/partials/crmMailingType/trackandRespond.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

Tracking

-
-   Track Click Throughs -
-
- Track the number of times recipients click each link in this mailing. NOTE: When this feature is enabled, all links in the message body will be automaticallly re-written to route through your CiviCRM server prior to redirecting to the target page. -
-
-   Track Opens -
-
- Track the number of times recipients open this mailing in their email software. -
-
-

Responding

-
-   Track Replies -
-
- Recipients' replies are sent to a CiviMail specific address instead of the sender's address so they can be stored within CiviCRM. -
-
-   Forward Replies -
-
- If a recipient replies to this mailing, forward the reply to the FROM Email address specified for the mailing. -
-
-   Auto-Respond to Replies     - -
-
- If a recipient replies to this mailing, send an automated reply using the selected message. -
-
-

Online Publication

-
- - - - - - -
Mailing Visibility - -
- - diff --git a/partials/crmMailingType/uploadContent.html b/partials/crmMailingType/uploadContent.html deleted file mode 100644 index 0f50aeb231..0000000000 --- a/partials/crmMailingType/uploadContent.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - -
Upload TEXT Message - -
Upload HTML Message - -
- - -- 2.25.1