groups working
authorSiddhant Rajagopalan <rajgo94@gmail.com>
Fri, 4 Jul 2014 07:37:06 +0000 (13:07 +0530)
committerSiddhant Rajagopalan <rajgo94@gmail.com>
Sat, 26 Jul 2014 05:11:57 +0000 (10:41 +0530)
CRM/Mailing/BAO/Mailing.php
js/angular-newMailing.js
partials/crmMailingType/mailingGroup.html
partials/crmMailingType/sched.html

index 072efba09751e0b5cd44c0f7e55f3b98a142b66b..63edbeef694814f45029a2885971f0859ca9bdc7 100644 (file)
@@ -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;
   }
 
index 4b2e83a6d7345c89058f2832840b06b4d63ba9f2..ad307ba9167ef10b4206a55136a50d602624341c 100644 (file)
                $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;
index 3a98c4a283892b1eba432cc6756e6290bb6bde5b..c2ac7250090e2c24d7ec6ed212f320bae6b08aa3 100644 (file)
@@ -4,26 +4,17 @@ Required vars: groupNamesList
 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>-->
index f0e39744bf2d637a24cff67f7a50e9bcedb7576e..876948e6ad6046def39fae96bf489f95f9b205c1 100644 (file)
@@ -17,7 +17,7 @@ Required vars: currentMailing
   <tr ng-show="now==0">
     <td class="label">Schedule Mailing</td>
     <td>
-                <input type="date" chsdate ng-model="scheddate.date">
+                <input type="text" chsdate ng-model="scheddate.date">
     </td>
     <td class="label" >Time</td>
                <td>