From: Siddhant Rajagopalan Date: Fri, 4 Jul 2014 07:37:06 +0000 (+0530) Subject: groups working X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=91fa14b0efb3a11ecfcf53ad97ea39143312264b;p=civicrm-core.git groups working --- diff --git a/CRM/Mailing/BAO/Mailing.php b/CRM/Mailing/BAO/Mailing.php index 072efba097..63edbeef69 100644 --- a/CRM/Mailing/BAO/Mailing.php +++ b/CRM/Mailing/BAO/Mailing.php @@ -1657,7 +1657,8 @@ ORDER BY civicrm_email.is_bulkmail DESC // Populate the recipients. $mailing->getRecipients($job->id, $mailing->id, NULL, NULL, TRUE, FALSE); } - + //print_r($params); + //exit; return $mailing; } diff --git a/js/angular-newMailing.js b/js/angular-newMailing.js index 4b2e83a6d7..ad307ba916 100644 --- a/js/angular-newMailing.js +++ b/js/angular-newMailing.js @@ -84,15 +84,14 @@ $scope.scheddate.time = ""; $scope.ans=""; - - - $scope.mailAutoResponder=""; // To split the scheduled_date into date and time. The date format is not accepting - /* if(selectedMail.scheduled_date != ""){ + 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); @@ -133,6 +132,9 @@ return grp.visibility == "Public Pages"; }; + $scope.isCompMail= function(ml){ + return ml.is_completed == 1; + }; $scope.save = function() { $scope.incGrp=[]; @@ -185,9 +187,10 @@ $scope.currentMailing.scheduled_id= "202"; } else { - $scope.currentMailing.scheduled_date= ""; + $scope.currentMailing.scheduled_date= null; } var result = crmApi('Mailing', 'create', { + id: $scope.currentMailing.id, name: $scope.currentMailing.name, visibility: $scope.currentMailing.visibility, created_id: $scope.currentMailing.created_id, @@ -209,8 +212,15 @@ campaign_id: $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, }, - true); + true); //var result = crmApi('Mailing', 'create', $scope.currentMailing, true); result.success(function(data) { if (data.is_error == 0) { @@ -279,7 +289,7 @@ restrict: 'AE', link: function(scope,element,attrs){ $(element).datepicker({ - dateFormat: 'yy-mm-dd', + dateFormat: "yy-mm-dd", onSelect: function(date) { $(".ui-datepicker a").removeAttr("href"); scope.dat =date; diff --git a/partials/crmMailingType/mailingGroup.html b/partials/crmMailingType/mailingGroup.html index 3a98c4a283..c2ac725009 100644 --- a/partials/crmMailingType/mailingGroup.html +++ b/partials/crmMailingType/mailingGroup.html @@ -4,26 +4,17 @@ Required vars: groupNamesList MailingGroup api needs to be improved to bind the chosen groups --> - -


+ + + diff --git a/partials/crmMailingType/sched.html b/partials/crmMailingType/sched.html index f0e39744bf..876948e6ad 100644 --- a/partials/crmMailingType/sched.html +++ b/partials/crmMailingType/sched.html @@ -17,7 +17,7 @@ Required vars: currentMailing Schedule Mailing - + Time