CRM-13766 set scheduled date in params after approval
authorBrian Shaughnessy <brian@lcdservices.biz>
Fri, 15 Nov 2013 01:24:07 +0000 (20:24 -0500)
committerBrian Shaughnessy <brian@lcdservices.biz>
Fri, 15 Nov 2013 01:24:07 +0000 (20:24 -0500)
CRM/Mailing/Form/Approve.php
CRM/Mailing/Form/Schedule.php

index 664bcb2a9f525abf6022bfc803486d95c248f315..959531100bd01f0ee3e9bfeffa22500351afd4ce 100644 (file)
@@ -196,6 +196,13 @@ class CRM_Mailing_Form_Approve extends CRM_Core_Form {
       $job->mailing_id = $ids['mailing_id'];
       $job->delete();
     }
+    else {
+      $mailing = new CRM_Mailing_BAO_Mailing();
+      $mailing->id = $ids['mailing_id'];
+      $mailing->find(TRUE);
+
+      $params['scheduled_date'] = CRM_Utils_Date::processDate($mailing->scheduled_date);
+    }
 
     CRM_Mailing_BAO_Mailing::create($params, $ids);
 
index 35987319f676de01406c4bfdefe8a7a17e3883f7..33617775e2f5952fd5a22e7682d4f0bb23bd6935 100644 (file)
@@ -294,18 +294,15 @@ class CRM_Mailing_Form_Schedule extends CRM_Core_Form {
     }
     else {
       // reset them in case this mailing was rejected
+      $mailing = new CRM_Mailing_BAO_Mailing();
+      $mailing->id = $ids['mailing_id'];
+      $mailing->find(TRUE);
+
       $mailing->approver_id = 'null';
       $mailing->approval_date = 'null';
       $mailing->approval_status_id = 'null';
     }
 
-    if ($params['now']) {
-      $params['scheduled_date'] = date('YmdHis');
-    }
-    else {
-      $params['scheduled_date'] = CRM_Utils_Date::processDate($params['start_date'] . ' ' . $params['start_date_time']);
-    }
-
     /* Build the mailing object */
     CRM_Mailing_BAO_Mailing::create($params, $ids);