CRM-14807 - replacing stale PR 3450
authorDave Greenberg <dave@civicrm.org>
Wed, 2 Jul 2014 00:06:13 +0000 (17:06 -0700)
committerDave Greenberg <dave@civicrm.org>
Wed, 2 Jul 2014 00:06:13 +0000 (17:06 -0700)
----------------------------------------
* CRM-14807:
  https://issues.civicrm.org/jira/browse/CRM-14807

CRM/Admin/Form/ScheduleReminders.php
CRM/Core/BAO/ActionSchedule.php
CRM/Upgrade/Incremental/sql/4.5.beta1.mysql.tpl
templates/CRM/Admin/Form/ScheduleReminders.tpl
templates/CRM/Admin/Page/ScheduleReminders.hlp
xml/schema/Core/ActionSchedule.xml

index 4d089cfeba0add2bd611db22a0fa1d6c0aaf8821..076a2f3c3c5272e94fd2b59ffdb09f89429a6ce9 100644 (file)
@@ -186,6 +186,9 @@ class CRM_Admin_Form_ScheduleReminders extends CRM_Admin_Form {
     $this->add('select', 'end_action', ts('Repetition Condition'), $condition, TRUE);
     $this->add('select', 'end_date', ts('Date Field'), $sel4, TRUE);
 
+    $this->add('text', 'from_name', ts('From Name'));
+    $this->add('text', 'from_email', ts('From Email'));    
+
     $recipient = 'activity_contacts';
     $recipientListingOptions = array();
 
@@ -358,7 +361,9 @@ class CRM_Admin_Form_ScheduleReminders extends CRM_Admin_Form {
       'record_activity',
       'limit_to',
       'mode',
-      'sms_provider_id'
+      'sms_provider_id',
+      'from_name',
+      'from_email',
     );
     foreach ($keys as $key) {
       $params[$key] = CRM_Utils_Array::value($key, $values);
index e1e48608e48162330633455c114c74e57aafcb09..1ac9deb7fc64accbcdeb99bc932cda1bdef9dc1a 100755 (executable)
@@ -680,6 +680,10 @@ WHERE   cas.entity_value = $id AND
     while ($actionSchedule->fetch()) {
       $extraSelect = $extraJoin = $extraWhere = $extraOn = '';
 
+    if ($actionSchedule->from_email)
+            $fromEmailAddress = "$actionSchedule->from_name <$actionSchedule->from_email>";
+
+
       if ($actionSchedule->record_activity) {
         if ($mapping->entity == 'civicrm_membership') {
           $activityTypeID =
index 553c71502b2ff8da10d2080f5dbdadfd0d28b13e..f1a4e4ba1cef664c2dc3e8ab3cface18ec4e17da 100644 (file)
@@ -1 +1,6 @@
 {* file to handle db changes in 4.5.beta1 during upgrade *}
+-- CRM-14807
+ALTER TABLE `civicrm_action_schedule`
+  ADD COLUMN `from_name` varchar(255) AFTER `absolute_date`;
+ALTER TABLE `civicrm_action_schedule`
+  ADD COLUMN `from_email` varchar(255) AFTER `from_name`;
index 1ef667c393ba1a51dbfaf3164fb0fc26517d1df0..e77c78b896b1793245d792f0631c2100adda3bc5 100644 (file)
         </table>
      </td>
     </tr>
+    <tr>
+      <td class="label" width="20%">{$form.from_name.label}</td>
+      <td>{$form.from_name.html}&nbsp;&nbsp;{help id="id-from_name_email"}</td>
+    </tr>
+    <tr>
+      <td class="label" width="20%">{$form.from_email.label}</td>
+      <td>{$form.from_email.html}&nbsp;&nbsp;</td>
+    </tr>
     <tr class="crm-scheduleReminder-form-block-recipient">
       <td id="recipientLabel" class="right">{$form.recipient.label}</td><td colspan="3">{$form.limit_to.html}&nbsp;&nbsp;{$form.recipient.html}&nbsp;&nbsp;{help id="recipient" title=$form.recipient.label}</td>
     </tr>
index b10302985e0b8d16de9b6a12520622d60398554e..8028a071a2858a864b77cd3f61056b1b5ee89e29 100644 (file)
 {htxt id="recipient"}
   {ts}Only send reminders to participants with the status(es) selected above AND who match this criteria. If you select Manual Recipients - only those people will receive the reminder (AND only if they are ALSO participants with the selected status).{/ts}
 {/htxt}
+
+{htxt id="id-from_name_email-title"}
+  {ts}Specify FROM Name and Email{/ts}
+{/htxt}
+
+{htxt id="id-from_name_email"}
+  {ts}You can set the FROM name and email address for this reminder in these fields. If you leave these fields blank, the default FROM name and email address for your site will be used (Administer > Communications > FROM Email Addresses).{/ts}
+{/htxt}
index 8d2fa36eaab66adff52c895c4d58074fa0ad1344..bdb9bc9b9c30e536e764e0ef6090b4b27b41f92d 100644 (file)
        <comment>Date on which the reminder be sent.</comment>
        <add>4.1</add>
   </field>
+  <field>
+    <name>from_name</name>
+    <type>varchar</type>
+    <length>255</length>
+    <comment>Name in "from" field</comment>
+    <add>4.5</add>
+  </field>
+  <field>
+    <name>from_email</name>
+    <type>varchar</type>
+    <length>255</length>
+    <comment>Email address in "from" field</comment>
+    <add>4.5</add>
+  </field>
   <field>
     <name>mode</name>
     <title>Message Mode</title>