$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);
return grp.visibility == "Public Pages";
};
+ $scope.isCompMail= function(ml){
+ return ml.is_completed == 1;
+ };
$scope.save = function() {
$scope.incGrp=[];
$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,
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) {
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;
MailingGroup api needs to be improved to bind the chosen groups
-->
-<!--<br>
-<select multiple chsgroup ng-model="incGroup" ng-options="grp.name as grp.title for grp in groupNamesList| filter: isGrp ">
- <option value=""></option>
-</select>
-<br> <br>
-
-
-<br>
-<select multiple placeholder: "Exclude Group" chsgroup ng-model="excGroup" ng-options="grp.name as grp.title for grp in groupNamesList| filter: isGrp ">
- <option value=""></option>
-</select>
-<br> <br>
--->
-
<br>
<select multiple chsgroup>
<option ng-repeat="grp in groupNamesList| filter: isGrp" value="{{grp.id}} group include" > Include {{grp.title}}</option>
<option ng-repeat="grp in groupNamesList| filter: isGrp" value="{{grp.id}} group exclude" > Exclude {{grp.title}}</option>
- <option ng-repeat="ml in mailList" value="{{ml.id}} mail include" > Include Mailing {{ml.name}}</option>
- <option ng-repeat="ml in mailList" value="{{ml.id}} mail exclude" > Exclude Mailing {{ml.name}}</option>
-
+ <option ng-repeat="ml in mailList| filter:isCompMail" value="{{ml.id}} mail include" > Include Mailing {{ml.name}}</option>
+ <option ng-repeat="ml in mailList| filter:isCompMail" value="{{ml.id}} mail exclude" > Exclude Mailing {{ml.name}}</option>
</select>
<br> <br>
+
+
+<!--<a class="crm-add-entity crm-hover-button" href="/siddhant/drupal-7.27/civicrm/profile/create?reset=1&context=dialog&gid=4">
+<span class="icon Individual-profile-icon"></span>
+New Individual
+</a>-->